modify workspace notify ui
This commit is contained in:
parent
df8871e09e
commit
302694578c
@ -422,12 +422,12 @@
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/chartPlot/FitCurveDialog.cpp" line="743"/>
|
||||
<location filename="../ui/chartPlot/FitCurveDialog.cpp" line="767"/>
|
||||
<source>2D Curve</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/chartPlot/FitCurveDialog.cpp" line="747"/>
|
||||
<location filename="../ui/chartPlot/FitCurveDialog.cpp" line="771"/>
|
||||
<source>2D(y(lg)) Curve</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
@ -516,146 +516,136 @@
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/MainWindow.cpp" line="113"/>
|
||||
<location filename="../ui/MainWindow.cpp" line="110"/>
|
||||
<source>Wave Curve</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/MainWindow.cpp" line="122"/>
|
||||
<location filename="../ui/MainWindow.cpp" line="118"/>
|
||||
<source>Speed Curve</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/MainWindow.cpp" line="132"/>
|
||||
<location filename="../ui/MainWindow.cpp" line="127"/>
|
||||
<source>3D Curve</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/MainWindow.cpp" line="145"/>
|
||||
<location filename="../ui/MainWindow.cpp" line="171"/>
|
||||
<location filename="../ui/MainWindow.cpp" line="139"/>
|
||||
<location filename="../ui/MainWindow.cpp" line="164"/>
|
||||
<source>Target number</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/MainWindow.cpp" line="145"/>
|
||||
<location filename="../ui/MainWindow.cpp" line="171"/>
|
||||
<location filename="../ui/MainWindow.cpp" line="139"/>
|
||||
<location filename="../ui/MainWindow.cpp" line="164"/>
|
||||
<source>Signal-to-noise ratio</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/MainWindow.cpp" line="146"/>
|
||||
<location filename="../ui/MainWindow.cpp" line="172"/>
|
||||
<location filename="../ui/MainWindow.cpp" line="140"/>
|
||||
<location filename="../ui/MainWindow.cpp" line="165"/>
|
||||
<source>Azimuth line of sight</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/MainWindow.cpp" line="146"/>
|
||||
<location filename="../ui/MainWindow.cpp" line="172"/>
|
||||
<location filename="../ui/MainWindow.cpp" line="140"/>
|
||||
<location filename="../ui/MainWindow.cpp" line="165"/>
|
||||
<source>Pitch gaze angle</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/MainWindow.cpp" line="147"/>
|
||||
<location filename="../ui/MainWindow.cpp" line="173"/>
|
||||
<location filename="../ui/MainWindow.cpp" line="141"/>
|
||||
<location filename="../ui/MainWindow.cpp" line="166"/>
|
||||
<source>azimuth</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/MainWindow.cpp" line="147"/>
|
||||
<location filename="../ui/MainWindow.cpp" line="173"/>
|
||||
<location filename="../ui/MainWindow.cpp" line="141"/>
|
||||
<location filename="../ui/MainWindow.cpp" line="166"/>
|
||||
<source>Pitch angle</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/MainWindow.cpp" line="148"/>
|
||||
<location filename="../ui/MainWindow.cpp" line="174"/>
|
||||
<location filename="../ui/MainWindow.cpp" line="142"/>
|
||||
<location filename="../ui/MainWindow.cpp" line="167"/>
|
||||
<source>attribute</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/MainWindow.cpp" line="148"/>
|
||||
<location filename="../ui/MainWindow.cpp" line="174"/>
|
||||
<location filename="../ui/MainWindow.cpp" line="142"/>
|
||||
<location filename="../ui/MainWindow.cpp" line="167"/>
|
||||
<source>Doppler</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/MainWindow.cpp" line="149"/>
|
||||
<location filename="../ui/MainWindow.cpp" line="175"/>
|
||||
<location filename="../ui/MainWindow.cpp" line="143"/>
|
||||
<location filename="../ui/MainWindow.cpp" line="168"/>
|
||||
<source>course</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/MainWindow.cpp" line="149"/>
|
||||
<location filename="../ui/MainWindow.cpp" line="175"/>
|
||||
<location filename="../ui/MainWindow.cpp" line="143"/>
|
||||
<location filename="../ui/MainWindow.cpp" line="168"/>
|
||||
<source>Speed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/MainWindow.cpp" line="150"/>
|
||||
<location filename="../ui/MainWindow.cpp" line="176"/>
|
||||
<location filename="../ui/MainWindow.cpp" line="144"/>
|
||||
<location filename="../ui/MainWindow.cpp" line="169"/>
|
||||
<source>longitude</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/MainWindow.cpp" line="150"/>
|
||||
<location filename="../ui/MainWindow.cpp" line="176"/>
|
||||
<location filename="../ui/MainWindow.cpp" line="144"/>
|
||||
<location filename="../ui/MainWindow.cpp" line="169"/>
|
||||
<source>latitude</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/MainWindow.cpp" line="151"/>
|
||||
<location filename="../ui/MainWindow.cpp" line="177"/>
|
||||
<location filename="../ui/MainWindow.cpp" line="145"/>
|
||||
<location filename="../ui/MainWindow.cpp" line="170"/>
|
||||
<source>distance</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/MainWindow.cpp" line="151"/>
|
||||
<location filename="../ui/MainWindow.cpp" line="177"/>
|
||||
<location filename="../ui/MainWindow.cpp" line="145"/>
|
||||
<location filename="../ui/MainWindow.cpp" line="170"/>
|
||||
<source>velocity</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/MainWindow.cpp" line="152"/>
|
||||
<location filename="../ui/MainWindow.cpp" line="178"/>
|
||||
<location filename="../ui/MainWindow.cpp" line="146"/>
|
||||
<location filename="../ui/MainWindow.cpp" line="171"/>
|
||||
<source>Radial dimensions</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/MainWindow.cpp" line="152"/>
|
||||
<location filename="../ui/MainWindow.cpp" line="178"/>
|
||||
<location filename="../ui/MainWindow.cpp" line="146"/>
|
||||
<location filename="../ui/MainWindow.cpp" line="171"/>
|
||||
<source>Target RCS</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/MainWindow.cpp" line="158"/>
|
||||
<location filename="../ui/MainWindow.cpp" line="152"/>
|
||||
<source>Report Table</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/MainWindow.cpp" line="184"/>
|
||||
<location filename="../ui/MainWindow.cpp" line="177"/>
|
||||
<source>Report</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/MainWindow.cpp" line="195"/>
|
||||
<location filename="../ui/MainWindow.cpp" line="186"/>
|
||||
<source>Signal Indicator Lamp</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/MainWindow.cpp" line="204"/>
|
||||
<location filename="../ui/MainWindow.cpp" line="194"/>
|
||||
<source>ParamSetting</source>
|
||||
<translation type="unfinished">参数设置</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/MainWindow.cpp" line="209"/>
|
||||
<source>name: 5year 0412</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/MainWindow.cpp" line="210"/>
|
||||
<source>start: no start</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>ModelBrowser</name>
|
||||
@ -759,6 +749,8 @@
|
||||
<message>
|
||||
<location filename="../ui/Menu/PlayManagerMenu.ui" line="20"/>
|
||||
<location filename="../ui/Menu/PlayManagerMenu.cpp" line="55"/>
|
||||
<location filename="../ui/Menu/PlayManagerMenu.cpp" line="150"/>
|
||||
<location filename="../ui/Menu/PlayManagerMenu.cpp" line="157"/>
|
||||
<source>play</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
@ -819,6 +811,7 @@
|
||||
<message>
|
||||
<location filename="../ui/Menu/PlayManagerMenu.cpp" line="48"/>
|
||||
<location filename="../ui/Menu/PlayManagerMenu.cpp" line="52"/>
|
||||
<location filename="../ui/Menu/PlayManagerMenu.cpp" line="147"/>
|
||||
<source>pause</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
@ -1278,12 +1271,12 @@
|
||||
<context>
|
||||
<name>QtOsgViewWidget</name>
|
||||
<message>
|
||||
<location filename="../viewer/QtOsgViewWidget.cpp" line="140"/>
|
||||
<location filename="../viewer/QtOsgViewWidget.cpp" line="105"/>
|
||||
<source>notify</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../viewer/QtOsgViewWidget.cpp" line="140"/>
|
||||
<location filename="../viewer/QtOsgViewWidget.cpp" line="105"/>
|
||||
<source>open dyt file failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
@ -1570,12 +1563,12 @@
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/Layout/SignalIndicatorLampUI.cpp" line="38"/>
|
||||
<location filename="../ui/Layout/SignalIndicatorLampUI.cpp" line="43"/>
|
||||
<source>Signal Indicator Lamp</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/Layout/SignalIndicatorLampUI.cpp" line="186"/>
|
||||
<location filename="../ui/Layout/SignalIndicatorLampUI.cpp" line="191"/>
|
||||
<source>light</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
@ -1588,7 +1581,7 @@
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/chartPlot/SurfaceDialog.cpp" line="38"/>
|
||||
<location filename="../ui/chartPlot/SurfaceDialog.cpp" line="44"/>
|
||||
<source>3D Curve</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
@ -1659,7 +1652,7 @@
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/Table/targetlistwgt.cpp" line="59"/>
|
||||
<location filename="../ui/Table/targetlistwgt.cpp" line="65"/>
|
||||
<source>Data Table</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
|
@ -11,11 +11,16 @@
|
||||
#include <QMessageBox>
|
||||
|
||||
#include <qdebug.h>
|
||||
#include "common/SpdLogger.h"
|
||||
#include "workspace/WorkSpace.h"
|
||||
#include "workspace/Timestep.h"
|
||||
#include "workspace/WorkSpaceManager.h"
|
||||
|
||||
SignalIndicatorLampUI::SignalIndicatorLampUI(QWidget* parent)
|
||||
: QWidget(parent)
|
||||
{
|
||||
ui.setupUi(this);
|
||||
connect(&WorkSpaceManager::Get(), &WorkSpaceManager::WorkSpaceChanged, this, &SignalIndicatorLampUI::OnWorkSpaceChanged);
|
||||
}
|
||||
|
||||
SignalIndicatorLampUI::~SignalIndicatorLampUI()
|
||||
@ -228,6 +233,23 @@ void SignalIndicatorLampUI::onStatusChanged(int status) {
|
||||
SetLampState(vecStatus);
|
||||
}
|
||||
|
||||
void SignalIndicatorLampUI::OnWorkSpaceChanged(WorkSpace* worksapce) {
|
||||
if (worksapce == nullptr) {
|
||||
LOG_ERROR("worksapce is nullptr");
|
||||
return;
|
||||
}
|
||||
|
||||
connect(worksapce, &WorkSpace::TimestepChanged, this, &SignalIndicatorLampUI::OnTimestepChanged);
|
||||
}
|
||||
|
||||
void SignalIndicatorLampUI::OnTimestepChanged(Timestep* timestep) {
|
||||
if (timestep == nullptr) {
|
||||
LOG_ERROR("timestep is nullptr");
|
||||
return;
|
||||
}
|
||||
connect(timestep, SIGNAL(TimeChanged(double)), this, SLOT(slotUpdateTime(double)));
|
||||
}
|
||||
|
||||
void SignalIndicatorLampUI::paintEvent(QPaintEvent* event)
|
||||
{
|
||||
QPainter painter(this);
|
||||
|
@ -36,6 +36,8 @@ public:
|
||||
protected slots:
|
||||
void slotUpdateTime(double dTime);
|
||||
void onStatusChanged(int status);
|
||||
void OnWorkSpaceChanged(class WorkSpace*);
|
||||
void OnTimestepChanged(class Timestep*);
|
||||
|
||||
protected:
|
||||
void paintEvent(QPaintEvent* event);
|
||||
|
@ -84,10 +84,7 @@ void MainWindow::InitUI() {
|
||||
connect(modelBrowser_, &ModelBrowser::EntityChange, propertyBrowser_, &PropertyBrowser::OnEntityChange);
|
||||
|
||||
qtOsgViewWidget_ = new QtOsgViewWidget;
|
||||
//ui->viewWidget->layout()->addWidget(qtOsgViewWidget_);
|
||||
OsgViewer::Get().Initialize();
|
||||
OsgViewer::Get().OnFrame();
|
||||
|
||||
qtOsgViewWidget_->Initialize();
|
||||
m_mapDockWidget.insert("PropertyBrowser", attribte);
|
||||
|
||||
QString wavePath = WorkSpaceManager::Get().GetDYTWaveFile();
|
||||
@ -117,7 +114,6 @@ void MainWindow::InitUI() {
|
||||
m_mapDockWidget.insert("WaveCurveDialog", fitCurveDock);
|
||||
|
||||
fitCurveDlg_->InitWaveFile(wavePath);
|
||||
connect(WorkSpaceManager::Get().GetCurrent()->GetTimestep(), SIGNAL(TimeChanged(double)), fitCurveDlg_, SLOT(slotUpdateTime(double)));
|
||||
|
||||
DockWidget* fitLgCurveDock = new DockWidget(tr("Speed Curve"), 0);
|
||||
//addDockWidget(pSettingUI->GetArea("2D(lg)CurveDialog"), fitLgCurveDock);
|
||||
@ -127,7 +123,6 @@ void MainWindow::InitUI() {
|
||||
|
||||
|
||||
fitYLgCurveDlg_->InitReportFile(speedPath);
|
||||
connect(WorkSpaceManager::Get().GetCurrent()->GetTimestep(), SIGNAL(TimeChanged(double)), fitYLgCurveDlg_, SLOT(slotUpdateTime(double)));
|
||||
|
||||
DockWidget* surfaceCurveDock = new DockWidget(tr("3D Curve"), 0);
|
||||
// addDockWidget(pSettingUI->GetArea("3DCurveDialog"), surfaceCurveDock);
|
||||
@ -136,7 +131,6 @@ void MainWindow::InitUI() {
|
||||
m_mapDockWidget.insert("3DCurveDialog", surfaceCurveDock);
|
||||
|
||||
surfaceDlg_->InitRD(rdPath);
|
||||
connect(WorkSpaceManager::Get().GetCurrent()->GetTimestep(), SIGNAL(TimeChanged(double)), surfaceDlg_, SLOT(slotUpdateTime(double)));
|
||||
|
||||
{
|
||||
targetUITable_ = new TargetListWgt;
|
||||
@ -160,7 +154,6 @@ void MainWindow::InitUI() {
|
||||
targetUITable_->AttachDock(dataTableDock);
|
||||
m_mapDockWidget.insert("TargetListWgt_Table", dataTableDock);
|
||||
|
||||
connect(WorkSpaceManager::Get().GetCurrent()->GetTimestep(), SIGNAL(TimeChanged(double)), targetUITable_, SLOT(slotTimeChanged(double)));
|
||||
}
|
||||
|
||||
{
|
||||
@ -185,8 +178,6 @@ void MainWindow::InitUI() {
|
||||
// addDockWidget(pSettingUI->GetArea("TargetListWgt"), dataTableDock);
|
||||
targetUI_->AttachDock(dataTableDock);
|
||||
m_mapDockWidget.insert("TargetListWgt", dataTableDock);
|
||||
|
||||
connect(WorkSpaceManager::Get().GetCurrent()->GetTimestep(), SIGNAL(TimeChanged(double)), targetUI_, SLOT(slotTimeChanged(double)));
|
||||
}
|
||||
|
||||
|
||||
@ -196,7 +187,6 @@ void MainWindow::InitUI() {
|
||||
signalIndicatorLampUI_ = new SignalIndicatorLampUI;
|
||||
signalIndicatorLampUI_->AttachDock(signalIndicatorLampDock);
|
||||
signalIndicatorLampUI_->InitLamp(lampPath);
|
||||
connect(WorkSpaceManager::Get().GetCurrent()->GetLampStatus(), SIGNAL(StatusChanged(int)), signalIndicatorLampUI_, SLOT(onStatusChanged(int)));
|
||||
|
||||
m_mapDockWidget.insert("SignalIndicatorLampUI", signalIndicatorLampDock);
|
||||
|
||||
@ -206,11 +196,16 @@ void MainWindow::InitUI() {
|
||||
addParamDlg_->AttachDock(addParamSettingDock);
|
||||
m_mapDockWidget.insert("ParamSetting", addParamSettingDock);
|
||||
|
||||
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();
|
||||
|
||||
//ui->viewWidget->layout()->addWidget(qtOsgViewWidget_);
|
||||
qtOsgViewWidget_->LoadDefaultScene();
|
||||
OsgViewer::Get().Initialize();
|
||||
OsgViewer::Get().OnFrame();
|
||||
|
||||
#if 0
|
||||
MatlabObject* mtlb = new MatlabObject;
|
||||
mtlb->RunMatlabFile("D:\\DYT\\TestGUI\\TestGUI\\LDPlatformTest.m");
|
||||
|
@ -113,16 +113,14 @@ void PlayManagerMenu::OnDown() {
|
||||
|
||||
void PlayManagerMenu::OnWorkspaceChange(WorkSpace* workSpace) {
|
||||
if (nullptr == workSpace) {
|
||||
LOG_WARN("current is nullptr");
|
||||
return;
|
||||
}
|
||||
workSpace_ = workSpace;
|
||||
connect(workSpace, &WorkSpace::TimestepChanged, this, &PlayManagerMenu::OnTimestepChanged);
|
||||
}
|
||||
|
||||
Timestep* timestep = workSpace_->GetTimestep();
|
||||
if (nullptr == timestep) {
|
||||
LOG_INFO("current is nullptr");
|
||||
return;
|
||||
}
|
||||
|
||||
void PlayManagerMenu::OnTimestepChanged(Timestep* timestep) {
|
||||
double step = 0.0;
|
||||
timestep->GetRange(minTime_, maxTime_, step);
|
||||
ui->lbtime->setText(QString::number(minTime_, 'f', 3));
|
||||
@ -141,4 +139,26 @@ void PlayManagerMenu::OnWorkspaceChange(WorkSpace* workSpace) {
|
||||
ui->lbUp->setText(QString("x%1").arg(step));
|
||||
}
|
||||
);
|
||||
|
||||
connect(timestep, &Timestep::StatusChanged, [this](int statue) {
|
||||
Timestep::PlayStatus state = static_cast<Timestep::PlayStatus>(statue);
|
||||
switch (state) {
|
||||
case Timestep::PlayStatus::PS_Started:
|
||||
ui->psbPlay->setText(tr("pause"));
|
||||
break;
|
||||
case Timestep::PlayStatus::PS_Stoped: {
|
||||
ui->psbPlay->setText(tr("play"));
|
||||
ui->lbtime->setText(QString::number(minTime_, 'f', 3));
|
||||
ui->lbtimeTotal->setText(QString("/%1(s)").arg(maxTime_));
|
||||
ui->horizontalSlider->setValue(0);
|
||||
}
|
||||
break;
|
||||
case Timestep::PlayStatus::PS_Suspended:
|
||||
ui->psbPlay->setText(tr("play"));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
@ -22,6 +22,7 @@ protected:
|
||||
void OnDown();
|
||||
|
||||
void OnWorkspaceChange(class WorkSpace* workSpace);
|
||||
void OnTimestepChanged(class Timestep* timestep);
|
||||
|
||||
|
||||
private:
|
||||
|
@ -15,6 +15,10 @@
|
||||
#include "../DockWidget.h"
|
||||
|
||||
#include <QMessageBox>
|
||||
#include "common/SpdLogger.h"
|
||||
#include "workspace/WorkSpace.h"
|
||||
#include "workspace/Timestep.h"
|
||||
#include "workspace/WorkSpaceManager.h"
|
||||
|
||||
TargetListWgt::TargetListWgt(QWidget * parent) : QWidget(parent) {
|
||||
ui.setupUi(this);
|
||||
@ -38,6 +42,8 @@ TargetListWgt::TargetListWgt(QWidget * parent) : QWidget(parent) {
|
||||
ui.lineEdit->setText("1");
|
||||
ui.lineEdit_2->setText("1");
|
||||
ui.spinBox_2->setValue(1);
|
||||
|
||||
connect(&WorkSpaceManager::Get(), &WorkSpaceManager::WorkSpaceChanged, this, &TargetListWgt::OnWorkSpaceChanged);
|
||||
}
|
||||
|
||||
TargetListWgt::~TargetListWgt() {
|
||||
@ -223,6 +229,23 @@ void TargetListWgt::slotNextPage()
|
||||
UpdatePageData(nCurPage);
|
||||
}
|
||||
|
||||
void TargetListWgt::OnWorkSpaceChanged(WorkSpace* worksapce) {
|
||||
if (worksapce == nullptr) {
|
||||
LOG_ERROR("worksapce is nullptr");
|
||||
return;
|
||||
}
|
||||
|
||||
connect(worksapce, &WorkSpace::TimestepChanged, this, &TargetListWgt::OnTimestepChanged);
|
||||
}
|
||||
|
||||
void TargetListWgt::OnTimestepChanged(Timestep* timestep) {
|
||||
if (timestep == nullptr) {
|
||||
LOG_ERROR("timestep is nullptr");
|
||||
return;
|
||||
}
|
||||
connect(timestep, SIGNAL(TimeChanged(double)), this, SLOT(slotUpdateTime(double)));
|
||||
}
|
||||
|
||||
void TargetListWgt::slotTimeChanged(double dTime)
|
||||
{
|
||||
UpdateTable(dTime);
|
||||
|
@ -64,6 +64,9 @@ protected slots:
|
||||
void slotForwardPage(); // 前一页
|
||||
void slotNextPage(); // 下一页
|
||||
|
||||
void OnWorkSpaceChanged(class WorkSpace*);
|
||||
void OnTimestepChanged(class Timestep*);
|
||||
|
||||
signals:
|
||||
|
||||
|
||||
|
@ -99,7 +99,7 @@ void WorkSpaceDlg::OnSure() {
|
||||
}
|
||||
|
||||
emit WorkSpaceManager::Get().WorkSpaceChanged(workSpace);
|
||||
|
||||
WorkSpaceManager::Get().SetCurrent(workSpace);
|
||||
accept();
|
||||
}
|
||||
|
||||
|
@ -5,6 +5,11 @@
|
||||
#include "../DockTitleBar.h"
|
||||
#include "../DockWidget.h"
|
||||
|
||||
#include "common/SpdLogger.h"
|
||||
#include "workspace/WorkSpace.h"
|
||||
#include "workspace/Timestep.h"
|
||||
#include "workspace/WorkSpaceManager.h"
|
||||
|
||||
FitCurveDialog::FitCurveDialog(int iType, QWidget* parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::FitCurveDialog)
|
||||
@ -22,6 +27,8 @@ FitCurveDialog::FitCurveDialog(int iType, QWidget* parent) :
|
||||
|
||||
qApp->setOverrideCursor(Qt::ArrowCursor); //允许系统弹窗、提示
|
||||
initQChartView();
|
||||
|
||||
connect(&WorkSpaceManager::Get(), &WorkSpaceManager::WorkSpaceChanged, this, &FitCurveDialog::OnWorkSpaceChanged);
|
||||
}
|
||||
|
||||
void FitCurveDialog::initQChartView() {
|
||||
@ -721,6 +728,23 @@ void FitCurveDialog::ParseReport(const QString& strFile, std::vector<std::vector
|
||||
slotUpdateTime(1);
|
||||
}
|
||||
|
||||
void FitCurveDialog::OnWorkSpaceChanged(WorkSpace* worksapce) {
|
||||
if (worksapce == nullptr) {
|
||||
LOG_ERROR("worksapce is nullptr");
|
||||
return;
|
||||
}
|
||||
|
||||
connect(worksapce, &WorkSpace::TimestepChanged, this, &FitCurveDialog::OnTimestepChanged);
|
||||
}
|
||||
|
||||
void FitCurveDialog::OnTimestepChanged(Timestep* timestep) {
|
||||
if (timestep == nullptr) {
|
||||
LOG_ERROR("timestep is nullptr");
|
||||
return;
|
||||
}
|
||||
connect(timestep, SIGNAL(TimeChanged(double)), this, SLOT(slotUpdateTime(double)));
|
||||
}
|
||||
|
||||
FitCurveDialog::~FitCurveDialog()
|
||||
{
|
||||
delete ui;
|
||||
|
@ -31,6 +31,8 @@ public:
|
||||
protected:
|
||||
void ParseWave(const QString& strFile, std::vector < std::vector<std::vector<float>>>& vecWavePoint, int iRowCount = 50);
|
||||
void ParseReport(const QString& strFile, std::vector<std::vector<std::vector<float>>>& vecReportPoint, int iRowCount = 50);
|
||||
void OnWorkSpaceChanged(class WorkSpace*);
|
||||
void OnTimestepChanged(class Timestep*);
|
||||
|
||||
public slots:
|
||||
void theSlotMouseEvent(int eventId, QMouseEvent* event);
|
||||
|
@ -8,6 +8,11 @@
|
||||
#include <QMessageBox>
|
||||
#include <Q3DCamera>
|
||||
|
||||
#include "common/SpdLogger.h"
|
||||
#include "workspace/WorkSpace.h"
|
||||
#include "workspace/Timestep.h"
|
||||
#include "workspace/WorkSpaceManager.h"
|
||||
|
||||
SurfaceDialog::SurfaceDialog(QWidget *parent)
|
||||
: QWidget(parent)
|
||||
{
|
||||
@ -16,6 +21,7 @@ SurfaceDialog::SurfaceDialog(QWidget *parent)
|
||||
setWindowTitle("3D Curve");
|
||||
|
||||
InitSurface();
|
||||
connect(&WorkSpaceManager::Get(), &WorkSpaceManager::WorkSpaceChanged, this, &SurfaceDialog::OnWorkSpaceChanged);
|
||||
}
|
||||
|
||||
SurfaceDialog::~SurfaceDialog()
|
||||
@ -271,6 +277,24 @@ void SurfaceDialog::slotUpdateTime(double dTime)
|
||||
m_Surface.setShadowQuality(QAbstract3DGraph::ShadowQuality::ShadowQualityNone);
|
||||
}
|
||||
|
||||
void SurfaceDialog::OnWorkSpaceChanged(WorkSpace* worksapce) {
|
||||
if (worksapce == nullptr) {
|
||||
LOG_ERROR("worksapce is nullptr");
|
||||
return;
|
||||
}
|
||||
|
||||
connect(worksapce, &WorkSpace::TimestepChanged, this, &SurfaceDialog::OnTimestepChanged);
|
||||
}
|
||||
|
||||
void SurfaceDialog::OnTimestepChanged(Timestep* timestep) {
|
||||
if (timestep == nullptr) {
|
||||
LOG_ERROR("timestep is nullptr");
|
||||
return;
|
||||
}
|
||||
connect(timestep, SIGNAL(TimeChanged(double)), this, SLOT(slotUpdateTime(double)));
|
||||
}
|
||||
|
||||
|
||||
void SurfaceDialog::InitSurface()
|
||||
{
|
||||
m_Surface.setFlags(m_Surface.flags());
|
||||
|
@ -25,6 +25,8 @@ public slots:
|
||||
void slotAddSeries(QVariant varSeriesData);
|
||||
void slotInserKeyPoint(float xValue, float yValue, float zValue);
|
||||
void slotUpdateTime(double dTime);
|
||||
void OnWorkSpaceChanged(class WorkSpace*);
|
||||
void OnTimestepChanged(class Timestep*);
|
||||
|
||||
protected:
|
||||
void InitSurface();
|
||||
|
@ -38,7 +38,7 @@ QtOsgViewWidget::QtOsgViewWidget(QWidget* parent)
|
||||
setAttribute(Qt::WA_OpaquePaintEvent, false);
|
||||
setAttribute(Qt::WA_DontCreateNativeAncestors, false);
|
||||
setFocusPolicy(Qt::StrongFocus);
|
||||
Initialize();
|
||||
//Initialize();
|
||||
}
|
||||
|
||||
QtOsgViewWidget::~QtOsgViewWidget() {
|
||||
@ -71,20 +71,6 @@ void QtOsgViewWidget::Initialize(void) {
|
||||
|
||||
setMouseTracking(true);
|
||||
|
||||
////OsgSceneManipulator* manipulator = new OsgSceneManipulator;
|
||||
//CameraControlManipulator* manipulator = new CameraControlManipulator;
|
||||
////osg::Vec3f eye(-256.63, 48.57, 82.19);
|
||||
////osg::Vec3f center(-164.45, 30.05, 48.14);
|
||||
////osg::Vec3f up(0.33, -0.07, 0.94);
|
||||
|
||||
//osg::Vec3 eye(0.0f, 300.f, 60.0f);
|
||||
//osg::Vec3 center(0.0f, 60.0f, 0.0f);
|
||||
//osg::Vec3 up(0.0f, 0.0f, 1.0f);
|
||||
//manipulator->setHomePosition(eye, center, up);
|
||||
//manipulator->setManipulatorMode(CameraControlManipulator::Roam_ManipulatorMode);
|
||||
//manipulator->setVerticalAxisFixed(true);
|
||||
//manipulator->setRoamCamera(eye, center, up);
|
||||
//manipulator->setDistance(650.0);
|
||||
|
||||
osgEarth::Util::EarthManipulator* manipulator = new osgEarth::Util::EarthManipulator;
|
||||
osgEarth::Viewpoint vp("home", 107.85, 32.35, 100.0, -2.50, -90.0, 1.5e7);
|
||||
@ -93,32 +79,6 @@ void QtOsgViewWidget::Initialize(void) {
|
||||
|
||||
OsgCameraManipulator* cameraManipulator = new OsgCameraManipulator(manipulator, this);
|
||||
view_->Initialize(cameraManipulator);
|
||||
|
||||
//auto pScene = Scenes::SceneManager::GetSingleton().GetCurrentScene();
|
||||
//if (nullptr == pScene) {
|
||||
// pScene = Core::Application::GetSingleton().GetEngine()->CreateScene("Untitled");
|
||||
// Scenes::SceneManager::GetSingleton().SetCurrentScene(pScene);
|
||||
//}
|
||||
//view_->SetScense(pScene);
|
||||
|
||||
/* scene_ = new OsgScene;
|
||||
scene_->UseShadows(false);
|
||||
|
||||
scene_->ChangeScene(OsgScene::CLOUDY);
|
||||
|
||||
scene_->AttachView(view_);
|
||||
scene_->InitEventHandle(view_);*/
|
||||
|
||||
//scene_->TestBuildModel();
|
||||
|
||||
const QString path = QString("%1/default2.dyt").arg(Application::GetWorkSpacePath());
|
||||
OnLoadDyt(path);
|
||||
|
||||
/*WorkSpace* workspace = WorkSpaceManager::Get().GetOrCreate("defaultDyt");
|
||||
workspace->AddScene("default", scene_, true);
|
||||
workspace_ = workspace;*/
|
||||
//WorkSpaceManager::Get().
|
||||
|
||||
}
|
||||
|
||||
void QtOsgViewWidget::Uninitialize(void) {
|
||||
@ -133,6 +93,11 @@ void QtOsgViewWidget::Uninitialize(void) {
|
||||
}
|
||||
}
|
||||
|
||||
void QtOsgViewWidget::LoadDefaultScene(void) {
|
||||
dyt_check(nullptr != view_, "view is nullptr");
|
||||
WorkSpaceManager::Get().LoadDefaultWorkspace(view_);
|
||||
}
|
||||
|
||||
void QtOsgViewWidget::OnLoadDyt(const QString& path) {
|
||||
LOG_INFO("load dyt path:{}", path.toStdString());
|
||||
WorkSpace* workSpace = WorkSpaceManager::Get().LoadDyt(path, view_);
|
||||
|
@ -24,6 +24,8 @@ public:
|
||||
void Initialize(void);
|
||||
void Uninitialize(void);
|
||||
|
||||
void LoadDefaultScene(void);
|
||||
|
||||
void OnLoadDyt(const QString& path);
|
||||
//void setKeyboardModifiers(QInputEvent* event);
|
||||
|
||||
|
@ -119,6 +119,7 @@ bool WorkSpace::SetTimestep(Timestep* timestep) {
|
||||
}
|
||||
|
||||
timestep_ = timestep;
|
||||
emit TimestepChanged(timestep_);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -138,6 +139,7 @@ bool WorkSpace::SetLampStatus(class LampStatus* lampStatus) {
|
||||
}
|
||||
|
||||
lampStatus_ = lampStatus;
|
||||
emit LampStatusChanged(lampStatus_);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -205,3 +207,12 @@ void WorkSpace::End() {
|
||||
item->End();
|
||||
}
|
||||
}
|
||||
|
||||
void WorkSpace::OnLoaded() {
|
||||
if (nullptr != lampStatus_) {
|
||||
emit LampStatusChanged(lampStatus_);
|
||||
}
|
||||
if (nullptr != timestep_) {
|
||||
emit TimestepChanged(timestep_);
|
||||
}
|
||||
}
|
||||
|
@ -24,6 +24,9 @@ public:
|
||||
inline const QString& GetName() const {
|
||||
return name_;
|
||||
}
|
||||
inline const QString& GetPath() const {
|
||||
return path_;
|
||||
}
|
||||
inline void SetUUid(const QString& uuid) {
|
||||
uuid_ = uuid;
|
||||
}
|
||||
@ -77,9 +80,13 @@ public:
|
||||
void OnFrame(double dt);
|
||||
void End();
|
||||
|
||||
void OnLoaded();
|
||||
|
||||
Q_SIGNALS:
|
||||
void EntityAdded(class Entity* entity);
|
||||
void EntityRemoved(class Entity* entity);
|
||||
void TimestepChanged(class Timestep* timestep);
|
||||
void LampStatusChanged(class LampStatus* lampStatus);
|
||||
|
||||
private:
|
||||
QString name_;
|
||||
|
@ -1,11 +1,12 @@
|
||||
#include "workspace/WorkSpaceManager.h"
|
||||
|
||||
#include<time.h>
|
||||
#include <QSettings>
|
||||
|
||||
#include "workspace/WorkSpace.h"
|
||||
#include "workspace/Timestep.h"
|
||||
#include "common/SpdLogger.h"
|
||||
|
||||
#include<time.h>
|
||||
|
||||
template<> WorkSpaceManager* Singleton<WorkSpaceManager>::instance_ = nullptr;
|
||||
|
||||
WorkSpaceManager::WorkSpaceManager(QObject* parent)
|
||||
@ -17,7 +18,48 @@ WorkSpaceManager::~WorkSpaceManager() {
|
||||
}
|
||||
|
||||
void WorkSpaceManager::OnDestory() {
|
||||
SaveDefaultWorkspace();
|
||||
}
|
||||
|
||||
WorkSpace* WorkSpaceManager::LoadDefaultWorkspace(class OsgView* view) {
|
||||
const QString iniFile = GetDefaultWorkSpaceName();
|
||||
if (!QFile::exists(iniFile)) {
|
||||
LOG_ERROR("default workspace file not exist:{}", iniFile.toStdString());
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
QSettings settings(iniFile, QSettings::IniFormat);
|
||||
const QString path = settings.value("workspace/path", "").toString();
|
||||
if (path.isEmpty()) {
|
||||
LOG_ERROR("default workspace path is empty");
|
||||
return nullptr;
|
||||
}
|
||||
WorkSpace* workspace = LoadDyt(path, view);
|
||||
if (nullptr == workspace) {
|
||||
LOG_ERROR("load default workspace failed");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
SetCurrent(workspace);
|
||||
return workspace;
|
||||
}
|
||||
|
||||
void WorkSpaceManager::SaveDefaultWorkspace() {
|
||||
const QString iniFile = GetDefaultWorkSpaceName();
|
||||
if (!QFile::exists(iniFile)) {
|
||||
LOG_ERROR("default workspace file not exist:{}", iniFile.toStdString());
|
||||
return;
|
||||
}
|
||||
|
||||
WorkSpace* current = GetCurrent();
|
||||
if (nullptr == current) {
|
||||
LOG_ERROR("current workspace is nullptr");
|
||||
return;
|
||||
}
|
||||
|
||||
const QString path = current->GetPath();
|
||||
QSettings settings(iniFile, QSettings::IniFormat);
|
||||
settings.setValue("workspace/path", path);
|
||||
}
|
||||
|
||||
bool WorkSpaceManager::Contains(const QString& name) const {
|
||||
@ -76,6 +118,8 @@ void WorkSpaceManager::SetCurrent(WorkSpace* workspace) {
|
||||
lastTime_ = clock();
|
||||
|
||||
emit WorkSpaceChanged(current_);
|
||||
|
||||
current_->OnLoaded();
|
||||
}
|
||||
|
||||
void WorkSpaceManager::OnFrame() {
|
||||
@ -94,3 +138,13 @@ void WorkSpaceManager::OnFrame() {
|
||||
|
||||
lastTime_ = t;
|
||||
}
|
||||
|
||||
QString WorkSpaceManager::GetDefaultWorkSpaceName() {
|
||||
#if _DEBUG
|
||||
const QString iniFile = QString("%1workspace/config.ini").arg(QString(CONFIG_PATH)).arg(skin);
|
||||
#else
|
||||
const QString appDirPath = QApplication::applicationDirPath();
|
||||
const QString iniFile = QString("%1/config/workspace/config.ini").arg(appDirPath);
|
||||
#endif
|
||||
return iniFile;
|
||||
}
|
||||
|
@ -19,6 +19,9 @@ public:
|
||||
~WorkSpaceManager();
|
||||
void OnDestory();
|
||||
|
||||
WorkSpace* LoadDefaultWorkspace(class OsgView* view);
|
||||
void SaveDefaultWorkspace();
|
||||
|
||||
bool Contains(const QString& name) const;
|
||||
bool Remove(const QString& name);
|
||||
WorkSpace* LoadDyt(const QString& dyt, class OsgView* view);
|
||||
@ -64,6 +67,9 @@ public:
|
||||
signals:
|
||||
void WorkSpaceChanged(WorkSpace*);
|
||||
|
||||
private:
|
||||
QString GetDefaultWorkSpaceName();
|
||||
|
||||
private:
|
||||
std::unordered_map<QString, WorkSpace*> workSpaces_;
|
||||
WorkSpace* current_{ nullptr };
|
||||
|
Loading…
Reference in New Issue
Block a user