From e9aca257eb5e7c9fbe8187a89ba3a69e2de5ae4f Mon Sep 17 00:00:00 2001 From: mzh Date: Thu, 31 Oct 2024 17:30:40 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E6=B7=BB=E5=8A=A0=E7=BB=93=E6=9E=84?= =?UTF-8?q?=E6=A0=91=E7=82=B9=E5=87=BB=E4=BA=8B=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CFDStructDataManager.cpp | 47 ++++- .../CFDStructDataManager.h | 34 +++- .../CFDStructDataSolverBasicModelManager.h | 3 + ...ructDataSolverBoundaryConditionManager.cpp | 9 +- ...StructDataSolverBoundaryConditionManager.h | 5 +- ...tructDataSolverComputingControlManager.cpp | 9 +- ...DStructDataSolverComputingControlManager.h | 5 +- ...DStructDataSolverInitializationManager.cpp | 9 +- ...CFDStructDataSolverInitializationManager.h | 5 +- ...ructDataSolverReferenceQuantityManager.cpp | 9 +- ...StructDataSolverReferenceQuantityManager.h | 5 +- ...tructDataSolverSportsAttributesManager.cpp | 7 +- CFDStruct/CFDStructMain/CFDTreeWidget.cpp | 180 +++++++++++------- .../CFDStructOperatorsTimeModeManager.h | 10 + 14 files changed, 221 insertions(+), 116 deletions(-) diff --git a/CFDStruct/CFDStructDataManager/CFDStructDataManager.cpp b/CFDStruct/CFDStructDataManager/CFDStructDataManager.cpp index e05cb7e..7d9bd94 100644 --- a/CFDStruct/CFDStructDataManager/CFDStructDataManager.cpp +++ b/CFDStruct/CFDStructDataManager/CFDStructDataManager.cpp @@ -5,11 +5,15 @@ #include "CFDStructDataSolverKvislManager.h" #include "CFDStructDataSolverNumericalMethodManager.h" -#include "CUIProperty/CUIConfig.h" - +#include "CFDStructDataSolverSportsAttributesManager.h" +#include "CFDStructDataSolverBoundaryConditionManager.h" +#include "CFDStructDataSolverInitializationManager.h" +#include "CFDStructDataSolverReferenceQuantityManager.h" +#include "CFDStructDataSolverComputingControlManager.h" +#include "CUIProperty/CUIConfig.h" -CFDStructDataManager* CFDStructDataManager::m_instance = NULL; +CFDStructDataManager *CFDStructDataManager::m_instance = NULL; CFDStructDataManager::CFDStructDataManager() { this->initDataManagers(); @@ -17,27 +21,44 @@ CFDStructDataManager::CFDStructDataManager() CFDStructDataManager *CFDStructDataManager::getInstance() { - if (m_instance == nullptr) { + if (m_instance == nullptr) + { m_instance = new CFDStructDataManager; } return m_instance; } -CUIConfig* CFDStructDataManager::getActionParamUIConfig(QString s) +CUIConfig *CFDStructDataManager::getActionParamUIConfig(QString s) { - if(s == "actionTimeModeEdit") + if (s == "actionTimeModeEdit") { qDebug("DataManager create TimeMode CUIConfig"); return m_solverTimeModeManager->getParamUIConfig(); } - if(s == "actionBasicModelEdit") + if (s == "actionBasicModelEdit") return m_solverBasicModeManager->getParamUIConfig(); - if(s == "actionViscosityModelEdit") + if (s == "actionViscosityModelEdit") return m_solverKvislManager->getParamUIConfig(); - if(s == "actionNumericalMethodsEdit") + if (s == "actionNumericalMethodsEdit") return m_solverNumericalMethodManager->getParamUIConfig(); - qDebug()<<"DataManager return null CUIConfig"; + // 运动属性 + if (s == "actionMotionPropertiesEdit") + return m_solverSportsAttributesManager->getParamUIConfig(); + // Pressure-Inlet + if (s == "actionPressureInletEdit") + return m_solverBoundaryConditionManager->getParamUIConfig(); + // 初始化 + if (s == "actionInitializationEdit") + return m_solverInitializationManager->getParamUIConfig(); + // 参考量 + if (s == "actionReferenceQuantityEdit") + return m_solverReferenceQuantityManager->getParamUIConfig(); + // 计算控制 + if (s == "actionComputationalControlEdit") + return m_solverComputingControlManager->getParamUIConfig(); + + qDebug() << "DataManager return null CUIConfig"; return nullptr; } @@ -47,4 +68,10 @@ void CFDStructDataManager::initDataManagers() m_solverBasicModeManager = new CFDStructDataSolverBasicModelManager; m_solverKvislManager = new CFDStructDataSolverKvislManager; m_solverNumericalMethodManager = new CFDStructDataSolverNumericalMethodManager; + + m_solverSportsAttributesManager = new CFDStructDataSolverSportsAttributesManager; + m_solverBoundaryConditionManager = new CFDStructDataSolverBoundaryConditionManager; + m_solverInitializationManager = new CFDStructDataSolverInitializationManager; + m_solverReferenceQuantityManager = new CFDStructDataSolverReferenceQuantityManager; + m_solverComputingControlManager = new CFDStructDataSolverComputingControlManager; } diff --git a/CFDStruct/CFDStructDataManager/CFDStructDataManager.h b/CFDStruct/CFDStructDataManager/CFDStructDataManager.h index 66d70ae..213c07e 100644 --- a/CFDStruct/CFDStructDataManager/CFDStructDataManager.h +++ b/CFDStruct/CFDStructDataManager/CFDStructDataManager.h @@ -3,7 +3,11 @@ #include "CFDStructDataManager_global.h" - +class CFDStructDataSolverSportsAttributesManager; +class CFDStructDataSolverBoundaryConditionManager; +class CFDStructDataSolverInitializationManager; +class CFDStructDataSolverReferenceQuantityManager; +class CFDStructDataSolverComputingControlManager; class CFDStructDataSolverTimeModeManager; class CFDStructDataSolverBasicModelManager; @@ -15,20 +19,32 @@ class CFDSTRUCTDATAMANAGER_EXPORT CFDStructDataManager { public: CFDStructDataManager(); - static CFDStructDataManager* getInstance(); + static CFDStructDataManager *getInstance(); // 获取一个action的参数设置配置 - CUIConfig* getActionParamUIConfig(QString s); + CUIConfig *getActionParamUIConfig(QString s); private: void initDataManagers(); -private: - static CFDStructDataManager* m_instance; - CFDStructDataSolverTimeModeManager* m_solverTimeModeManager; - CFDStructDataSolverBasicModelManager* m_solverBasicModeManager; - CFDStructDataSolverKvislManager* m_solverKvislManager; - CFDStructDataSolverNumericalMethodManager* m_solverNumericalMethodManager; +private: + static CFDStructDataManager *m_instance; + + CFDStructDataSolverTimeModeManager *m_solverTimeModeManager; + CFDStructDataSolverBasicModelManager *m_solverBasicModeManager; + CFDStructDataSolverKvislManager *m_solverKvislManager; + CFDStructDataSolverNumericalMethodManager *m_solverNumericalMethodManager; + + // 运动属性 + CFDStructDataSolverSportsAttributesManager *m_solverSportsAttributesManager; + // Pressure-Inlet + CFDStructDataSolverBoundaryConditionManager *m_solverBoundaryConditionManager; + // 初始化 + CFDStructDataSolverInitializationManager *m_solverInitializationManager; + // 参考量 + CFDStructDataSolverReferenceQuantityManager *m_solverReferenceQuantityManager; + // 计算控制 + CFDStructDataSolverComputingControlManager *m_solverComputingControlManager; }; #endif // CFDSTRUCTDATAMANAGER_H diff --git a/CFDStruct/CFDStructDataManager/CFDStructDataSolverBasicModelManager.h b/CFDStruct/CFDStructDataManager/CFDStructDataSolverBasicModelManager.h index 3f538b1..dfa073f 100644 --- a/CFDStruct/CFDStructDataManager/CFDStructDataSolverBasicModelManager.h +++ b/CFDStruct/CFDStructDataManager/CFDStructDataSolverBasicModelManager.h @@ -1,3 +1,6 @@ +/** + * 求解器-基本模型 + */ #ifndef CFDSTRUCTDATASOLVERBASICMODELMANAGER_H #define CFDSTRUCTDATASOLVERBASICMODELMANAGER_H diff --git a/CFDStruct/CFDStructDataManager/CFDStructDataSolverBoundaryConditionManager.cpp b/CFDStruct/CFDStructDataManager/CFDStructDataSolverBoundaryConditionManager.cpp index 0ac1469..ee925f3 100644 --- a/CFDStruct/CFDStructDataManager/CFDStructDataSolverBoundaryConditionManager.cpp +++ b/CFDStruct/CFDStructDataManager/CFDStructDataSolverBoundaryConditionManager.cpp @@ -6,7 +6,7 @@ #include #include "CFDStructDataSolverBoundaryConditionManager.h" -CFDStructDataSolverTimeModeManager::CFDStructDataSolverTimeModeManager(QObject *parent) : CFDStructDataManagerBase(parent) +CFDStructDataSolverBoundaryConditionManager::CFDStructDataSolverBoundaryConditionManager(QObject *parent) : CFDStructDataManagerBase(parent) { m_uiConfig = nullptr; connect(m_cuiSigsCenter, &CUISigsCenter::sig_cuiPropertyChanged, this, [=](int semaphore) @@ -15,12 +15,12 @@ CFDStructDataSolverTimeModeManager::CFDStructDataSolverTimeModeManager(QObject * emit CFDStructSigsCenter::getInstance()->sig_solverTimeModeDataChanged(); }); } -CFDStructDataSolverTimeModeManager::~CFDStructDataSolverTimeModeManager() +CFDStructDataSolverBoundaryConditionManager::~CFDStructDataSolverBoundaryConditionManager() { // CFDStructDataManagerBase::~CFDStructDataManagerBase(); } -CUIConfig *CFDStructDataSolverTimeModeManager::getParamUIConfig() +CUIConfig *CFDStructDataSolverBoundaryConditionManager::getParamUIConfig() { if (m_uiConfig != nullptr) { @@ -37,6 +37,7 @@ CUIConfig *CFDStructDataSolverTimeModeManager::getParamUIConfig() // qDebug() << " unsteady ============"; // } // m_uiConfig->printConfig(); + m_uiConfig = this->genFarFieldModeUIConfig(); return m_uiConfig; } @@ -574,4 +575,4 @@ CUIConfig *CFDStructDataSolverBoundaryConditionManager::genWallHotFlowWallUIConf }), }); return nullptr; -} \ No newline at end of file +} diff --git a/CFDStruct/CFDStructDataManager/CFDStructDataSolverBoundaryConditionManager.h b/CFDStruct/CFDStructDataManager/CFDStructDataSolverBoundaryConditionManager.h index 9d51dc2..250b55f 100644 --- a/CFDStruct/CFDStructDataManager/CFDStructDataSolverBoundaryConditionManager.h +++ b/CFDStruct/CFDStructDataManager/CFDStructDataSolverBoundaryConditionManager.h @@ -1,4 +1,7 @@ -#ifndef CFDSTRUCTDATASOLVERBOUNDARYCONDITIONEMANAGER_H +/** + * 边界条件 + */ +#ifndef CFDSTRUCTDATASOLVERBOUNDARYCONDITIONEMANAGER_H #define CFDSTRUCTDATASOLVERBOUNDARYCONDITIONEMANAGER_H #include diff --git a/CFDStruct/CFDStructDataManager/CFDStructDataSolverComputingControlManager.cpp b/CFDStruct/CFDStructDataManager/CFDStructDataSolverComputingControlManager.cpp index e5be05c..bc85f4e 100644 --- a/CFDStruct/CFDStructDataManager/CFDStructDataSolverComputingControlManager.cpp +++ b/CFDStruct/CFDStructDataManager/CFDStructDataSolverComputingControlManager.cpp @@ -6,7 +6,7 @@ #include #include "CFDStructDataSolverComputingControlManager.h" -CFDStructDataSolverTimeModeManager::CFDStructDataSolverTimeModeManager(QObject *parent) : CFDStructDataManagerBase(parent) +CFDStructDataSolverComputingControlManager::CFDStructDataSolverComputingControlManager(QObject *parent) : CFDStructDataManagerBase(parent) { m_uiConfig = nullptr; connect(m_cuiSigsCenter, &CUISigsCenter::sig_cuiPropertyChanged, this, [=](int semaphore) @@ -15,12 +15,12 @@ CFDStructDataSolverTimeModeManager::CFDStructDataSolverTimeModeManager(QObject * emit CFDStructSigsCenter::getInstance()->sig_solverTimeModeDataChanged(); }); } -CFDStructDataSolverTimeModeManager::~CFDStructDataSolverTimeModeManager() +CFDStructDataSolverComputingControlManager::~CFDStructDataSolverComputingControlManager() { // CFDStructDataManagerBase::~CFDStructDataManagerBase(); } -CUIConfig *CFDStructDataSolverTimeModeManager::getParamUIConfig() +CUIConfig *CFDStructDataSolverComputingControlManager::getParamUIConfig() { if (m_uiConfig != nullptr) { @@ -28,6 +28,7 @@ CUIConfig *CFDStructDataSolverTimeModeManager::getParamUIConfig() m_uiConfig = nullptr; } // m_uiConfig->printConfig(); + m_uiConfig = this->genUIConfig(); return m_uiConfig; } @@ -68,4 +69,4 @@ CUIConfig *CFDStructDataSolverComputingControlManager::genUIConfig() }), }); return nullptr; -} \ No newline at end of file +} diff --git a/CFDStruct/CFDStructDataManager/CFDStructDataSolverComputingControlManager.h b/CFDStruct/CFDStructDataManager/CFDStructDataSolverComputingControlManager.h index 2147453..7967632 100644 --- a/CFDStruct/CFDStructDataManager/CFDStructDataSolverComputingControlManager.h +++ b/CFDStruct/CFDStructDataManager/CFDStructDataSolverComputingControlManager.h @@ -1,4 +1,7 @@ -#ifndef CFDSTRUCTDATASOLVERCOMPUTINGCONTROLMANAGER_H +/** + * 计算控制 + */ +#ifndef CFDSTRUCTDATASOLVERCOMPUTINGCONTROLMANAGER_H #define CFDSTRUCTDATASOLVERCOMPUTINGCONTROLMANAGER_H #include diff --git a/CFDStruct/CFDStructDataManager/CFDStructDataSolverInitializationManager.cpp b/CFDStruct/CFDStructDataManager/CFDStructDataSolverInitializationManager.cpp index 69db404..8fdc5ea 100644 --- a/CFDStruct/CFDStructDataManager/CFDStructDataSolverInitializationManager.cpp +++ b/CFDStruct/CFDStructDataManager/CFDStructDataSolverInitializationManager.cpp @@ -6,7 +6,7 @@ #include #include "CFDStructDataSolverInitializationManager.h" -CFDStructDataSolverTimeModeManager::CFDStructDataSolverTimeModeManager(QObject *parent) : CFDStructDataManagerBase(parent) +CFDStructDataSolverInitializationManager::CFDStructDataSolverInitializationManager(QObject *parent) : CFDStructDataManagerBase(parent) { m_uiConfig = nullptr; connect(m_cuiSigsCenter, &CUISigsCenter::sig_cuiPropertyChanged, this, [ = ](int semaphore) { @@ -15,18 +15,19 @@ CFDStructDataSolverTimeModeManager::CFDStructDataSolverTimeModeManager(QObject * }); } -CFDStructDataSolverTimeModeManager::~CFDStructDataSolverTimeModeManager() +CFDStructDataSolverInitializationManager::~CFDStructDataSolverInitializationManager() { // CFDStructDataManagerBase::~CFDStructDataManagerBase(); } -CUIConfig *CFDStructDataSolverTimeModeManager::getParamUIConfig() +CUIConfig *CFDStructDataSolverInitializationManager::getParamUIConfig() { if (m_uiConfig != nullptr) { delete m_uiConfig; m_uiConfig = nullptr; } // m_uiConfig->printConfig(); + m_uiConfig = this->genUIConfig(); return m_uiConfig; } @@ -74,4 +75,4 @@ CUIConfig *CFDStructDataSolverInitializationManager::genUIConfig() }), }); return nullptr; -} \ No newline at end of file +} diff --git a/CFDStruct/CFDStructDataManager/CFDStructDataSolverInitializationManager.h b/CFDStruct/CFDStructDataManager/CFDStructDataSolverInitializationManager.h index a5e662c..80d761f 100644 --- a/CFDStruct/CFDStructDataManager/CFDStructDataSolverInitializationManager.h +++ b/CFDStruct/CFDStructDataManager/CFDStructDataSolverInitializationManager.h @@ -1,4 +1,7 @@ -#ifndef CFDSTRUCTDATASOLVERINITIALIZATIONEMANAGER_H +/** + * 初始化 + */ +#ifndef CFDSTRUCTDATASOLVERINITIALIZATIONEMANAGER_H #define CFDSTRUCTDATASOLVERINITIALIZATIONEMANAGER_H #include diff --git a/CFDStruct/CFDStructDataManager/CFDStructDataSolverReferenceQuantityManager.cpp b/CFDStruct/CFDStructDataManager/CFDStructDataSolverReferenceQuantityManager.cpp index 569b0e7..0d6cc26 100644 --- a/CFDStruct/CFDStructDataManager/CFDStructDataSolverReferenceQuantityManager.cpp +++ b/CFDStruct/CFDStructDataManager/CFDStructDataSolverReferenceQuantityManager.cpp @@ -6,7 +6,7 @@ #include #include "CFDStructDataSolverReferenceQuantityManager.h" -CFDStructDataSolverTimeModeManager::CFDStructDataSolverTimeModeManager(QObject *parent) : CFDStructDataManagerBase(parent) +CFDStructDataSolverReferenceQuantityManager::CFDStructDataSolverReferenceQuantityManager(QObject *parent) : CFDStructDataManagerBase(parent) { m_uiConfig = nullptr; connect(m_cuiSigsCenter, &CUISigsCenter::sig_cuiPropertyChanged, this, [=](int semaphore) @@ -15,12 +15,12 @@ CFDStructDataSolverTimeModeManager::CFDStructDataSolverTimeModeManager(QObject * emit CFDStructSigsCenter::getInstance()->sig_solverTimeModeDataChanged(); }); } -CFDStructDataSolverTimeModeManager::~CFDStructDataSolverTimeModeManager() +CFDStructDataSolverReferenceQuantityManager::~CFDStructDataSolverReferenceQuantityManager() { // CFDStructDataManagerBase::~CFDStructDataManagerBase(); } -CUIConfig *CFDStructDataSolverTimeModeManager::getParamUIConfig() +CUIConfig *CFDStructDataSolverReferenceQuantityManager::getParamUIConfig() { if (m_uiConfig != nullptr) { @@ -29,6 +29,7 @@ CUIConfig *CFDStructDataSolverTimeModeManager::getParamUIConfig() } // m_uiConfig->printConfig(); + m_uiConfig = this->genUIConfig(); return m_uiConfig; } @@ -76,4 +77,4 @@ CUIConfig *CFDStructDataSolverReferenceQuantityManager::genUIConfig() }), }); return nullptr; -} \ No newline at end of file +} diff --git a/CFDStruct/CFDStructDataManager/CFDStructDataSolverReferenceQuantityManager.h b/CFDStruct/CFDStructDataManager/CFDStructDataSolverReferenceQuantityManager.h index 2a9e6cb..a622417 100644 --- a/CFDStruct/CFDStructDataManager/CFDStructDataSolverReferenceQuantityManager.h +++ b/CFDStruct/CFDStructDataManager/CFDStructDataSolverReferenceQuantityManager.h @@ -1,4 +1,7 @@ -#ifndef CFDSTRUCTDATASOLVERREFERENCEQUANTITYEMANAGER_H +/** + * 参考量 + */ +#ifndef CFDSTRUCTDATASOLVERREFERENCEQUANTITYEMANAGER_H #define CFDSTRUCTDATASOLVERREFERENCEQUANTITYEMANAGER_H #include diff --git a/CFDStruct/CFDStructDataManager/CFDStructDataSolverSportsAttributesManager.cpp b/CFDStruct/CFDStructDataManager/CFDStructDataSolverSportsAttributesManager.cpp index 5ffa1c9..a9a87c3 100644 --- a/CFDStruct/CFDStructDataManager/CFDStructDataSolverSportsAttributesManager.cpp +++ b/CFDStruct/CFDStructDataManager/CFDStructDataSolverSportsAttributesManager.cpp @@ -6,7 +6,7 @@ #include #include "CFDStructDataSolverSportsAttributesManager.h" -CFDStructDataSolverTimeModeManager::CFDStructDataSolverTimeModeManager(QObject *parent) : CFDStructDataManagerBase(parent) +CFDStructDataSolverSportsAttributesManager::CFDStructDataSolverSportsAttributesManager(QObject *parent) : CFDStructDataManagerBase(parent) { m_uiConfig = nullptr; // connect(m_cuiSigsCenter, &CUISigsCenter::sig_cuiPropertyChanged, this, [ = ](int semaphore) { @@ -15,18 +15,19 @@ CFDStructDataSolverTimeModeManager::CFDStructDataSolverTimeModeManager(QObject * // }); } -CFDStructDataSolverTimeModeManager::~CFDStructDataSolverTimeModeManager() +CFDStructDataSolverSportsAttributesManager::~CFDStructDataSolverSportsAttributesManager() { // CFDStructDataManagerBase::~CFDStructDataManagerBase(); } -CUIConfig *CFDStructDataSolverTimeModeManager::getParamUIConfig() +CUIConfig *CFDStructDataSolverSportsAttributesManager::getParamUIConfig() { if (m_uiConfig != nullptr) { delete m_uiConfig; m_uiConfig = nullptr; } + m_uiConfig = this->genMovingFrameModeUIConfig(); return m_uiConfig; } diff --git a/CFDStruct/CFDStructMain/CFDTreeWidget.cpp b/CFDStruct/CFDStructMain/CFDTreeWidget.cpp index 8314915..b3ff2b1 100644 --- a/CFDStruct/CFDStructMain/CFDTreeWidget.cpp +++ b/CFDStruct/CFDStructMain/CFDTreeWidget.cpp @@ -5,8 +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" #include "FITK_Kernel/FITKAppFramework/FITKGlobalData.h" @@ -24,7 +23,6 @@ #include "FITK_Interface/FITKInterfaceMeshGen/FITKGeometryMeshSize.h" #include "FITK_Interface/FITKInterfaceMesh/FITKUnstructuredFluidMeshVTK.h" - #include #include #include @@ -35,25 +33,29 @@ namespace GUI { - CFDTreeWidget::CFDTreeWidget(QWidget* parent, PropertyWidget* m_PropertyWidget): - TreeWidget(parent) + CFDTreeWidget::CFDTreeWidget(QWidget *parent, PropertyWidget *m_PropertyWidget) : TreeWidget(parent) { this->m_PropertyWidget = m_PropertyWidget; - //右键 不可少否则右键无反应 + // 右键 不可少否则右键无反应 setContextMenuPolicy(Qt::CustomContextMenu); - disconnect(this, SIGNAL(itemClicked(QTreeWidgetItem*, int)), nullptr, nullptr); - connect(this, SIGNAL(itemClicked(QTreeWidgetItem*, int)), this, SLOT(onItemClicked(QTreeWidgetItem*, int))); + disconnect(this, SIGNAL(itemClicked(QTreeWidgetItem *, int)), nullptr, nullptr); + connect(this, SIGNAL(itemClicked(QTreeWidgetItem *, int)), this, SLOT(onItemClicked(QTreeWidgetItem *, int))); connect(this, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(onModelCustomContextMenu(QPoint))); } void CFDTreeWidget::updateTree(QString s) { this->clear(); - if (s == "SolutionAnalysis") { + if (s == "SolutionAnalysis") + { addTreeSolutionAnalysis(); - } else if (s == "Postprocessing") { + } + else if (s == "Postprocessing") + { addTreePostprocessing(); - } else if (s == "Preprocessing") { + } + else if (s == "Preprocessing") + { addTreePreprocessing(); } setItemsExpandable(true); @@ -62,110 +64,111 @@ namespace GUI void CFDTreeWidget::addTreePreprocessing() { - QTreeWidgetItem* GeometryAndMeshingItem = new QTreeWidgetItem(); + QTreeWidgetItem *GeometryAndMeshingItem = new QTreeWidgetItem(); GeometryAndMeshingItem->setText(0, tr("Preprocessing")); GeometryAndMeshingItem->setData(1, 0, -1); -// GeometryAndMeshingItem->setData(2, 0, QVariant::fromValue(SolutionAnalysisTreeEnum::SATree_GeometryandMeshing)); + // GeometryAndMeshingItem->setData(2, 0, QVariant::fromValue(SolutionAnalysisTreeEnum::SATree_GeometryandMeshing)); this->addTopLevelItem(GeometryAndMeshingItem); } void CFDTreeWidget::addTreeSolutionAnalysis() { - QTreeWidgetItem* GeometryAndMeshingItem = new QTreeWidgetItem(); + QTreeWidgetItem *GeometryAndMeshingItem = new QTreeWidgetItem(); GeometryAndMeshingItem->setText(0, tr("Geometry and Meshing")); GeometryAndMeshingItem->setData(1, 0, -1); GeometryAndMeshingItem->setData(2, 0, QVariant::fromValue(SolutionAnalysisTreeEnum::SATree_GeometryandMeshing)); this->addTopLevelItem(GeometryAndMeshingItem); - QTreeWidgetItem* mesh = new QTreeWidgetItem(); + QTreeWidgetItem *mesh = new QTreeWidgetItem(); mesh->setText(0, tr("Mesh001")); mesh->setData(1, 0, -1); -// mesh->setdata(2,0,QVariant::fromValue(SolutionAnalysisTreeEnum::)) + // mesh->setdata(2,0,QVariant::fromValue(SolutionAnalysisTreeEnum::)) GeometryAndMeshingItem->addChild(mesh); - QTreeWidgetItem* ComputationalSetupItem = new QTreeWidgetItem(); + QTreeWidgetItem *ComputationalSetupItem = new QTreeWidgetItem(); ComputationalSetupItem->setText(0, tr("Computational Setup")); ComputationalSetupItem->setData(1, 0, -1); ComputationalSetupItem->setData(2, 0, QVariant::fromValue(SolutionAnalysisTreeEnum::SATree_ComputationalSetup)); this->addTopLevelItem(ComputationalSetupItem); - QTreeWidgetItem* TimeModeItem = new QTreeWidgetItem(); + QTreeWidgetItem *TimeModeItem = new QTreeWidgetItem(); TimeModeItem->setText(0, tr("Time Mode")); TimeModeItem->setData(1, 0, -1); TimeModeItem->setData(2, 0, QVariant::fromValue(SolutionAnalysisTreeEnum::SATree_ComputationalSetupTimeMode)); ComputationalSetupItem->addChild(TimeModeItem); - QTreeWidgetItem* ComputationalDomainItem = new QTreeWidgetItem(); + QTreeWidgetItem *ComputationalDomainItem = new QTreeWidgetItem(); ComputationalDomainItem->setText(0, tr("Computational Domain")); ComputationalDomainItem->setData(1, 0, -1); ComputationalDomainItem->setData(2, 0, QVariant::fromValue(SolutionAnalysisTreeEnum::SATree_ComputationalSetupComputationalDomain)); ComputationalSetupItem->addChild(ComputationalDomainItem); - QTreeWidgetItem* SolverItem = new QTreeWidgetItem(); + QTreeWidgetItem *SolverItem = new QTreeWidgetItem(); SolverItem->setText(0, tr("Solver")); SolverItem->setData(1, 0, -1); SolverItem->setData(2, 0, QVariant::fromValue(SolutionAnalysisTreeEnum::SATree_ComputationalSetupComputationalDomainSolver)); ComputationalDomainItem->addChild(SolverItem); - QTreeWidgetItem* BasicModelItem = new QTreeWidgetItem(); + QTreeWidgetItem *BasicModelItem = new QTreeWidgetItem(); BasicModelItem->setText(0, tr("Basic Model")); BasicModelItem->setData(1, 0, -1); BasicModelItem->setData(2, 0, QVariant::fromValue(SolutionAnalysisTreeEnum::SATree_ComputationalSetupComputationalDomainSolverBasicModel)); SolverItem->addChild(BasicModelItem); - QTreeWidgetItem* ViscosityModelItem = new QTreeWidgetItem(); + QTreeWidgetItem *ViscosityModelItem = new QTreeWidgetItem(); ViscosityModelItem->setText(0, tr("Viscosity Model")); ViscosityModelItem->setData(1, 0, -1); ViscosityModelItem->setData(2, 0, QVariant::fromValue(SolutionAnalysisTreeEnum::SATree_ComputationalSetupComputationalDomainSolverViscosityModel)); SolverItem->addChild(ViscosityModelItem); - QTreeWidgetItem* NumericalMethodsItem = new QTreeWidgetItem(); + QTreeWidgetItem *NumericalMethodsItem = new QTreeWidgetItem(); NumericalMethodsItem->setText(0, tr("Numerical Methods")); NumericalMethodsItem->setData(1, 0, -1); NumericalMethodsItem->setData(2, 0, QVariant::fromValue(SolutionAnalysisTreeEnum::SATree_ComputationalSetupComputationalDomainSolverNumericalMethods)); SolverItem->addChild(NumericalMethodsItem); - QTreeWidgetItem* MotionPropertiesItem = new QTreeWidgetItem(); + QTreeWidgetItem *MotionPropertiesItem = new QTreeWidgetItem(); + //--------------------------------------------------------------------------------------------- MotionPropertiesItem->setText(0, tr("Motion Properties")); MotionPropertiesItem->setData(1, 0, -1); MotionPropertiesItem->setData(2, 0, QVariant::fromValue(SolutionAnalysisTreeEnum::SATree_ComputationalSetupComputationalDomainSolverMotionProperties)); ComputationalDomainItem->addChild(MotionPropertiesItem); - QTreeWidgetItem* motion1Item = new QTreeWidgetItem(); + QTreeWidgetItem *motion1Item = new QTreeWidgetItem(); motion1Item->setText(0, tr("motion-1")); motion1Item->setData(1, 0, -1); MotionPropertiesItem->addChild(motion1Item); - QTreeWidgetItem* BoundaryConditionsItem = new QTreeWidgetItem(); + QTreeWidgetItem *BoundaryConditionsItem = new QTreeWidgetItem(); BoundaryConditionsItem->setText(0, tr("Boundary Conditions")); BoundaryConditionsItem->setData(1, 0, -1); BoundaryConditionsItem->setData(2, 0, QVariant::fromValue(SolutionAnalysisTreeEnum::SATree_ComputationalSetupComputationalDomainSolverBoundaryConditions)); ComputationalDomainItem->addChild(BoundaryConditionsItem); - QTreeWidgetItem* pressureinletItem = new QTreeWidgetItem(); + QTreeWidgetItem *pressureinletItem = new QTreeWidgetItem(); pressureinletItem->setText(0, tr("Pressure-Inlet")); pressureinletItem->setData(1, 0, -1); pressureinletItem->setData(2, 0, QVariant::fromValue(SolutionAnalysisTreeEnum::SATree_ComputationalSetupComputationalDomainSolverBoundaryConditionsPressureInlet)); BoundaryConditionsItem->addChild(pressureinletItem); - QTreeWidgetItem* InitializationItem = new QTreeWidgetItem(); + QTreeWidgetItem *InitializationItem = new QTreeWidgetItem(); InitializationItem->setText(0, tr("Initialization")); InitializationItem->setData(1, 0, -1); InitializationItem->setData(2, 0, QVariant::fromValue(SolutionAnalysisTreeEnum::SATree_ComputationalSetupComputationalDomainSolverInitialization)); ComputationalDomainItem->addChild(InitializationItem); - QTreeWidgetItem* ComputationalControlItem = new QTreeWidgetItem(); + QTreeWidgetItem *ReferenceQuantityItem = new QTreeWidgetItem(); + ReferenceQuantityItem->setText(0, tr("Reference Quantity")); + ReferenceQuantityItem->setData(1, 0, -1); + ReferenceQuantityItem->setData(2, 0, QVariant::fromValue(SolutionAnalysisTreeEnum::SATree_ComputationalSetupComputationalDomainSolverComputationalControlReferenceQuantity)); + InitializationItem->addChild(ReferenceQuantityItem); + QTreeWidgetItem *ComputationalControlItem = new QTreeWidgetItem(); ComputationalControlItem->setText(0, tr("Computational Control")); ComputationalControlItem->setData(1, 0, -1); ComputationalControlItem->setData(2, 0, QVariant::fromValue(SolutionAnalysisTreeEnum::SATree_ComputationalSetupComputationalDomainSolverComputationalControl)); ComputationalDomainItem->addChild(ComputationalControlItem); - QTreeWidgetItem* ReferenceQuantityItem = new QTreeWidgetItem(); - ReferenceQuantityItem->setText(0, tr("Reference Quantity")); - ReferenceQuantityItem->setData(1, 0, -1); - ReferenceQuantityItem->setData(2, 0, QVariant::fromValue(SolutionAnalysisTreeEnum::SATree_ComputationalSetupComputationalDomainSolverComputationalControlReferenceQuantity)); - ComputationalControlItem->addChild(ReferenceQuantityItem); - QTreeWidgetItem* MonitorsItem = new QTreeWidgetItem(); + QTreeWidgetItem *MonitorsItem = new QTreeWidgetItem(); MonitorsItem->setText(0, tr("Monitors")); MonitorsItem->setData(1, 0, -1); MonitorsItem->setData(2, 0, QVariant::fromValue(SolutionAnalysisTreeEnum::SATree_ComputationalSetupComputationalDomainSolverMonitors)); ComputationalDomainItem->addChild(MonitorsItem); - QTreeWidgetItem* ResidualItem = new QTreeWidgetItem(); + QTreeWidgetItem *ResidualItem = new QTreeWidgetItem(); ResidualItem->setText(0, tr("Residual")); ResidualItem->setData(1, 0, -1); ResidualItem->setData(2, 0, QVariant::fromValue(SolutionAnalysisTreeEnum::SATree_ComputationalSetupComputationalDomainSolverMonitorsResidual)); MonitorsItem->addChild(ResidualItem); - QTreeWidgetItem* AerodynamicForceItem = new QTreeWidgetItem(); + QTreeWidgetItem *AerodynamicForceItem = new QTreeWidgetItem(); AerodynamicForceItem->setText(0, tr("Aerodynamic Force")); AerodynamicForceItem->setData(1, 0, -1); AerodynamicForceItem->setData(2, 0, QVariant::fromValue(SolutionAnalysisTreeEnum::SATree_ComputationalSetupComputationalDomainSolverMonitorsAerodynamicForce)); MonitorsItem->addChild(AerodynamicForceItem); - QTreeWidgetItem* TurbomachineryPerformanceItem = new QTreeWidgetItem(); + QTreeWidgetItem *TurbomachineryPerformanceItem = new QTreeWidgetItem(); TurbomachineryPerformanceItem->setText(0, tr("Turbomachinery Performance")); TurbomachineryPerformanceItem->setData(1, 0, -1); TurbomachineryPerformanceItem->setData(2, 0, QVariant::fromValue(SolutionAnalysisTreeEnum::SATree_ComputationalSetupComputationalDomainSolverMonitorsTurbomachineryPerformance)); @@ -174,42 +177,42 @@ namespace GUI void CFDTreeWidget::addTreePostprocessing() { -// _treePostprocessing = new TreeWidget(this); -// tabWidget->addTab(_treePostprocessing,tr("Postprocessing")); -// qDebug()<<"!!!"; - QTreeWidgetItem* PostProcessingItem = new QTreeWidgetItem(); + // _treePostprocessing = new TreeWidget(this); + // tabWidget->addTab(_treePostprocessing,tr("Postprocessing")); + // qDebug()<<"!!!"; + QTreeWidgetItem *PostProcessingItem = new QTreeWidgetItem(); PostProcessingItem->setText(0, tr("Post-processing")); PostProcessingItem->setData(1, 0, -1); this->addTopLevelItem(PostProcessingItem); - QTreeWidgetItem* MeshItem = new QTreeWidgetItem(); + QTreeWidgetItem *MeshItem = new QTreeWidgetItem(); MeshItem->setText(0, tr("Mesh")); MeshItem->setData(1, 0, -1); PostProcessingItem->addChild(MeshItem); - QTreeWidgetItem* Mesh1Item = new QTreeWidgetItem(); + QTreeWidgetItem *Mesh1Item = new QTreeWidgetItem(); Mesh1Item->setText(0, tr("Mesh 1")); Mesh1Item->setData(1, 0, -1); MeshItem->addChild(Mesh1Item); - QTreeWidgetItem* Interface1Item = new QTreeWidgetItem(); + QTreeWidgetItem *Interface1Item = new QTreeWidgetItem(); Interface1Item->setText(0, tr("Interface 1")); Interface1Item->setData(1, 0, -1); MeshItem->addChild(Interface1Item); - QTreeWidgetItem* CuttingPlaneItem = new QTreeWidgetItem(); + QTreeWidgetItem *CuttingPlaneItem = new QTreeWidgetItem(); CuttingPlaneItem->setText(0, tr("Cutting Plane")); CuttingPlaneItem->setData(1, 0, -1); PostProcessingItem->addChild(CuttingPlaneItem); - QTreeWidgetItem* IsosurfaceItem = new QTreeWidgetItem(); + QTreeWidgetItem *IsosurfaceItem = new QTreeWidgetItem(); IsosurfaceItem->setText(0, tr("Isosurface")); IsosurfaceItem->setData(1, 0, -1); PostProcessingItem->addChild(IsosurfaceItem); - QTreeWidgetItem* StreamlineItem = new QTreeWidgetItem(); + QTreeWidgetItem *StreamlineItem = new QTreeWidgetItem(); StreamlineItem->setText(0, tr("Streamline")); StreamlineItem->setData(1, 0, -1); PostProcessingItem->addChild(StreamlineItem); - QTreeWidgetItem* DataStatisticsItem = new QTreeWidgetItem(); + QTreeWidgetItem *DataStatisticsItem = new QTreeWidgetItem(); DataStatisticsItem->setText(0, tr("Data Statistics")); DataStatisticsItem->setData(1, 0, -1); PostProcessingItem->addChild(DataStatisticsItem); - QTreeWidgetItem* ForceAndMomentItem = new QTreeWidgetItem(); + QTreeWidgetItem *ForceAndMomentItem = new QTreeWidgetItem(); ForceAndMomentItem->setText(0, tr("Force and Moment")); ForceAndMomentItem->setData(1, 0, -1); DataStatisticsItem->addChild(ForceAndMomentItem); @@ -217,54 +220,83 @@ namespace GUI void CFDTreeWidget::onItemClicked(QTreeWidgetItem *item, int column) { - EventOper::TreeEventOperator* treeOper = Core::FITKOperatorRepo::getInstance()->getOperatorT("ModelTreeEvent"); - if (treeOper == nullptr) { + EventOper::TreeEventOperator *treeOper = Core::FITKOperatorRepo::getInstance()->getOperatorT("ModelTreeEvent"); + if (treeOper == nullptr) + { return; } - EventOper::GraphEventOperator* graphOper = FITKOPERREPO->getOperatorT("GraphPreprocess"); - if (graphOper == nullptr) { + EventOper::GraphEventOperator *graphOper = FITKOPERREPO->getOperatorT("GraphPreprocess"); + if (graphOper == nullptr) + { return; } graphOper->clearHighlight(); - if (item == nullptr) { + if (item == nullptr) + { return; } int objID = item->data(1, 0).toInt(); SolutionAnalysisTreeEnum treeType = item->data(2, 0).value(); Interface::FITKGeoEnum::FITKGeometryComType geometryType = item->data(3, 0).value(); QString name = ""; - switch (treeType) { - case SolutionAnalysisTreeEnum::SATree_ComputationalSetupTimeMode: - name = "actionTimeModeEdit"; - break; - case SolutionAnalysisTreeEnum::SATree_ComputationalSetupComputationalDomainSolverBasicModel: - name = "actionBasicModelEdit"; - break; - case SolutionAnalysisTreeEnum::SATree_ComputationalSetupComputationalDomainSolverViscosityModel: - name = "actionViscosityModelEdit"; - break; - case SolutionAnalysisTreeEnum::SATree_ComputationalSetupComputationalDomainSolverNumericalMethods: - name = "actionNumericalMethodsEdit"; - break; - default: - name = ""; + switch (treeType) + { + case SolutionAnalysisTreeEnum::SATree_ComputationalSetupTimeMode: + name = "actionTimeModeEdit"; + break; + case SolutionAnalysisTreeEnum::SATree_ComputationalSetupComputationalDomainSolverBasicModel: + name = "actionBasicModelEdit"; + break; + case SolutionAnalysisTreeEnum::SATree_ComputationalSetupComputationalDomainSolverViscosityModel: + name = "actionViscosityModelEdit"; + break; + case SolutionAnalysisTreeEnum::SATree_ComputationalSetupComputationalDomainSolverNumericalMethods: + name = "actionNumericalMethodsEdit"; + break; + //--------------------------------------------------------------------------------------- + // 运动属性 + case SolutionAnalysisTreeEnum::SATree_ComputationalSetupComputationalDomainSolverMotionProperties: + name = "actionMotionPropertiesEdit"; + break; + // Pressure-Inlet + case SolutionAnalysisTreeEnum::SATree_ComputationalSetupComputationalDomainSolverBoundaryConditionsPressureInlet: + name = "actionPressureInletEdit"; + break; + // 初始化 + case SolutionAnalysisTreeEnum::SATree_ComputationalSetupComputationalDomainSolverInitialization: + name = "actionInitializationEdit"; + break; + // 参考量 + case SolutionAnalysisTreeEnum::SATree_ComputationalSetupComputationalDomainSolverComputationalControlReferenceQuantity: + name = "actionReferenceQuantityEdit"; + break; + // 计算控制 + case SolutionAnalysisTreeEnum::SATree_ComputationalSetupComputationalDomainSolverComputationalControl: + name = "actionComputationalControlEdit"; + break; + + default: + name = ""; } qDebug() << name; - if (!name.isEmpty()) { + if (!name.isEmpty()) + { QObject sender; sender.setObjectName(name); auto acOper = Core::FITKOperatorRepo::getInstance()->getOperatorT(name); - if (acOper == nullptr) { + if (acOper == nullptr) + { qDebug("acOper is nullptr"); return; } acOper->setEmitter(&sender); acOper->setArgs("objID", objID); acOper->actionTriggered(); - } else { + } + else + { treeOper->moveProcessToStep(0); } } - } diff --git a/CFDStruct/CFDStructOperatorsModel/CFDStructOperatorsTimeModeManager.h b/CFDStruct/CFDStructOperatorsModel/CFDStructOperatorsTimeModeManager.h index 85c823f..c88bc1f 100644 --- a/CFDStruct/CFDStructOperatorsModel/CFDStructOperatorsTimeModeManager.h +++ b/CFDStruct/CFDStructOperatorsModel/CFDStructOperatorsTimeModeManager.h @@ -38,6 +38,16 @@ namespace ModelOper Register2FITKOPeratorRepo(actionBasicModelEdit, CFDStructOperatorsTimeModeManager); Register2FITKOPeratorRepo(actionViscosityModelEdit, CFDStructOperatorsTimeModeManager); Register2FITKOPeratorRepo(actionNumericalMethodsEdit, CFDStructOperatorsTimeModeManager); + //运动属性 + Register2FITKOPeratorRepo(actionMotionPropertiesEdit, CFDStructOperatorsTimeModeManager); + //Pressure-Inlet + Register2FITKOPeratorRepo(actionPressureInletEdit, CFDStructOperatorsTimeModeManager); + //初始化 + Register2FITKOPeratorRepo(actionInitializationEdit, CFDStructOperatorsTimeModeManager); + //参考量 + Register2FITKOPeratorRepo(actionReferenceQuantityEdit, CFDStructOperatorsTimeModeManager); + //计算控制 + Register2FITKOPeratorRepo(actionComputationalControlEdit, CFDStructOperatorsTimeModeManager); } #endif