From e2a28fdcc59b0775de52581a6032d42397f95098 Mon Sep 17 00:00:00 2001 From: mzh Date: Wed, 30 Oct 2024 16:28:18 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E5=88=9D=E6=AD=A5=E5=AE=8C=E6=88=90?= =?UTF-8?q?=E5=9F=BA=E6=9C=AC=E6=A8=A1=E5=9E=8B=E7=9A=84=E7=95=8C=E9=9D=A2?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=202=E3=80=81=E5=9C=A8CFDStructMainWindow?= =?UTF-8?q?=E4=B8=AD=E8=B0=83=E7=94=A8=E4=BA=86DataManager=EF=BC=8C?= =?UTF-8?q?=E4=BD=BF=E7=BC=96=E8=AF=91=E5=99=A8=E8=83=BD=E5=A4=9F=E8=BF=90?= =?UTF-8?q?=E8=A1=8C=E6=B3=A8=E5=86=8C=E5=AE=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CFDStructDataManager.h | 3 + .../CFDStructDataManager.pri | 2 + .../CFDStructDataManager.pro | 3 + .../CFDStructDataSolverBasicModelManager.cpp | 107 ++++++++++++++++++ .../CFDStructDataSolverBasicModelManager.h | 40 +++++++ CFDStruct/CFDStructMain/CFDStructMain.pro | 3 + .../CFDStructMain/CFDStructMainWindow.cpp | 11 ++ CFDStruct/CFDStructMain/CFDTreeWidget.cpp | 2 +- CFDStruct/CUIProperty/CUI.cpp | 3 + CFDStruct/CUIProperty/CUIConfig.cpp | 4 +- 10 files changed, 176 insertions(+), 2 deletions(-) create mode 100644 CFDStruct/CFDStructDataManager/CFDStructDataSolverBasicModelManager.cpp create mode 100644 CFDStruct/CFDStructDataManager/CFDStructDataSolverBasicModelManager.h diff --git a/CFDStruct/CFDStructDataManager/CFDStructDataManager.h b/CFDStruct/CFDStructDataManager/CFDStructDataManager.h index f38dcde..82bf161 100644 --- a/CFDStruct/CFDStructDataManager/CFDStructDataManager.h +++ b/CFDStruct/CFDStructDataManager/CFDStructDataManager.h @@ -2,6 +2,9 @@ #define CFDSTRUCTDATAMANAGER_H #include "CFDStructDataManager_global.h" + + + class CFDStructDataSolverTimeModeManager; class CUIConfig; diff --git a/CFDStruct/CFDStructDataManager/CFDStructDataManager.pri b/CFDStruct/CFDStructDataManager/CFDStructDataManager.pri index 655cca8..ea88843 100644 --- a/CFDStruct/CFDStructDataManager/CFDStructDataManager.pri +++ b/CFDStruct/CFDStructDataManager/CFDStructDataManager.pri @@ -1,10 +1,12 @@ SOURCES += \ $$PWD/CFDStructDataSolverTimeModeManager.cpp \ + $$PWD/CFDStructDataSolverBasicModelManager.cpp \ $$PWD/CFDStructSigsCenter.cpp \ $$PWD/CFDStructDataManager.cpp \ HEADERS += \ $$PWD/CFDStructDataSolverTimeModeManager.h \ + $$PWD/CFDStructDataSolverBasicModelManager.h \ $$PWD/CFDStructSigsCenter.h \ $$PWD/CFDStructDataManager_global.h \ $$PWD/CFDStructDataManager.h diff --git a/CFDStruct/CFDStructDataManager/CFDStructDataManager.pro b/CFDStruct/CFDStructDataManager/CFDStructDataManager.pro index bb20f1e..5645936 100644 --- a/CFDStruct/CFDStructDataManager/CFDStructDataManager.pro +++ b/CFDStruct/CFDStructDataManager/CFDStructDataManager.pro @@ -60,6 +60,7 @@ win32{ -lFITKFlowOFIOHDF5 \ -lOperatorsModel \ -lCUIProperty \ + -lCFDStructOperatorsModel \ # -lCFDStructDataManager \ @@ -93,6 +94,8 @@ win32{ -lFITKFlowOFIOHDF5 \ -lOperatorsModel \ -lCUIProperty \ + -lCFDStructOperatorsModel \ + # -lCFDStructDataManager \ diff --git a/CFDStruct/CFDStructDataManager/CFDStructDataSolverBasicModelManager.cpp b/CFDStruct/CFDStructDataManager/CFDStructDataSolverBasicModelManager.cpp new file mode 100644 index 0000000..b797333 --- /dev/null +++ b/CFDStruct/CFDStructDataManager/CFDStructDataSolverBasicModelManager.cpp @@ -0,0 +1,107 @@ +#include "CFDStructDataSolverBasicModelManager.h" +#include "CUIProperty/CUIConfig.h" + +CFDStructDataSolverBasicModelManager::CFDStructDataSolverBasicModelManager(QObject *parent) : QObject(parent) +{ + m_uiConfig = nullptr; +} + +CFDStructDataSolverBasicModelManager::~CFDStructDataSolverBasicModelManager() +{ + if (m_uiConfig != nullptr) + { + delete m_uiConfig; + m_uiConfig = nullptr; + } +} + +/** + * @param 求解器中,基本模型,流体属性关闭时的属性界面设置 + * + * @return 属性设置 + */ +CUIConfig *CFDStructDataSolverBasicModelManager::genFluidPropertiesOffUIConfig() +{ + return new CUIConfig({ + {"type", "Widget"}, + }, + {new CUIConfig({ + // 下拉框:求解器类型 + {"type", "ComboBox"}, + {"name", tr("Solver Type")}, + }, + {new CUIConfig({ + {"type", "Item"}, {"name", tr("Compressible Flow")} // 选项:可压缩流动 + })}), + new CUIConfig({// 下拉框:流动模型 + {"type", "ComboBox"}, + {"name", tr("Flow Model")}}, + {new CUIConfig({// 选项:外流 + {"type", "Item"}, + {"name", tr("Internal Flow")}}), + new CUIConfig({// 选项:内流 + {"type", "Item"}, + {"name", tr("External Flow")}}), + new CUIConfig({// 选项:多级叶轮机械 + {"type", "Item"}, + {"name", tr("Multistage Turbomachinery")}})}), + new CUIConfig({// 方形勾选:重叠网络 + {"type", "CheckBox"}, + {"name", tr("Overlay Network")}}), + new CUIConfig({// 圆形选择按钮:流体属性 + {"type", "RadioButton"}, + {"name", tr("Fluid Properties")}})}); +} + +CUIConfig *CFDStructDataSolverBasicModelManager::genFluidPropertiesOnUIConfig() +{ + return new CUIConfig({ + {"type", "Widget"}, + }, + {new CUIConfig({ + // 下拉框:求解器类型 + {"type", "ComboBox"}, + {"name", tr("Solver Type")}, + }, + {new CUIConfig({ + {"type", "Item"}, {"name", tr("Compressible Flow")} // 选项:可压缩流动 + })}), + new CUIConfig({// 下拉框:流动模型 + {"type", "ComboBox"}, + {"name", tr("Flow Model")}}, + {new CUIConfig({// 选项:外流 + {"type", "Item"}, + {"name", tr("Internal Flow")}}), + new CUIConfig({// 选项:内流 + {"type", "Item"}, + {"name", tr("External Flow")}}), + new CUIConfig({// 选项:多级叶轮机械 + {"type", "Item"}, + {"name", tr("Multistage Turbomachinery")}})}), + new CUIConfig({// 方形勾选:重叠网络 + {"type", "CheckBox"}, + {"name", tr("ichimr")}}), + new CUIConfig({// 圆形选择按钮:流体属性 + {"type", "RadioButton"}, + {"name", tr("Fluid Properties")}}), + new CUIConfig({// 组,流体属性下的内容 + {"type", "GroupBox"}, + {"name", tr("Fluid Properties")}}, + { + new CUIConfig({// 气体成分 + {"type", "LineEdit"}, + {"name", tr("Gas Composition")}}), + new CUIConfig({// 气体常数 + {"type", "LineEdit"}, + {"name", tr("rgasmean")}}), + new CUIConfig({// 比热比 + {"type", "LineEdit"}, + {"name", tr("gmean")}}), + new CUIConfig({// 层流普朗特数 + {"type", "LineEdit"}, + {"name", tr("prlmean")}}), + new CUIConfig({// 湍流普朗特数 + {"type", "LineEdit"}, + {"name", tr("prtmean")}}), + })}); +} diff --git a/CFDStruct/CFDStructDataManager/CFDStructDataSolverBasicModelManager.h b/CFDStruct/CFDStructDataManager/CFDStructDataSolverBasicModelManager.h new file mode 100644 index 0000000..6f57112 --- /dev/null +++ b/CFDStruct/CFDStructDataManager/CFDStructDataSolverBasicModelManager.h @@ -0,0 +1,40 @@ +#ifndef CFDSTRUCTDATASOLVERBASICMODELMANAGER_H +#define CFDSTRUCTDATASOLVERBASICMODELMANAGER_H + +#include +#include "CFDStructDataManager_global.h" +class CUIConfig; + +class CFDSTRUCTDATAMANAGER_EXPORT CFDStructDataSolverBasicModelManager : public QObject +{ + Q_OBJECT +public: + explicit CFDStructDataSolverBasicModelManager(QObject *parent = nullptr); + ~CFDStructDataSolverBasicModelManager(); + + CUIConfig* getParamUIConfig(); + +private: + // 生成流体属性关闭界面配置 + CUIConfig* genFluidPropertiesOffUIConfig(); + // 生成流体属性开启界面配置 + CUIConfig* genFluidPropertiesOnUIConfig(); +signals: + +private: + // 鏃堕棿妯″紡 + int m_runtype = 0; + // 杩唬姝ユ暟锛>=1锛屽畾甯告椂锛氳凯浠f鏁帮紝闈炲畾甯革細鍐呰凯浠f鏁 int m_mcyc = 1000; + // 姝ラ暱妯″紡锛屽浐瀹氾紝涓嶅彲淇敼 + double m_alf0 = 1.0; + // 鏃堕棿姝ラ暱锛0 + double m_realdt = 1.0; + // 鏃堕棿姝ユ暟锛=1 + double m_nstep = 10; + // 鏃跺潎缁熻閲忔暟鎹噰鏍0,1 + int m_timeaverage = 0; + + CUIConfig* m_uiConfig = nullptr; +}; + +#endif // CFDSTRUCTDATASOLVERBASICMODELMANAGER_H diff --git a/CFDStruct/CFDStructMain/CFDStructMain.pro b/CFDStruct/CFDStructMain/CFDStructMain.pro index 4d99a7e..de8e6ef 100644 --- a/CFDStruct/CFDStructMain/CFDStructMain.pro +++ b/CFDStruct/CFDStructMain/CFDStructMain.pro @@ -38,6 +38,7 @@ win32{ -lOperatorsInterface \ -lFITKInterfaceGeometry \ -lCFDStructDataManager \ + -lCFDStructOperatorsModel \ Debug:CONFIG += console @@ -58,6 +59,8 @@ win32{ -lOperatorsInterface \ -lFITKInterfaceGeometry \ -lCFDStructDataManager \ + -lCFDStructOperatorsModel \ + Debug:LIBS += -L$$PWD/../../Tools/Win64/SARibbon/libd/ \ -lSARibbonBard \ diff --git a/CFDStruct/CFDStructMain/CFDStructMainWindow.cpp b/CFDStruct/CFDStructMain/CFDStructMainWindow.cpp index 9843238..2a5bc10 100644 --- a/CFDStruct/CFDStructMain/CFDStructMainWindow.cpp +++ b/CFDStruct/CFDStructMain/CFDStructMainWindow.cpp @@ -23,6 +23,10 @@ #include #include +#include "CFDStructOperatorsModel/CFDStructOperatorsTimeModeManager.h" + + + //CFDStructMainWindow::CFDStructMainWindow() : GUI::MainWindow() //{ // qDebug()<<"new CFSStructMainWindow"; @@ -136,7 +140,14 @@ void CFDStructMainWindow::initPropertyWidget() // }); // cuiconfig->printConfig(); // cuilayout->addWidget(cui->getUI()); + + QWidget* test = new CUI(nullptr,new CUIConfig({ + {"type","LineEdit"}, + {"name","test"} + })); + m_PropertyWidget->setWidget(cuiwidget); + m_PropertyWidget->setWidget(test); } void CFDStructMainWindow::initMainWindowMenu() diff --git a/CFDStruct/CFDStructMain/CFDTreeWidget.cpp b/CFDStruct/CFDStructMain/CFDTreeWidget.cpp index a5220d6..2f9b703 100644 --- a/CFDStruct/CFDStructMain/CFDTreeWidget.cpp +++ b/CFDStruct/CFDStructMain/CFDTreeWidget.cpp @@ -5,7 +5,7 @@ #include "GUIFrame/MainTreeWidget.h" #include "OperatorsInterface/GraphEventOperator.h" #include "OperatorsInterface/TreeEventOperator.h" -#include "CFDOperatorsModel/CFDOperatorsTimeModeManager.h" +//#include "CFDOperatorsModel/CFDOperatorsTimeModeManager.h" #include "FITK_Kernel/FITKAppFramework/FITKAppFramework.h" diff --git a/CFDStruct/CUIProperty/CUI.cpp b/CFDStruct/CUIProperty/CUI.cpp index 6311fec..e1736e5 100644 --- a/CFDStruct/CUIProperty/CUI.cpp +++ b/CFDStruct/CUIProperty/CUI.cpp @@ -59,6 +59,9 @@ void CUI::buildUI() QVBoxLayout *layout = new QVBoxLayout; layout->addWidget(widget); this->setLayout(layout); +// QSpacerItem* spacer = new QSpacerItem(5000,5000,QSizePolicy::Maximum,QSizePolicy::Maximum); +// layout->addItem(spacer); + } else { qDebug() << "----------- ui widget is null"; } diff --git a/CFDStruct/CUIProperty/CUIConfig.cpp b/CFDStruct/CUIProperty/CUIConfig.cpp index a25f119..16007b9 100644 --- a/CFDStruct/CUIProperty/CUIConfig.cpp +++ b/CFDStruct/CUIProperty/CUIConfig.cpp @@ -67,7 +67,9 @@ CUIConfig::CUIConfig(QMap property) * - "name" : 组名 * - sub : 按钮 * - * + * @subsection RadioButton 圆形选择按钮 + * - "name" : 组件名 + * * @param property 组件的属性 * @param sub 该组件的子组件配置的列表 */