modified style
This commit is contained in:
parent
7d336212ea
commit
96e1eb328f
@ -2763,32 +2763,25 @@
|
|||||||
<context>
|
<context>
|
||||||
<name>SimuRunMenu</name>
|
<name>SimuRunMenu</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../ui/Menu/SimuRunMenu.cpp" line="50"/>
|
<location filename="../ui/Menu/SimuRunMenu.cpp" line="52"/>
|
||||||
<source>no workspace</source>
|
<source>no workspace</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../ui/Menu/SimuRunMenu.cpp" line="64"/>
|
<location filename="../ui/Menu/SimuRunMenu.cpp" line="66"/>
|
||||||
<source>no commands</source>
|
<source>no commands</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../ui/Menu/SimuRunMenu.cpp" line="74"/>
|
<location filename="../ui/Menu/SimuRunMenu.cpp" line="76"/>
|
||||||
<source>Commands</source>
|
<source>Commands</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../ui/Menu/SimuRunMenu.cpp" line="93"/>
|
<location filename="../ui/Menu/SimuRunMenu.cpp" line="95"/>
|
||||||
<source>unnamed</source>
|
<source>unnamed</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
|
||||||
<location filename="../ui/Menu/SimuRunMenu.cpp" line="125"/>
|
|
||||||
<location filename="../ui/Menu/SimuRunMenu.cpp" line="127"/>
|
|
||||||
<location filename="../ui/Menu/SimuRunMenu.cpp" line="187"/>
|
|
||||||
<source>MatlabParam</source>
|
|
||||||
<translation type="unfinished"></translation>
|
|
||||||
</message>
|
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>SimuRunMenuClass</name>
|
<name>SimuRunMenuClass</name>
|
||||||
|
|||||||
@ -15,17 +15,13 @@ DockTitleBar::DockTitleBar(QWidget* parent)
|
|||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
connect(ui->sys_close, &QPushButton::clicked, this, &DockTitleBar::signalClose);
|
connect(ui->sys_close, &QPushButton::clicked, this, &DockTitleBar::signalClose);
|
||||||
connect(ui->sys_float, &QPushButton::clicked, this, &DockTitleBar::signalToggleFloating);
|
connect(ui->sys_float, &QPushButton::clicked, this, &DockTitleBar::signalToggleFloating);
|
||||||
|
connect(ui->sys_max, &QPushButton::clicked, this, &DockTitleBar::signalMax);
|
||||||
}
|
}
|
||||||
|
|
||||||
DockTitleBar::~DockTitleBar() {
|
DockTitleBar::~DockTitleBar() {
|
||||||
delete ui;
|
delete ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
//QSize DockTitleBar::minimumSizeHint() const {
|
|
||||||
// QSize s = size();
|
|
||||||
// return s;
|
|
||||||
//}
|
|
||||||
|
|
||||||
void DockTitleBar::SetTitle(const QString& title) {
|
void DockTitleBar::SetTitle(const QString& title) {
|
||||||
ui->sys_title->setText(title);
|
ui->sys_title->setText(title);
|
||||||
}
|
}
|
||||||
@ -38,3 +34,17 @@ void DockTitleBar::paintEvent(QPaintEvent* event) {
|
|||||||
style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
|
style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DockTitleBar::SetFloatVisible(bool bVisible)
|
||||||
|
{
|
||||||
|
ui->sys_float->setVisible(bVisible);
|
||||||
|
}
|
||||||
|
|
||||||
|
void DockTitleBar::SetMaxVisible(bool bVisible)
|
||||||
|
{
|
||||||
|
ui->sys_max->setVisible(bVisible);
|
||||||
|
}
|
||||||
|
|
||||||
|
void DockTitleBar::SetCloseVisible(bool bVisible)
|
||||||
|
{
|
||||||
|
ui->sys_close->setVisible(bVisible);
|
||||||
|
}
|
||||||
@ -16,6 +16,9 @@ public:
|
|||||||
//QSize minimumSizeHint() const override;
|
//QSize minimumSizeHint() const override;
|
||||||
|
|
||||||
void SetTitle(const QString& title) override;
|
void SetTitle(const QString& title) override;
|
||||||
|
void SetFloatVisible(bool bVisible);
|
||||||
|
void SetMaxVisible(bool bVisible);
|
||||||
|
void SetCloseVisible(bool bVisible);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void paintEvent(QPaintEvent* event) override;
|
void paintEvent(QPaintEvent* event) override;
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>213</width>
|
<width>367</width>
|
||||||
<height>40</height>
|
<height>40</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
@ -14,20 +14,17 @@
|
|||||||
<string>DockTitleBar</string>
|
<string>DockTitleBar</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
<property name="spacing">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="leftMargin">
|
<property name="leftMargin">
|
||||||
<number>0</number>
|
<number>20</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="topMargin">
|
<property name="topMargin">
|
||||||
<number>0</number>
|
<number>5</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="rightMargin">
|
<property name="rightMargin">
|
||||||
<number>0</number>
|
<number>5</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="bottomMargin">
|
<property name="bottomMargin">
|
||||||
<number>0</number>
|
<number>5</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="sys_title">
|
<widget class="QLabel" name="sys_title">
|
||||||
@ -62,6 +59,19 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="sys_max">
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>32</width>
|
||||||
|
<height>32</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="sys_close">
|
<widget class="QPushButton" name="sys_close">
|
||||||
<property name="maximumSize">
|
<property name="maximumSize">
|
||||||
|
|||||||
@ -35,12 +35,14 @@ DockWidget::DockWidget(const QString& title, QWidget* parent)
|
|||||||
windowManagerMenu->AddDockWidget(this);
|
windowManagerMenu->AddDockWidget(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_bMax = false;
|
||||||
//setStyleSheet(QString("border: 1px solid #A2C2DB;"));
|
//setStyleSheet(QString("border: 1px solid #A2C2DB;"));
|
||||||
}
|
}
|
||||||
|
|
||||||
DockWidget::DockWidget(QWidget* parent)
|
DockWidget::DockWidget(QWidget* parent)
|
||||||
: QDockWidget(parent) {
|
: QDockWidget(parent) {
|
||||||
setFeatures(DockWidgetClosable | DockWidgetMovable | DockWidgetFloatable);
|
setFeatures(DockWidgetClosable | DockWidgetMovable | DockWidgetFloatable);
|
||||||
|
m_bMax = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -58,6 +60,7 @@ void DockWidget::SetDockWidgetTitleBar(DockWidgetTitleBar* titleBar) {
|
|||||||
if (nullptr != titleBar_) {
|
if (nullptr != titleBar_) {
|
||||||
disconnect(titleBar_, &DockWidgetTitleBar::signalClose, this, &DockWidget::close);
|
disconnect(titleBar_, &DockWidgetTitleBar::signalClose, this, &DockWidget::close);
|
||||||
disconnect(titleBar_, &DockWidgetTitleBar::signalToggleFloating, this, &DockWidget::OnToggleFloat);
|
disconnect(titleBar_, &DockWidgetTitleBar::signalToggleFloating, this, &DockWidget::OnToggleFloat);
|
||||||
|
disconnect(titleBar_, &DockWidgetTitleBar::signalMax, this, &DockWidget::OnMax);
|
||||||
}
|
}
|
||||||
titleBar_ = titleBar;
|
titleBar_ = titleBar;
|
||||||
if (nullptr == titleBar_) {
|
if (nullptr == titleBar_) {
|
||||||
@ -68,6 +71,7 @@ void DockWidget::SetDockWidgetTitleBar(DockWidgetTitleBar* titleBar) {
|
|||||||
titleBar_->SetTitle(windowTitle());
|
titleBar_->SetTitle(windowTitle());
|
||||||
connect(titleBar_, &DockWidgetTitleBar::signalClose, this, &DockWidget::OnClose);
|
connect(titleBar_, &DockWidgetTitleBar::signalClose, this, &DockWidget::OnClose);
|
||||||
connect(titleBar_, &DockWidgetTitleBar::signalToggleFloating, this, &DockWidget::OnToggleFloat);
|
connect(titleBar_, &DockWidgetTitleBar::signalToggleFloating, this, &DockWidget::OnToggleFloat);
|
||||||
|
connect(titleBar_, &DockWidgetTitleBar::signalMax, this, &DockWidget::OnMax);
|
||||||
QDockWidget::setTitleBarWidget(titleBar_);
|
QDockWidget::setTitleBarWidget(titleBar_);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -95,6 +99,23 @@ void DockWidget::OnToggleFloat() {
|
|||||||
setFloating(!isFloating());
|
setFloating(!isFloating());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DockWidget::OnMax() {
|
||||||
|
if (!isFloating())
|
||||||
|
{
|
||||||
|
setFloating(true);
|
||||||
|
}
|
||||||
|
if (m_bMax)
|
||||||
|
{
|
||||||
|
showNormal();
|
||||||
|
m_bMax = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
showMaximized();
|
||||||
|
m_bMax = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void DockWidgetTitleBar::mouseDoubleClickEvent(QMouseEvent* event) {
|
void DockWidgetTitleBar::mouseDoubleClickEvent(QMouseEvent* event) {
|
||||||
QWidget::mouseDoubleClickEvent(event);
|
QWidget::mouseDoubleClickEvent(event);
|
||||||
emit signalToggleFloating();
|
emit signalToggleFloating();
|
||||||
|
|||||||
@ -24,6 +24,7 @@ protected:
|
|||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
void signalClose();
|
void signalClose();
|
||||||
void signalToggleFloating();
|
void signalToggleFloating();
|
||||||
|
void signalMax();
|
||||||
};
|
};
|
||||||
|
|
||||||
class DockWidget : public QDockWidget {
|
class DockWidget : public QDockWidget {
|
||||||
@ -49,7 +50,9 @@ protected:
|
|||||||
private:
|
private:
|
||||||
void OnClose();
|
void OnClose();
|
||||||
void OnToggleFloat();
|
void OnToggleFloat();
|
||||||
|
void OnMax();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DockWidgetTitleBar* titleBar_{ nullptr };
|
DockWidgetTitleBar* titleBar_{ nullptr };
|
||||||
|
bool m_bMax;
|
||||||
};
|
};
|
||||||
@ -13,6 +13,11 @@
|
|||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>AddParamSetting</string>
|
<string>AddParamSetting</string>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="styleSheet">
|
||||||
|
<string notr="true">QWidget#AddParamSettingClass {
|
||||||
|
border: 2px solid #7FB3D5;
|
||||||
|
}</string>
|
||||||
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QTableWidget" name="tableWidget">
|
<widget class="QTableWidget" name="tableWidget">
|
||||||
|
|||||||
@ -122,6 +122,8 @@ void MainFrame::InitUI() {
|
|||||||
MainWindow* mainWindow = new MainWindow(this);
|
MainWindow* mainWindow = new MainWindow(this);
|
||||||
layout->addWidget(mainWindow);
|
layout->addWidget(mainWindow);
|
||||||
|
|
||||||
|
simuRunMenu->SetMainWindow(mainWindow);
|
||||||
|
|
||||||
OsgWidget* viewWidget = mainWindow->GetViewWidget();
|
OsgWidget* viewWidget = mainWindow->GetViewWidget();
|
||||||
connect(fileMenu, &FileManagerMenu::LoadDyt, viewWidget, &OsgWidget::OnLoadDyt);
|
connect(fileMenu, &FileManagerMenu::LoadDyt, viewWidget, &OsgWidget::OnLoadDyt);
|
||||||
connect(viewWidget, &OsgWidget::signalResetWorkSpace, mainWindow, &MainWindow::slotResetWorkSpace);
|
connect(viewWidget, &OsgWidget::signalResetWorkSpace, mainWindow, &MainWindow::slotResetWorkSpace);
|
||||||
|
|||||||
@ -61,10 +61,10 @@ void MainWindow::InitUI() {
|
|||||||
DockWidget* model = new DockWidget(tr("model elements"), 0);
|
DockWidget* model = new DockWidget(tr("model elements"), 0);
|
||||||
model->SetDockWidgetTitleBar(new DockTitleBar(model));
|
model->SetDockWidgetTitleBar(new DockTitleBar(model));
|
||||||
model->setObjectName("Dock.ModelBrowser");
|
model->setObjectName("Dock.ModelBrowser");
|
||||||
// addDockWidget(pSettingUI->GetArea("ModelBrowser"), model);
|
|
||||||
modelBrowser_ = new ModelBrowser(0);
|
modelBrowser_ = new ModelBrowser(0);
|
||||||
modelBrowser_->AttachDock(model);
|
modelBrowser_->AttachDock(model);
|
||||||
m_mapDockWidget.insert("ModelBrowser", model);
|
m_mapDockWidget.insert("ModelBrowser", model);
|
||||||
|
addDockWidget(Qt::LeftDockWidgetArea, model);
|
||||||
|
|
||||||
// 创建预制模型面板
|
// 创建预制模型面板
|
||||||
DockWidget* presetModel = new DockWidget(tr("preset models"), 0);
|
DockWidget* presetModel = new DockWidget(tr("preset models"), 0);
|
||||||
@ -72,6 +72,7 @@ void MainWindow::InitUI() {
|
|||||||
presetModel->setObjectName("Dock.PresetModelPanel");
|
presetModel->setObjectName("Dock.PresetModelPanel");
|
||||||
presetModelPanel_ = new PresetModelPanel(0);
|
presetModelPanel_ = new PresetModelPanel(0);
|
||||||
presetModelPanel_->AttachDock(presetModel);
|
presetModelPanel_->AttachDock(presetModel);
|
||||||
|
addDockWidget(Qt::LeftDockWidgetArea, presetModel);
|
||||||
m_mapDockWidget.insert("PresetModelPanel", presetModel);
|
m_mapDockWidget.insert("PresetModelPanel", presetModel);
|
||||||
|
|
||||||
DockWidget* attribte = new DockWidget(tr("attribte"), 0);
|
DockWidget* attribte = new DockWidget(tr("attribte"), 0);
|
||||||
@ -96,36 +97,34 @@ void MainWindow::InitUI() {
|
|||||||
addDockWidget(Qt::LeftDockWidgetArea, viewDock);
|
addDockWidget(Qt::LeftDockWidgetArea, viewDock);
|
||||||
m_mapDockWidget.insert("MainView", viewDock);
|
m_mapDockWidget.insert("MainView", viewDock);
|
||||||
|
|
||||||
addDockWidget(Qt::LeftDockWidgetArea, model);
|
|
||||||
addDockWidget(Qt::LeftDockWidgetArea, presetModel);
|
|
||||||
splitDockWidget(model, viewDock, Qt::Horizontal);
|
splitDockWidget(model, viewDock, Qt::Horizontal);
|
||||||
|
|
||||||
// 将预制模型面板与模型浏览器标签化
|
|
||||||
tabifyDockWidget(model, presetModel);
|
|
||||||
|
|
||||||
QString wavePath ="", speedPath = "", rdPath = "", matlabParam="";
|
// 将预制模型面板与模型浏览器标签化
|
||||||
if (WorkSpaceManager::Get().GetCurrent())
|
tabifyDockWidget(model, presetModel);
|
||||||
{
|
|
||||||
if (!WorkSpaceManager::Get().GetCurrent()->GetWavePath().isEmpty())
|
|
||||||
{
|
|
||||||
wavePath = RecourceHelper::Get().GetBasePath() + "/" + WorkSpaceManager::Get().GetCurrent()->GetWavePath();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!WorkSpaceManager::Get().GetCurrent()->GetReportPath().isEmpty())
|
//QString wavePath ="", speedPath = "", rdPath = "", matlabParam="";
|
||||||
{
|
//if (WorkSpaceManager::Get().GetCurrent())
|
||||||
speedPath = RecourceHelper::Get().GetBasePath() + "/" + WorkSpaceManager::Get().GetCurrent()->GetReportPath();
|
//{
|
||||||
}
|
// if (!WorkSpaceManager::Get().GetCurrent()->GetWavePath().isEmpty())
|
||||||
|
// {
|
||||||
|
// wavePath = RecourceHelper::Get().GetBasePath() + "/" + WorkSpaceManager::Get().GetCurrent()->GetWavePath();
|
||||||
|
// }
|
||||||
|
|
||||||
if (!WorkSpaceManager::Get().GetCurrent()->GetRDPath().isEmpty())
|
// if (!WorkSpaceManager::Get().GetCurrent()->GetReportPath().isEmpty())
|
||||||
{
|
// {
|
||||||
rdPath = RecourceHelper::Get().GetBasePath() + "/" + WorkSpaceManager::Get().GetCurrent()->GetRDPath();
|
// speedPath = RecourceHelper::Get().GetBasePath() + "/" + WorkSpaceManager::Get().GetCurrent()->GetReportPath();
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (!WorkSpaceManager::Get().GetCurrent()->GetMatlabParam().isEmpty())
|
// if (!WorkSpaceManager::Get().GetCurrent()->GetRDPath().isEmpty())
|
||||||
{
|
// {
|
||||||
matlabParam = RecourceHelper::Get().GetBasePath() + "/" + WorkSpaceManager::Get().GetCurrent()->GetMatlabParam();
|
// rdPath = RecourceHelper::Get().GetBasePath() + "/" + WorkSpaceManager::Get().GetCurrent()->GetRDPath();
|
||||||
}
|
// }
|
||||||
}
|
|
||||||
|
// if (!WorkSpaceManager::Get().GetCurrent()->GetMatlabParam().isEmpty())
|
||||||
|
// {
|
||||||
|
// matlabParam = RecourceHelper::Get().GetBasePath() + "/" + WorkSpaceManager::Get().GetCurrent()->GetMatlabParam();
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
|
||||||
//DockWidget* fitCurveDock = new DockWidget(tr("Wave Curve"), 0);
|
//DockWidget* fitCurveDock = new DockWidget(tr("Wave Curve"), 0);
|
||||||
//fitCurveDock->SetDockWidgetTitleBar(new DockTitleBar(fitCurveDock));
|
//fitCurveDock->SetDockWidgetTitleBar(new DockTitleBar(fitCurveDock));
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>847</width>
|
<width>1123</width>
|
||||||
<height>58</height>
|
<height>58</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
@ -16,6 +16,12 @@
|
|||||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="psbPlay">
|
<widget class="QPushButton" name="psbPlay">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>35</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>play</string>
|
<string>play</string>
|
||||||
</property>
|
</property>
|
||||||
@ -23,6 +29,12 @@
|
|||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="psbStop">
|
<widget class="QPushButton" name="psbStop">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>35</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>stop</string>
|
<string>stop</string>
|
||||||
</property>
|
</property>
|
||||||
@ -101,6 +113,12 @@
|
|||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="psbUp">
|
<widget class="QPushButton" name="psbUp">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>35</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>up</string>
|
<string>up</string>
|
||||||
</property>
|
</property>
|
||||||
@ -108,6 +126,12 @@
|
|||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="psbDown">
|
<widget class="QPushButton" name="psbDown">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>35</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>down</string>
|
<string>down</string>
|
||||||
</property>
|
</property>
|
||||||
|
|||||||
@ -1,5 +1,8 @@
|
|||||||
#include "ui/Menu/SimuRunMenu.h"
|
#include "ui/Menu/SimuRunMenu.h"
|
||||||
#include "ui/Layout/AddParamSetting.h"
|
#include "ui/Layout/AddParamSetting.h"
|
||||||
|
#include "ui/DockWidget.h"
|
||||||
|
#include "ui/DockTitleBar.h"
|
||||||
|
#include "ui/MainWindow.h"
|
||||||
|
|
||||||
#include <QHBoxLayout>
|
#include <QHBoxLayout>
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
@ -13,6 +16,7 @@ SimuRunMenu::SimuRunMenu(QWidget *parent)
|
|||||||
: QWidget(parent)
|
: QWidget(parent)
|
||||||
{
|
{
|
||||||
m_pParam = NULL;
|
m_pParam = NULL;
|
||||||
|
m_mainWindow = NULL;
|
||||||
|
|
||||||
QHBoxLayout* layout = new QHBoxLayout(this);
|
QHBoxLayout* layout = new QHBoxLayout(this);
|
||||||
layout->setContentsMargins(9, 0, 0, 0);
|
layout->setContentsMargins(9, 0, 0, 0);
|
||||||
@ -122,9 +126,9 @@ void SimuRunMenu::CreateMatlabParam()
|
|||||||
|
|
||||||
QToolButton *pBtn = new QToolButton();
|
QToolButton *pBtn = new QToolButton();
|
||||||
pBtn->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
|
pBtn->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
|
||||||
pBtn->setText(tr("MatlabParam"));
|
pBtn->setText(QString::fromLocal8Bit("参数设置"));
|
||||||
pBtn->setIcon(QIcon(":/res/default/menu_setting_restore.png"));
|
pBtn->setIcon(QIcon(":/res/default/menu_setting_restore.png"));
|
||||||
pBtn->setToolTip(tr("MatlabParam"));
|
pBtn->setToolTip(QString::fromLocal8Bit("设置Matlab的输入参数"));
|
||||||
|
|
||||||
connect(pBtn, SIGNAL(clicked()), this, SLOT(slotHandleMatlabParam()));
|
connect(pBtn, SIGNAL(clicked()), this, SLOT(slotHandleMatlabParam()));
|
||||||
|
|
||||||
@ -180,11 +184,28 @@ void SimuRunMenu::slotHandleMatlabParam()
|
|||||||
{
|
{
|
||||||
if (!m_pParam)
|
if (!m_pParam)
|
||||||
{
|
{
|
||||||
|
m_pParam = new DockWidget(m_mainWindow);
|
||||||
|
m_pParam->setAllowedAreas(Qt::NoDockWidgetArea);
|
||||||
|
|
||||||
|
DockTitleBar* titleBar = new DockTitleBar(m_pParam);
|
||||||
|
titleBar->SetFloatVisible(false);
|
||||||
|
titleBar->SetMaxVisible(false);
|
||||||
|
m_pParam->SetDockWidgetTitleBar(titleBar);
|
||||||
|
m_pParam->setWindowTitle(QString::fromLocal8Bit("参数设置"));
|
||||||
|
|
||||||
QString strDir = WorkSpaceManager::Get().GetCurrent()->GetDir();
|
QString strDir = WorkSpaceManager::Get().GetCurrent()->GetDir();
|
||||||
m_pParam = new AddParamSetting(strDir);
|
AddParamSetting *pParam = new AddParamSetting(strDir);
|
||||||
|
m_pParam->setWidget(pParam);
|
||||||
|
|
||||||
|
m_pParam->resize(1000, 600);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_pParam->setWindowTitle(tr("MatlabParam"));
|
m_pParam->setFloating(true);
|
||||||
m_pParam->show();
|
m_pParam->show();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void SimuRunMenu::SetMainWindow(MainWindow* mainWindow)
|
||||||
|
{
|
||||||
|
m_mainWindow = mainWindow;
|
||||||
}
|
}
|
||||||
@ -5,7 +5,8 @@
|
|||||||
#include "workspace/CommandManager.h"
|
#include "workspace/CommandManager.h"
|
||||||
#include "workspace/CommandExecutor.h"
|
#include "workspace/CommandExecutor.h"
|
||||||
|
|
||||||
class AddParamSetting;
|
class DockWidget;
|
||||||
|
class MainWindow;
|
||||||
|
|
||||||
class SimuRunMenu : public QWidget {
|
class SimuRunMenu : public QWidget {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@ -14,6 +15,8 @@ public:
|
|||||||
SimuRunMenu(QWidget *parent = nullptr);
|
SimuRunMenu(QWidget *parent = nullptr);
|
||||||
~SimuRunMenu();
|
~SimuRunMenu();
|
||||||
|
|
||||||
|
void SetMainWindow(MainWindow* mainWindow);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void OnWorkspaceChanged(class WorkSpace* ws);
|
void OnWorkspaceChanged(class WorkSpace* ws);
|
||||||
|
|
||||||
@ -30,5 +33,6 @@ private:
|
|||||||
void ClearAllBtn();
|
void ClearAllBtn();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
AddParamSetting *m_pParam;
|
DockWidget *m_pParam;
|
||||||
|
MainWindow* m_mainWindow;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -317,9 +317,10 @@ void CurvePanel::initQChartView() {
|
|||||||
|
|
||||||
curveChart = new QChart();
|
curveChart = new QChart();
|
||||||
curveChart->setTheme(QChart::ChartThemeBlueIcy);
|
curveChart->setTheme(QChart::ChartThemeBlueIcy);
|
||||||
|
curveChart->layout()->setContentsMargins(0, 0, 0, 0);
|
||||||
curveChart->setBackgroundRoundness(0);
|
curveChart->setBackgroundRoundness(0);
|
||||||
curveChartView->setChart(curveChart);
|
curveChartView->setChart(curveChart);
|
||||||
|
|
||||||
m_pAxisX = new QValueAxis;
|
m_pAxisX = new QValueAxis;
|
||||||
m_pAxisX->setRange(0, 10);
|
m_pAxisX->setRange(0, 10);
|
||||||
m_pAxisX->setLabelsAngle(-90);
|
m_pAxisX->setLabelsAngle(-90);
|
||||||
@ -331,9 +332,10 @@ void CurvePanel::initQChartView() {
|
|||||||
|
|
||||||
curveChartView->setRenderHint(QPainter::Antialiasing);
|
curveChartView->setRenderHint(QPainter::Antialiasing);
|
||||||
|
|
||||||
QHBoxLayout* pLayout = new QHBoxLayout(this);
|
QHBoxLayout* mainLayout = new QHBoxLayout(this);
|
||||||
pLayout->setContentsMargins(0, 0, 0, 0);
|
mainLayout->setContentsMargins(0, 0, 0, 0);
|
||||||
pLayout->addWidget(curveChartView);
|
mainLayout->addWidget(curveChartView);
|
||||||
|
setLayout(mainLayout);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CurvePanel::OnDataPanelUpdated(FileEntryCurve* fileEntry) {
|
void CurvePanel::OnDataPanelUpdated(FileEntryCurve* fileEntry) {
|
||||||
|
|||||||
@ -140,6 +140,8 @@ void LightPanel::updateParseFile(const QString & strFile, int nT, FileEntryLight
|
|||||||
m_mapLamp.insert(strKey, pLampLab);
|
m_mapLamp.insert(strKey, pLampLab);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
pMainLyt->setContentsMargins(5, 0, 5, 0);
|
||||||
|
setLayout(pMainLyt);
|
||||||
|
|
||||||
while (!file.atEnd())
|
while (!file.atEnd())
|
||||||
{
|
{
|
||||||
|
|||||||
@ -83,6 +83,7 @@ void SurfacePanel::InitUI()
|
|||||||
containerHandle->setAttribute(Qt::WA_OpaquePaintEvent, true);
|
containerHandle->setAttribute(Qt::WA_OpaquePaintEvent, true);
|
||||||
containerHandle->setAttribute(Qt::WA_NoSystemBackground, false);
|
containerHandle->setAttribute(Qt::WA_NoSystemBackground, false);
|
||||||
containerHandle->setUpdatesEnabled(false);
|
containerHandle->setUpdatesEnabled(false);
|
||||||
|
containerHandle->setMinimumHeight(100);
|
||||||
|
|
||||||
m_pSeries->setBaseColor(Qt::green);
|
m_pSeries->setBaseColor(Qt::green);
|
||||||
m_pSeries->setColorStyle(Q3DTheme::ColorStyleUniform);
|
m_pSeries->setColorStyle(Q3DTheme::ColorStyleUniform);
|
||||||
|
|||||||
@ -48,7 +48,7 @@ void PresetModelPanel::AttachDock(DockWidget* dockWidget)
|
|||||||
void PresetModelPanel::InitUI()
|
void PresetModelPanel::InitUI()
|
||||||
{
|
{
|
||||||
mainLayout_ = new QVBoxLayout(this);
|
mainLayout_ = new QVBoxLayout(this);
|
||||||
mainLayout_->setContentsMargins(5, 5, 5, 5);
|
mainLayout_->setContentsMargins(0, 0, 0, 0);
|
||||||
mainLayout_->setSpacing(5);
|
mainLayout_->setSpacing(5);
|
||||||
|
|
||||||
toolBox_ = new QToolBox(this);
|
toolBox_ = new QToolBox(this);
|
||||||
@ -70,10 +70,10 @@ QWidget* PresetModelPanel::CreateShipPage()
|
|||||||
QVBoxLayout* layout = new QVBoxLayout(page);
|
QVBoxLayout* layout = new QVBoxLayout(page);
|
||||||
|
|
||||||
QStringList shipModels = {
|
QStringList shipModels = {
|
||||||
"Destroyer",
|
tr("Destroyer"),
|
||||||
"Aircraft Carrier",
|
tr("Aircraft Carrier"),
|
||||||
"Frigate",
|
tr("Frigate"),
|
||||||
"Submarine"
|
tr("Submarine")
|
||||||
};
|
};
|
||||||
|
|
||||||
shipList_ = CreateModelList(page, "Ship", shipModels);
|
shipList_ = CreateModelList(page, "Ship", shipModels);
|
||||||
@ -88,10 +88,10 @@ QWidget* PresetModelPanel::CreateSatellitePage()
|
|||||||
QVBoxLayout* layout = new QVBoxLayout(page);
|
QVBoxLayout* layout = new QVBoxLayout(page);
|
||||||
|
|
||||||
QStringList satelliteModels = {
|
QStringList satelliteModels = {
|
||||||
"Geostationary Satellite",
|
tr("Geostationary Satellite"),
|
||||||
"Communication Satellite",
|
tr("Communication Satellite"),
|
||||||
"Weather Satellite",
|
tr("Weather Satellite"),
|
||||||
"Navigation Satellite"
|
tr("Navigation Satellite")
|
||||||
};
|
};
|
||||||
|
|
||||||
satelliteList_ = CreateModelList(page, "Satellite", satelliteModels);
|
satelliteList_ = CreateModelList(page, "Satellite", satelliteModels);
|
||||||
@ -106,10 +106,10 @@ QWidget* PresetModelPanel::CreateMissilePage()
|
|||||||
QVBoxLayout* layout = new QVBoxLayout(page);
|
QVBoxLayout* layout = new QVBoxLayout(page);
|
||||||
|
|
||||||
QStringList missileModels = {
|
QStringList missileModels = {
|
||||||
"Hypersonic Missile",
|
tr("Hypersonic Missile"),
|
||||||
"Cruise Missile",
|
tr("Cruise Missile"),
|
||||||
"Ballistic Missile",
|
tr("Ballistic Missile"),
|
||||||
"Anti-Ship Missile"
|
tr("Anti-Ship Missile")
|
||||||
};
|
};
|
||||||
|
|
||||||
missileList_ = CreateModelList(page, "Missile", missileModels);
|
missileList_ = CreateModelList(page, "Missile", missileModels);
|
||||||
@ -124,10 +124,10 @@ QWidget* PresetModelPanel::CreateJammerPage()
|
|||||||
QVBoxLayout* layout = new QVBoxLayout(page);
|
QVBoxLayout* layout = new QVBoxLayout(page);
|
||||||
|
|
||||||
QStringList jammerModels = {
|
QStringList jammerModels = {
|
||||||
"Passive Jammer",
|
tr("Passive Jammer"),
|
||||||
"Active Jammer",
|
tr("Active Jammer"),
|
||||||
"Electronic Warfare Pod",
|
tr("Electronic Warfare Pod"),
|
||||||
"Decoy System"
|
tr("Decoy System")
|
||||||
};
|
};
|
||||||
|
|
||||||
jammerList_ = CreateModelList(page, "Jammer", jammerModels);
|
jammerList_ = CreateModelList(page, "Jammer", jammerModels);
|
||||||
|
|||||||
@ -77,12 +77,18 @@ bool WorkSpaceXMLWrite::SaveTimeStep(tinyxml2::XMLElement* scene) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool WorkSpaceXMLWrite::SaveLamp(tinyxml2::XMLElement* scene) {
|
bool WorkSpaceXMLWrite::SaveLamp(tinyxml2::XMLElement* scene) {
|
||||||
tinyxml2::XMLElement* lamp = scene->InsertNewChildElement("lamp");
|
LampStatus *pLampStatus = workSpace_->GetLampStatus();
|
||||||
const QString lampPath = workSpace_->GetLampStatus()->GetPath();
|
if (pLampStatus)
|
||||||
if (!lampPath.isEmpty()) {
|
{
|
||||||
lamp->SetAttribute("path", lampPath.toStdString().c_str());
|
const QString lampPath = pLampStatus->GetPath();
|
||||||
}
|
if (!lampPath.isEmpty()) {
|
||||||
return true;
|
tinyxml2::XMLElement* lamp = scene->InsertNewChildElement("lamp");
|
||||||
|
lamp->SetAttribute("path", lampPath.toStdString().c_str());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool WorkSpaceXMLWrite::SaveCommond(tinyxml2::XMLElement* scene) {
|
bool WorkSpaceXMLWrite::SaveCommond(tinyxml2::XMLElement* scene) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user