modify new ui
This commit is contained in:
parent
cf189a7600
commit
69caff5ce7
@ -523,133 +523,128 @@
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/MainWindow.cpp" line="66"/>
|
||||
<location filename="../ui/MainWindow.cpp" line="65"/>
|
||||
<source>model elements</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/MainWindow.cpp" line="72"/>
|
||||
<location filename="../ui/MainWindow.cpp" line="71"/>
|
||||
<source>attribte</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/MainWindow.cpp" line="109"/>
|
||||
<location filename="../ui/MainWindow.cpp" line="108"/>
|
||||
<source>Wave Curve</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/MainWindow.cpp" line="115"/>
|
||||
<location filename="../ui/MainWindow.cpp" line="114"/>
|
||||
<source>Speed Curve</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/MainWindow.cpp" line="124"/>
|
||||
<location filename="../ui/MainWindow.cpp" line="123"/>
|
||||
<source>3D Curve</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/MainWindow.cpp" line="136"/>
|
||||
<location filename="../ui/MainWindow.cpp" line="135"/>
|
||||
<source>Target number</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/MainWindow.cpp" line="136"/>
|
||||
<location filename="../ui/MainWindow.cpp" line="135"/>
|
||||
<source>Signal-to-noise ratio</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/MainWindow.cpp" line="137"/>
|
||||
<location filename="../ui/MainWindow.cpp" line="136"/>
|
||||
<source>Azimuth line of sight</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/MainWindow.cpp" line="137"/>
|
||||
<location filename="../ui/MainWindow.cpp" line="136"/>
|
||||
<source>Pitch gaze angle</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/MainWindow.cpp" line="138"/>
|
||||
<location filename="../ui/MainWindow.cpp" line="137"/>
|
||||
<source>azimuth</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/MainWindow.cpp" line="138"/>
|
||||
<location filename="../ui/MainWindow.cpp" line="137"/>
|
||||
<source>Pitch angle</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/MainWindow.cpp" line="139"/>
|
||||
<location filename="../ui/MainWindow.cpp" line="138"/>
|
||||
<source>attribute</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/MainWindow.cpp" line="139"/>
|
||||
<location filename="../ui/MainWindow.cpp" line="138"/>
|
||||
<source>Doppler</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/MainWindow.cpp" line="140"/>
|
||||
<location filename="../ui/MainWindow.cpp" line="139"/>
|
||||
<source>course</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/MainWindow.cpp" line="140"/>
|
||||
<location filename="../ui/MainWindow.cpp" line="139"/>
|
||||
<source>Speed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/MainWindow.cpp" line="141"/>
|
||||
<location filename="../ui/MainWindow.cpp" line="140"/>
|
||||
<source>longitude</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/MainWindow.cpp" line="141"/>
|
||||
<location filename="../ui/MainWindow.cpp" line="140"/>
|
||||
<source>latitude</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/MainWindow.cpp" line="142"/>
|
||||
<location filename="../ui/MainWindow.cpp" line="141"/>
|
||||
<source>distance</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/MainWindow.cpp" line="142"/>
|
||||
<location filename="../ui/MainWindow.cpp" line="141"/>
|
||||
<source>velocity</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/MainWindow.cpp" line="143"/>
|
||||
<location filename="../ui/MainWindow.cpp" line="142"/>
|
||||
<source>Radial dimensions</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/MainWindow.cpp" line="143"/>
|
||||
<location filename="../ui/MainWindow.cpp" line="142"/>
|
||||
<source>Target RCS</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/MainWindow.cpp" line="149"/>
|
||||
<location filename="../ui/MainWindow.cpp" line="148"/>
|
||||
<source>Report Table</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/MainWindow.cpp" line="158"/>
|
||||
<location filename="../ui/MainWindow.cpp" line="157"/>
|
||||
<source>Signal Indicator Lamp</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/MainWindow.cpp" line="165"/>
|
||||
<location filename="../ui/MainWindow.cpp" line="164"/>
|
||||
<source>ParamSetting</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/MainWindow.cpp" line="170"/>
|
||||
<source>Matlab File</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/MainWindow.cpp" line="175"/>
|
||||
<source>name: 5year 0412</source>
|
||||
<location filename="../ui/MainWindow.cpp" line="169"/>
|
||||
<source>bat File</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
|
@ -38,7 +38,6 @@ MainWindow::MainWindow(QWidget* parent)
|
||||
}
|
||||
|
||||
MainWindow::~MainWindow() {
|
||||
//OsgViewer::Get().Uninitialize();
|
||||
UninitUI();
|
||||
delete ui;
|
||||
}
|
||||
@ -167,13 +166,13 @@ void MainWindow::InitUI() {
|
||||
addParamDlg_->AttachDock(addParamSettingDock);
|
||||
m_mapDockWidget.insert("ParamSetting", addParamSettingDock);
|
||||
|
||||
DockWidget* matlabDock = new DockWidget(tr("Matlab File"), 0);
|
||||
matlabFileDlg_ = new CodeEdtUI;
|
||||
matlabFileDlg_->AttachDock(matlabDock);
|
||||
m_mapDockWidget.insert("Matlab", matlabDock);
|
||||
DockWidget* matlabDock = new DockWidget(tr("bat File"), 0);
|
||||
matlabFileDlg_ = new CodeEdtUI;
|
||||
matlabFileDlg_->AttachDock(matlabDock);
|
||||
m_mapDockWidget.insert("Matlab", matlabDock);
|
||||
|
||||
ui->discript->setText(tr("name: 5year 0412"));
|
||||
//ui->status->setText(tr("start: no start"));
|
||||
//ui->discript->setText(tr("name: 5year 0412"));
|
||||
//ui->status->setText(tr("start: no start"));
|
||||
|
||||
InitDockLayout();
|
||||
|
||||
@ -182,9 +181,9 @@ void MainWindow::InitUI() {
|
||||
/*OsgViewer::Get().Initialize();
|
||||
OsgViewer::Get().OnFrame();*/
|
||||
|
||||
#if 1
|
||||
// MatlabObject* mtlb = new MatlabObject;
|
||||
MatlabObject::GetInstance()->RunMatlabFile("");
|
||||
#if 0
|
||||
// MatlabObject* mtlb = new MatlabObject;
|
||||
MatlabObject::GetInstance()->RunMatlabFile("");
|
||||
#endif // 1
|
||||
}
|
||||
|
||||
@ -201,10 +200,12 @@ void MainWindow::InitDockLayout() {
|
||||
tabWidget_->removeTab(0);
|
||||
}
|
||||
|
||||
QVariantList listTab = pSettingUI->GetAreaLayout().toList();
|
||||
for (int i = 0; i < listTab.size(); i++) {
|
||||
QVariantMap mapTab = listTab[i].toMap();
|
||||
QString strTabName = mapTab.value("Name").toString();
|
||||
tabWidget_->tabBar()->setExpanding(true);
|
||||
|
||||
QVariantList listTab = pSettingUI->GetAreaLayout().toList();
|
||||
for (int i = 0; i < listTab.size(); i++) {
|
||||
QVariantMap mapTab = listTab[i].toMap();
|
||||
QString strTabName = mapTab.value("Name").toString();
|
||||
|
||||
QMainWindow* mainWindow_ = new QMainWindow;
|
||||
connect(mainWindow_, &QMainWindow::tabifiedDockWidgetActivated, this, &MainWindow::OnTabifiedDockWidgetActivated);
|
||||
@ -269,6 +270,7 @@ void MainWindow::InitDockLayout() {
|
||||
}
|
||||
}
|
||||
|
||||
tabWidget_->tabBar()->setMinimumWidth(500);
|
||||
/* AddDockArea("DockLeftArea");
|
||||
AddDockArea("DockTopArea");
|
||||
AddDockArea("DockRightArea");
|
||||
@ -351,20 +353,16 @@ void MainWindow::slotShowUISetting() {
|
||||
void MainWindow::slotResetWorkSpace()
|
||||
{
|
||||
QString wavePath = "", speedPath = "", rdPath = "";
|
||||
if (WorkSpaceManager::Get().GetCurrent())
|
||||
{
|
||||
if (!WorkSpaceManager::Get().GetCurrent()->GetWavePath().isEmpty())
|
||||
{
|
||||
if (WorkSpaceManager::Get().GetCurrent()) {
|
||||
if (!WorkSpaceManager::Get().GetCurrent()->GetWavePath().isEmpty()) {
|
||||
wavePath = RecourceHelper::Get().GetBasePath() + "/" + WorkSpaceManager::Get().GetCurrent()->GetWavePath();
|
||||
}
|
||||
|
||||
if (!WorkSpaceManager::Get().GetCurrent()->GetReportPath().isEmpty())
|
||||
{
|
||||
if (!WorkSpaceManager::Get().GetCurrent()->GetReportPath().isEmpty()) {
|
||||
speedPath = RecourceHelper::Get().GetBasePath() + "/" + WorkSpaceManager::Get().GetCurrent()->GetReportPath();
|
||||
}
|
||||
|
||||
if (!WorkSpaceManager::Get().GetCurrent()->GetRDPath().isEmpty())
|
||||
{
|
||||
if (!WorkSpaceManager::Get().GetCurrent()->GetRDPath().isEmpty()) {
|
||||
rdPath = RecourceHelper::Get().GetBasePath() + "/" + WorkSpaceManager::Get().GetCurrent()->GetRDPath();
|
||||
}
|
||||
}
|
||||
|
@ -143,6 +143,9 @@ void CameraControlManipulator::setByMatrix(const osg::Matrixd& matrix) {
|
||||
fixVerticalAxis(_center, _rotation, true);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -192,6 +195,9 @@ osg::Matrixd CameraControlManipulator::getMatrix() const {
|
||||
osg::Matrixd::translate(_center);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return matrix;
|
||||
@ -352,7 +358,7 @@ bool CameraControlManipulator::calcMovement() {
|
||||
// get delta time
|
||||
double eventTimeDelta = _ga_t0->getTime() - _ga_t1->getTime();
|
||||
if (eventTimeDelta < 0.) {
|
||||
OSG_WARN << "Manipulator warning: eventTimeDelta = " << eventTimeDelta;
|
||||
OSG_WARN << "Manipulator warning: eventTimeDelta = " << eventTimeDelta << std::endl;
|
||||
eventTimeDelta = 0.;
|
||||
}
|
||||
|
||||
|
@ -14,6 +14,7 @@
|
||||
#include "xml/tinyxml2.h"
|
||||
#include "common/SpdLogger.h"
|
||||
#include "entities/Entity.h"
|
||||
#include "utils/FileUtils.h"
|
||||
//#include "workspace/WorkSpaceItemGroup.h"
|
||||
//#include "workspace/WorkSpaceRiverGroup.h"
|
||||
//#include "workspace/WorkSpaceRiverNetGroup.h"
|
||||
@ -38,6 +39,76 @@ const QString WorkSpace::GetDir() const {
|
||||
return info.absolutePath();
|
||||
}
|
||||
|
||||
void WorkSpace::SetSimMatlab(const QString& path) {
|
||||
QFileInfo fileInfo(path);
|
||||
QString dirPath = QString("%1/%2").arg(GetDir(), fileInfo.fileName());
|
||||
bool sucess = FileUtils::CopyFileToPath(path, dirPath, true);
|
||||
LOG_INFO("copy simmatlab file {}: {} to {}",
|
||||
path.toLocal8Bit().data(),
|
||||
dirPath.toLocal8Bit().data(),
|
||||
sucess);
|
||||
simMatlabPath_ = fileInfo.fileName();
|
||||
}
|
||||
|
||||
const QString WorkSpace::GetSimMatlab() const {
|
||||
QString path = QString("%1/%2").arg(GetDir(), simMatlabPath_);
|
||||
return path;
|
||||
}
|
||||
|
||||
void WorkSpace::SetWavePath(const QString& path)
|
||||
{
|
||||
QFileInfo fileInfo(path);
|
||||
QString dirPath = QString("%1/%2").arg(GetDir(), fileInfo.fileName());
|
||||
bool sucess = FileUtils::CopyFileToPath(path, dirPath, true);
|
||||
LOG_INFO("copy Wave file {}: {} to {}",
|
||||
path.toLocal8Bit().data(),
|
||||
dirPath.toLocal8Bit().data(),
|
||||
sucess);
|
||||
waveFile_ = fileInfo.fileName();
|
||||
}
|
||||
|
||||
const QString WorkSpace::GetWavePath() const
|
||||
{
|
||||
QString path = QString("%1/%2").arg(GetDir(), waveFile_);
|
||||
return path;
|
||||
}
|
||||
|
||||
void WorkSpace::SetReportPath(const QString& path)
|
||||
{
|
||||
QFileInfo fileInfo(path);
|
||||
QString dirPath = QString("%1/%2").arg(GetDir(), fileInfo.fileName());
|
||||
bool sucess = FileUtils::CopyFileToPath(path, dirPath, true);
|
||||
LOG_INFO("copy Wave file {}: {} to {}",
|
||||
path.toLocal8Bit().data(),
|
||||
dirPath.toLocal8Bit().data(),
|
||||
sucess);
|
||||
reportFile_ = fileInfo.fileName();
|
||||
}
|
||||
|
||||
const QString WorkSpace::GetReportPath() const
|
||||
{
|
||||
QString path = QString("%1/%2").arg(GetDir(), reportFile_);
|
||||
return path;
|
||||
}
|
||||
|
||||
void WorkSpace::SetRDPath(const QString& path)
|
||||
{
|
||||
QFileInfo fileInfo(path);
|
||||
QString dirPath = QString("%1/%2").arg(GetDir(), fileInfo.fileName());
|
||||
bool sucess = FileUtils::CopyFileToPath(path, dirPath, true);
|
||||
LOG_INFO("copy RD file {}: {} to {}",
|
||||
path.toLocal8Bit().data(),
|
||||
dirPath.toLocal8Bit().data(),
|
||||
sucess);
|
||||
rdFile_ = fileInfo.fileName();
|
||||
}
|
||||
|
||||
const QString WorkSpace::GetRDPath() const
|
||||
{
|
||||
QString path = QString("%1/%2").arg(GetDir(), rdFile_);
|
||||
return path;
|
||||
}
|
||||
|
||||
void WorkSpace::AddEntity(Entity* entity) {
|
||||
if (nullptr == entity) {
|
||||
LOG_WARN("entity is nullptr");
|
||||
|
@ -46,12 +46,8 @@ public:
|
||||
inline const QString& GetDescribe() const {
|
||||
return describe_;
|
||||
}
|
||||
inline void SetSimMatlab(const QString& path) {
|
||||
simMatlabPath_ = path;
|
||||
}
|
||||
inline const QString GetSimMatlab() const {
|
||||
return simMatlabPath_;
|
||||
}
|
||||
void SetSimMatlab(const QString& path);
|
||||
const QString GetSimMatlab() const;
|
||||
|
||||
inline void SetMatlabParam(const QString& path) {
|
||||
matlabParamPath_ = path;
|
||||
@ -60,26 +56,14 @@ public:
|
||||
return matlabParamPath_;
|
||||
}
|
||||
|
||||
inline void SetWavePath(const QString& path) {
|
||||
waveFile_ = path;
|
||||
}
|
||||
inline const QString GetWavePath() const {
|
||||
return waveFile_;
|
||||
}
|
||||
void SetWavePath(const QString& path);
|
||||
const QString GetWavePath() const;
|
||||
|
||||
inline void SetReportPath(const QString& path) {
|
||||
reportFile_ = path;
|
||||
}
|
||||
inline const QString GetReportPath() const {
|
||||
return reportFile_;
|
||||
}
|
||||
void SetReportPath(const QString& path) ;
|
||||
const QString GetReportPath() const;
|
||||
|
||||
inline void SetRDPath(const QString& path) {
|
||||
rdFile_ = path;
|
||||
}
|
||||
inline const QString GetRDPath() const {
|
||||
return rdFile_;
|
||||
}
|
||||
void SetRDPath(const QString& path);
|
||||
const QString GetRDPath() const;
|
||||
|
||||
inline void SetHomeViewpoint(const osgEarth::Viewpoint& viewpoint) {
|
||||
homeViewpoint_ = viewpoint;
|
||||
@ -140,6 +124,11 @@ Q_SIGNALS:
|
||||
void TimestepChanged(class Timestep* timestep);
|
||||
void LampStatusChanged(class LampStatus* lampStatus);
|
||||
|
||||
protected:
|
||||
const QString& GetSimMatlabName() const {
|
||||
return simMatlabPath_;
|
||||
}
|
||||
|
||||
private:
|
||||
QString name_;
|
||||
QString uuid_;
|
||||
@ -160,5 +149,6 @@ private:
|
||||
class Timestep* timestep_{ nullptr };
|
||||
class LampStatus* lampStatus_{ nullptr };
|
||||
class Entity* trackedEntity_{ nullptr };
|
||||
friend class WorkSpaceXMLWrite;
|
||||
};
|
||||
|
||||
|
@ -155,6 +155,33 @@ bool WorkSpaceXMLParse::ParseChart(const tinyxml2::XMLElement* element)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool WorkSpaceXMLParse::ParseSimMatlab(const tinyxml2::XMLElement* element)
|
||||
{
|
||||
if (nullptr == element) {
|
||||
LOG_WARN("element is nullptr");
|
||||
return false;
|
||||
}
|
||||
|
||||
const tinyxml2::XMLElement* xmlElement = element->FirstChildElement();
|
||||
while (nullptr != xmlElement) {
|
||||
const char* name = xmlElement->Name();
|
||||
if (0 == strcmp(name, "SimMatlab"))
|
||||
{
|
||||
QVariantMap varChart;
|
||||
const tinyxml2::XMLAttribute* attribute = xmlElement->FirstAttribute();
|
||||
while (nullptr != attribute) {
|
||||
|
||||
WorkSpaceManager::Get().GetCurrent()->SetSimMatlab(QString::fromLocal8Bit(attribute->Value()));
|
||||
attribute = attribute->Next();
|
||||
}
|
||||
}
|
||||
|
||||
xmlElement = xmlElement->NextSiblingElement();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool WorkSpaceXMLParse::ParseReport(const tinyxml2::XMLElement* element)
|
||||
{
|
||||
QString strFile = "";
|
||||
@ -208,6 +235,9 @@ bool WorkSpaceXMLParse::Load(const QString& dyt) {
|
||||
else if (0 == strcmp(name, "ReportInfo")) {
|
||||
ParseReport(xmlElement);
|
||||
}
|
||||
else if (0 == strcmp(name, "SimMatlab")) {
|
||||
ParseSimMatlab(xmlElement);
|
||||
}
|
||||
xmlElement = xmlElement->NextSiblingElement();
|
||||
}
|
||||
|
||||
|
@ -34,6 +34,7 @@ private:
|
||||
bool ParseEntities(const tinyxml2::XMLElement* element);
|
||||
bool ParseChart(const tinyxml2::XMLElement* element);
|
||||
bool ParseReport(const tinyxml2::XMLElement* element);
|
||||
bool ParseSimMatlab(const tinyxml2::XMLElement* element);
|
||||
|
||||
private:
|
||||
QString name_;
|
||||
|
@ -114,7 +114,7 @@ bool WorkSpaceXMLWrite::SaveChart(tinyxml2::XMLElement* scene, tinyxml2::XMLDocu
|
||||
tinyxml2::XMLElement* chart = doc->NewElement("SimMatlab");
|
||||
charts->LinkEndChild(chart);
|
||||
|
||||
chart->SetAttribute("SimMatlab", workSpace_->GetSimMatlab().toLocal8Bit().constData());
|
||||
chart->SetAttribute("SimMatlab", workSpace_->GetSimMatlabName().toLocal8Bit().constData());
|
||||
}
|
||||
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user