From 84b1ce0bf3255145770546e48e18c8b1bce88910 Mon Sep 17 00:00:00 2001 From: mzh Date: Thu, 7 Nov 2024 17:15:28 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E5=B0=86saveDataToDom=E5=92=8CreadDa?= =?UTF-8?q?taFromDom=E5=87=BD=E6=95=B0=E6=94=B9=E4=B8=BA=E7=BA=AF=E8=99=9A?= =?UTF-8?q?=E5=87=BD=E6=95=B0=202=E3=80=81=E5=AE=9E=E7=8E=B0=E5=90=84?= =?UTF-8?q?=E4=B8=AA=E7=BB=A7=E6=89=BFbase=E7=9A=84=E7=B1=BB=203=E3=80=81?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=BF=90=E5=8A=A8=E5=B1=9E=E6=80=A7=E5=A4=87?= =?UTF-8?q?=E6=B3=A8-----=E8=BF=90=E5=8A=A8=E5=8C=BA=E5=9F=9F=E7=9B=B8?= =?UTF-8?q?=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ructDataSolverBoundaryConditionManager.cpp | 119 +++---- ...StructDataSolverBoundaryConditionManager.h | 23 +- ...DStructDataSolverInitializationManager.cpp | 335 +++++++++--------- ...CFDStructDataSolverInitializationManager.h | 1 + ...tructDataSolverSportsAttributesManager.cpp | 5 + ...DStructDataSolverSportsAttributesManager.h | 7 + Resources/case-01.json | 2 +- 7 files changed, 234 insertions(+), 258 deletions(-) diff --git a/CFDStruct/CFDStructDataManager/CFDStructDataSolverBoundaryConditionManager.cpp b/CFDStruct/CFDStructDataManager/CFDStructDataSolverBoundaryConditionManager.cpp index c1bd677..a8bf7c5 100644 --- a/CFDStruct/CFDStructDataManager/CFDStructDataSolverBoundaryConditionManager.cpp +++ b/CFDStruct/CFDStructDataManager/CFDStructDataSolverBoundaryConditionManager.cpp @@ -1,35 +1,29 @@ +#include "CFDStructDataSolverBoundaryConditionManager.h" #include "CFDStructDataSolverTimeModeManager.h" -#include "CUIProperty/CUIConfig.h" #include "CFDStructMain/CFDStructDefine.h" #include "CFDStructSigsCenter.h" +#include "CUIProperty/CUIConfig.h" #include "CUIProperty/CUISigsCenter.h" #include -#include "CFDStructDataSolverBoundaryConditionManager.h" -CFDStructDataSolverBoundaryConditionManager::CFDStructDataSolverBoundaryConditionManager(QObject *parent) : CFDStructDataManagerBase(parent) -{ +CFDStructDataSolverBoundaryConditionManager::CFDStructDataSolverBoundaryConditionManager(QObject *parent) : CFDStructDataManagerBase(parent) { m_uiConfig = nullptr; - connect(m_cuiSigsCenter, &CUISigsCenter::sig_cuiPropertyChanged, this, [=](int semaphore) - { emit CFDStructSigsCenter::getInstance() -> sig_solverTimeModeDataChanged(); }); + connect(m_cuiSigsCenter, &CUISigsCenter::sig_cuiPropertyChanged, this, [=](int semaphore) { emit CFDStructSigsCenter::getInstance() -> sig_solverTimeModeDataChanged(); }); } -CFDStructDataSolverBoundaryConditionManager::~CFDStructDataSolverBoundaryConditionManager() -{ +CFDStructDataSolverBoundaryConditionManager::~CFDStructDataSolverBoundaryConditionManager() { // CFDStructDataManagerBase::~CFDStructDataManagerBase(); } -CUIConfig *CFDStructDataSolverBoundaryConditionManager::getParamUIConfig() -{ - if (m_uiConfig != nullptr) - { +CUIConfig *CFDStructDataSolverBoundaryConditionManager::getParamUIConfig() { + if (m_uiConfig != nullptr) { delete m_uiConfig; m_uiConfig = nullptr; } qDebug() << "in manager " << m_BoundaryType; - if (m_BoundaryType == 0) - { + if (m_BoundaryType == 0) { qDebug() << "walltype is :" << m_WallType; if (m_WallType == 0) return genWallAdiabaticWallUIConfig(); @@ -43,35 +37,26 @@ CUIConfig *CFDStructDataSolverBoundaryConditionManager::getParamUIConfig() if (m_BoundaryType == 1) return genFarFieldModeUIConfig(); - if (m_BoundaryType == 2) - { - if (m_BoundaryType_sub == 0) - { - if (m_VelocityDirectionType == 0) - { + if (m_BoundaryType == 2) { + if (m_BoundaryType_sub == 0) { + if (m_VelocityDirectionType == 0) { return genPressureInletModeSupersonicCylindricalUIConfig(); } - if (m_VelocityDirectionType == 1) - { + if (m_VelocityDirectionType == 1) { return genPressureInletModeSupersonicCartesianUIConfig(); } - if (m_VelocityDirectionType == 2) - { + if (m_VelocityDirectionType == 2) { return genPressureInletModeSupersonicSurfaceUIConfig(); } } - if (m_BoundaryType_sub == 1) - { - if (m_VelocityDirectionType == 0) - { + if (m_BoundaryType_sub == 1) { + if (m_VelocityDirectionType == 0) { return genPressureInletModeSubsonicCylindricalUIConfig(); } - if (m_VelocityDirectionType == 1) - { + if (m_VelocityDirectionType == 1) { return genPressureInletModeSubsonicCartesianUIConfig(); } - if (m_VelocityDirectionType == 2) - { + if (m_VelocityDirectionType == 2) { return genPressureInletModeSubsonicSurfaceUIConfig(); } } @@ -80,38 +65,36 @@ CUIConfig *CFDStructDataSolverBoundaryConditionManager::getParamUIConfig() return genPressureOutletUIConfig(); if (m_BoundaryType == 4) return genSymmetricUIConfig(); - if (m_BoundaryType == 5) - { + if (m_BoundaryType == 5) { return genSupersonicOutlet_ExtrapolateUIConfig(); } - if (m_BoundaryType == 6) - { + if (m_BoundaryType == 6) { return genMeshInterfaceUIConfig(); } - if (m_BoundaryType == 7) - { + if (m_BoundaryType == 7) { if (m_PeriodicType == 0) return genCycleTranslationUIConfig(); if (m_PeriodicType == 1) return genCycleRotationUIConfig(); return genCycleTranslationUIConfig(); } - if (m_BoundaryType == 8) - { + if (m_BoundaryType == 8) { return genMassFlowOutletUIConfig(); } return m_uiConfig; } -void CFDStructDataSolverBoundaryConditionManager::saveDataToDom(rapidjson::Document &dom) -{ +void CFDStructDataSolverBoundaryConditionManager::saveDataToDom(rapidjson::Document &dom) { + // TODO +} +void CFDStructDataSolverBoundaryConditionManager::readDataFromDom(rapidjson::Document &dom) { + // TODO } -CUIConfig *CFDStructDataSolverBoundaryConditionManager::genFarFieldModeUIConfig() -{ +CUIConfig *CFDStructDataSolverBoundaryConditionManager::genFarFieldModeUIConfig() { return new CUIConfig({{"type", "Widget"}}, { new CUIConfig({ @@ -233,8 +216,7 @@ CUIConfig *CFDStructDataSolverBoundaryConditionManager::genFarFieldModeUIConfig( return nullptr; } -CUIConfig *CFDStructDataSolverBoundaryConditionManager::genPressureInletModeSupersonicCylindricalUIConfig() -{ +CUIConfig *CFDStructDataSolverBoundaryConditionManager::genPressureInletModeSupersonicCylindricalUIConfig() { return new CUIConfig({{"type", "Widget"}}, { new CUIConfig({ {"type", "LineEdit"}, // 边界名称 @@ -381,8 +363,7 @@ CUIConfig *CFDStructDataSolverBoundaryConditionManager::genPressureInletModeSupe }); } -CUIConfig *CFDStructDataSolverBoundaryConditionManager::genPressureInletModeSupersonicCartesianUIConfig() -{ +CUIConfig *CFDStructDataSolverBoundaryConditionManager::genPressureInletModeSupersonicCartesianUIConfig() { return new CUIConfig({{"type", "Widget"}}, { new CUIConfig({ {"type", "LineEdit"}, // 边界名称 @@ -529,8 +510,7 @@ CUIConfig *CFDStructDataSolverBoundaryConditionManager::genPressureInletModeSupe }); } -CUIConfig *CFDStructDataSolverBoundaryConditionManager::genPressureInletModeSupersonicSurfaceUIConfig() -{ +CUIConfig *CFDStructDataSolverBoundaryConditionManager::genPressureInletModeSupersonicSurfaceUIConfig() { return new CUIConfig({{"type", "Widget"}}, { new CUIConfig({ {"type", "LineEdit"}, // 边界名称 @@ -670,8 +650,7 @@ CUIConfig *CFDStructDataSolverBoundaryConditionManager::genPressureInletModeSupe }); } -CUIConfig *CFDStructDataSolverBoundaryConditionManager::genPressureInletModeSubsonicCylindricalUIConfig() -{ +CUIConfig *CFDStructDataSolverBoundaryConditionManager::genPressureInletModeSubsonicCylindricalUIConfig() { return new CUIConfig({{"type", "Widget"}}, { new CUIConfig({ {"type", "LineEdit"}, // 边界名称 @@ -812,8 +791,7 @@ CUIConfig *CFDStructDataSolverBoundaryConditionManager::genPressureInletModeSubs return nullptr; } -CUIConfig *CFDStructDataSolverBoundaryConditionManager::genPressureInletModeSubsonicCartesianUIConfig() -{ +CUIConfig *CFDStructDataSolverBoundaryConditionManager::genPressureInletModeSubsonicCartesianUIConfig() { return new CUIConfig({{"type", "Widget"}}, { new CUIConfig({ {"type", "LineEdit"}, // 边界名称 @@ -953,8 +931,7 @@ CUIConfig *CFDStructDataSolverBoundaryConditionManager::genPressureInletModeSubs }); } -CUIConfig *CFDStructDataSolverBoundaryConditionManager::genPressureInletModeSubsonicSurfaceUIConfig() -{ +CUIConfig *CFDStructDataSolverBoundaryConditionManager::genPressureInletModeSubsonicSurfaceUIConfig() { return new CUIConfig({{"type", "Widget"}}, { new CUIConfig({ {"type", "LineEdit"}, // 边界名称 @@ -1087,8 +1064,7 @@ CUIConfig *CFDStructDataSolverBoundaryConditionManager::genPressureInletModeSubs }); } -CUIConfig *CFDStructDataSolverBoundaryConditionManager::genPressureOutletUIConfig() -{ +CUIConfig *CFDStructDataSolverBoundaryConditionManager::genPressureOutletUIConfig() { return new CUIConfig({{"type", "Widget"}}, { new CUIConfig({ {"type", "LineEdit"}, // 边界名称 @@ -1188,8 +1164,7 @@ CUIConfig *CFDStructDataSolverBoundaryConditionManager::genPressureOutletUIConfi return nullptr; } -CUIConfig *CFDStructDataSolverBoundaryConditionManager::genSymmetricUIConfig() -{ +CUIConfig *CFDStructDataSolverBoundaryConditionManager::genSymmetricUIConfig() { return new CUIConfig({{"type", "Widget"}}, { new CUIConfig({ {"type", "LineEdit"}, // 边界名称 @@ -1256,8 +1231,7 @@ CUIConfig *CFDStructDataSolverBoundaryConditionManager::genSymmetricUIConfig() return nullptr; } -CUIConfig *CFDStructDataSolverBoundaryConditionManager::genSupersonicOutlet_ExtrapolateUIConfig() -{ +CUIConfig *CFDStructDataSolverBoundaryConditionManager::genSupersonicOutlet_ExtrapolateUIConfig() { return new CUIConfig({{"type", "Widget"}}, { new CUIConfig({ {"type", "LineEdit"}, // 边界名称 @@ -1323,8 +1297,7 @@ CUIConfig *CFDStructDataSolverBoundaryConditionManager::genSupersonicOutlet_Extr }); } -CUIConfig *CFDStructDataSolverBoundaryConditionManager::genMeshInterfaceUIConfig() -{ +CUIConfig *CFDStructDataSolverBoundaryConditionManager::genMeshInterfaceUIConfig() { return new CUIConfig({{"type", "Widget"}}, { new CUIConfig({ {"type", "LineEdit"}, // 边界名称 @@ -1407,8 +1380,7 @@ CUIConfig *CFDStructDataSolverBoundaryConditionManager::genMeshInterfaceUIConfig }); } -CUIConfig *CFDStructDataSolverBoundaryConditionManager::genCycleTranslationUIConfig() -{ +CUIConfig *CFDStructDataSolverBoundaryConditionManager::genCycleTranslationUIConfig() { return new CUIConfig({{"type", "Widget"}}, { new CUIConfig({ {"type", "LineEdit"}, // 边界名称 @@ -1513,8 +1485,7 @@ CUIConfig *CFDStructDataSolverBoundaryConditionManager::genCycleTranslationUICon return nullptr; } -CUIConfig *CFDStructDataSolverBoundaryConditionManager::genCycleRotationUIConfig() -{ +CUIConfig *CFDStructDataSolverBoundaryConditionManager::genCycleRotationUIConfig() { return new CUIConfig({{"type", "Widget"}}, { new CUIConfig({ {"type", "LineEdit"}, // 边界名称 @@ -1633,8 +1604,7 @@ CUIConfig *CFDStructDataSolverBoundaryConditionManager::genCycleRotationUIConfig return nullptr; } -CUIConfig *CFDStructDataSolverBoundaryConditionManager::genMassFlowOutletUIConfig() -{ +CUIConfig *CFDStructDataSolverBoundaryConditionManager::genMassFlowOutletUIConfig() { return new CUIConfig({{"type", "Widget"}}, { new CUIConfig({ {"type", "LineEdit"}, // 边界名称 @@ -1737,8 +1707,7 @@ CUIConfig *CFDStructDataSolverBoundaryConditionManager::genMassFlowOutletUIConfi }); } -CUIConfig *CFDStructDataSolverBoundaryConditionManager::genWallAdiabaticWallUIConfig() -{ +CUIConfig *CFDStructDataSolverBoundaryConditionManager::genWallAdiabaticWallUIConfig() { return new CUIConfig({{"type", "Widget"}}, { new CUIConfig({ {"type", "LineEdit"}, // 边界名称 @@ -1847,8 +1816,7 @@ CUIConfig *CFDStructDataSolverBoundaryConditionManager::genWallAdiabaticWallUICo return nullptr; } -CUIConfig *CFDStructDataSolverBoundaryConditionManager::genWallIsothermalWallUIConfig() -{ +CUIConfig *CFDStructDataSolverBoundaryConditionManager::genWallIsothermalWallUIConfig() { return new CUIConfig({{"type", "Widget"}}, { new CUIConfig({ {"type", "LineEdit"}, // 边界名称 @@ -1963,8 +1931,7 @@ CUIConfig *CFDStructDataSolverBoundaryConditionManager::genWallIsothermalWallUIC return nullptr; } -CUIConfig *CFDStructDataSolverBoundaryConditionManager::genWallHotFlowWallUIConfig() -{ +CUIConfig *CFDStructDataSolverBoundaryConditionManager::genWallHotFlowWallUIConfig() { return new CUIConfig({{"type", "Widget"}}, { new CUIConfig({ {"type", "LineEdit"}, // 边界名称 diff --git a/CFDStruct/CFDStructDataManager/CFDStructDataSolverBoundaryConditionManager.h b/CFDStruct/CFDStructDataManager/CFDStructDataSolverBoundaryConditionManager.h index 806ecb7..6620e1f 100644 --- a/CFDStruct/CFDStructDataManager/CFDStructDataSolverBoundaryConditionManager.h +++ b/CFDStruct/CFDStructDataManager/CFDStructDataSolverBoundaryConditionManager.h @@ -4,21 +4,21 @@ #ifndef CFDSTRUCTDATASOLVERBOUNDARYCONDITIONEMANAGER_H #define CFDSTRUCTDATASOLVERBOUNDARYCONDITIONEMANAGER_H -#include #include "CFDStructDataManager_global.h" +#include class CUIConfig; -class CFDSTRUCTDATAMANAGER_EXPORT CFDStructDataSolverBoundaryConditionManager : public CFDStructDataManagerBase -{ +class CFDSTRUCTDATAMANAGER_EXPORT CFDStructDataSolverBoundaryConditionManager : public CFDStructDataManagerBase { Q_OBJECT -public: + public: explicit CFDStructDataSolverBoundaryConditionManager(QObject *parent = nullptr); ~CFDStructDataSolverBoundaryConditionManager(); CUIConfig *getParamUIConfig(); void saveDataToDom(rapidjson::Document &dom); + void readDataFromDom(rapidjson::Document &dom); -private: + private: // 生成界面配置 壁面 绝热壁 CUIConfig *genWallAdiabaticWallUIConfig(); // 生成界面配置 壁面 绝热壁 @@ -42,7 +42,6 @@ private: // 生成界面配置 压强入口 亚声速 面法相 CUIConfig *genPressureInletModeSubsonicSurfaceUIConfig(); - // 生成界面配置 压强出口 CUIConfig *genPressureOutletUIConfig(); @@ -62,9 +61,9 @@ private: // 流量出口 CUIConfig *genMassFlowOutletUIConfig(); -signals: + signals: -private: + private: // 边界名称 QString m_BoundaryName; // Boundary Name @@ -149,16 +148,16 @@ private: // 压强松弛因子 double m_PressureRelaxationFactor = 0; - //速度方向类型 + // 速度方向类型 int m_VelocityDirectionType = 0; - //方向矢量 + // 方向矢量 QString m_DirectionVector = ""; - //边界类型,选中总压入口时,出现的子选项,可选声速、亚声速 + // 边界类型,选中总压入口时,出现的子选项,可选声速、亚声速 int m_BoundaryType_sub = 0; - //用户自定义 + // 用户自定义 int m_UserDefined = 0; }; diff --git a/CFDStruct/CFDStructDataManager/CFDStructDataSolverInitializationManager.cpp b/CFDStruct/CFDStructDataManager/CFDStructDataSolverInitializationManager.cpp index 2010370..ebfbe46 100644 --- a/CFDStruct/CFDStructDataManager/CFDStructDataSolverInitializationManager.cpp +++ b/CFDStruct/CFDStructDataManager/CFDStructDataSolverInitializationManager.cpp @@ -1,201 +1,198 @@ +#include "CFDStructDataSolverInitializationManager.h" #include "CFDStructDataSolverTimeModeManager.h" -#include "CUIProperty/CUIConfig.h" #include "CFDStructMain/CFDStructDefine.h" #include "CFDStructSigsCenter.h" +#include "CUIProperty/CUIConfig.h" #include "CUIProperty/CUISigsCenter.h" #include -#include "CFDStructDataSolverInitializationManager.h" -CFDStructDataSolverInitializationManager::CFDStructDataSolverInitializationManager(QObject *parent) : CFDStructDataManagerBase(parent) -{ +CFDStructDataSolverInitializationManager::CFDStructDataSolverInitializationManager(QObject *parent) : CFDStructDataManagerBase(parent) { m_uiConfig = nullptr; - connect(m_cuiSigsCenter, &CUISigsCenter::sig_cuiPropertyChanged, this, [=](int semaphore) - { emit CFDStructSigsCenter::getInstance() -> sig_solverTimeModeDataChanged(); }); + connect(m_cuiSigsCenter, &CUISigsCenter::sig_cuiPropertyChanged, this, [=](int semaphore) { emit CFDStructSigsCenter::getInstance() -> sig_solverTimeModeDataChanged(); }); } -CFDStructDataSolverInitializationManager::~CFDStructDataSolverInitializationManager() -{ +CFDStructDataSolverInitializationManager::~CFDStructDataSolverInitializationManager() { // CFDStructDataManagerBase::~CFDStructDataManagerBase(); } -CUIConfig *CFDStructDataSolverInitializationManager::getParamUIConfig() -{ - if (m_uiConfig != nullptr) - { +CUIConfig *CFDStructDataSolverInitializationManager::getParamUIConfig() { + if (m_uiConfig != nullptr) { delete m_uiConfig; m_uiConfig = nullptr; } - if(m_CoordinateSystem == 0) + if (m_CoordinateSystem == 0) return genCylindricalUIConfig(); - if(m_CoordinateSystem == 1) + if (m_CoordinateSystem == 1) return genCartesianUIConfig(); - return m_uiConfig; } -void CFDStructDataSolverInitializationManager::saveDataToDom(rapidjson::Document &dom) -{ +void CFDStructDataSolverInitializationManager::saveDataToDom(rapidjson::Document &dom) { + // TODO +} +void CFDStructDataSolverInitializationManager::readDataFromDom(rapidjson::Document &dom) { + // TODO } -CUIConfig *CFDStructDataSolverInitializationManager::genCylindricalUIConfig() -{ +CUIConfig *CFDStructDataSolverInitializationManager::genCylindricalUIConfig() { return new CUIConfig({ - {"type", "Widget"}, - }, - { - new CUIConfig({ - {"type", "ComboBox"}, // 参考值取自 - {"name", tr("The reference value is taken from")}, - {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_INT}, - {"value_origin", QVA_GLOBAL(&m_ReferenceValuesFrom)}, - }, - {}), + {"type", "Widget"}, + }, + { + new CUIConfig({ + {"type", "ComboBox"}, // 参考值取自 + {"name", tr("The reference value is taken from")}, + {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_INT}, + {"value_origin", QVA_GLOBAL(&m_ReferenceValuesFrom)}, + }, + {}), + new CUIConfig({ + {"type", "ComboBox"}, // 坐标系 + {"name", tr("Coordinate System")}, + {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_INT}, + {"value_origin", QVA_GLOBAL(&m_CoordinateSystem)}, + {"semaphore", (int)SolutionAnalysisModuleProperty::Initialization}, + }, + { + new CUIConfig({ + {"type", "Item"}, + {"name", "Cylindrical Coordinate System"}, + }), + new CUIConfig({ + {"type", "Item"}, + {"name", "Cartesian Coordinate System"}, + }), + }), new CUIConfig({ - {"type","ComboBox"},//坐标系 - {"name",tr("Coordinate System")}, - {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_INT}, - {"value_origin", QVA_GLOBAL(&m_CoordinateSystem)}, - {"semaphore", (int)SolutionAnalysisModuleProperty::Initialization}, - },{ - new CUIConfig({ - {"type","Item"}, - {"name","Cylindrical Coordinate System"}, - }), - new CUIConfig({ - {"type","Item"}, - {"name","Cartesian Coordinate System"}, - }), - }), - new CUIConfig({ - {"type", "GroupBox"}, // 初始值定义 - {"name", tr("Initial value definition")}, - }, - { - new CUIConfig({ - {"type", "LineEdit"}, // 密度 - {"name", tr("density")}, - {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE}, - {"value_origin", QVA_GLOBAL(&m_Density)}, - }), - new CUIConfig({ - {"type", "LineEdit"}, // 展向速度vr - {"name", tr("Vr")}, - {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE}, - {"value_origin", QVA_GLOBAL(&m_Vr)}, - }), - new CUIConfig({ - {"type", "LineEdit"}, // 周向速度Vtheta - {"name", tr("Vtheta")}, - {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE}, - {"value_origin", QVA_GLOBAL(&m_Vtheta)}, - }), - new CUIConfig({ - {"type", "LineEdit"}, // 轴向速度Vz - {"name", tr("Vz")}, - {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE}, - {"value_origin", QVA_GLOBAL(&m_Vz)}, - }), - new CUIConfig({ - {"type", "LineEdit"}, // 压强 - {"name", tr("pressure")}, - {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE}, - {"value_origin", QVA_GLOBAL(&m_Pressure)}, - }), - new CUIConfig({ - {"type", "LineEdit"}, // 湍流粘性比 - {"name", tr("Turbulent viscosity ratio")}, - {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE}, - {"value_origin", QVA_GLOBAL(&m_TurbulentViscosityRatio)}, - }), - new CUIConfig({ - {"type", "LineEdit"}, // 湍流强度 - {"name", tr("Turbulence intensity")}, - {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE}, - {"value_origin", QVA_GLOBAL(&m_TurbulentIntensity)}, - }), - }), - }); + {"type", "GroupBox"}, // 初始值定义 + {"name", tr("Initial value definition")}, + }, + { + new CUIConfig({ + {"type", "LineEdit"}, // 密度 + {"name", tr("density")}, + {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE}, + {"value_origin", QVA_GLOBAL(&m_Density)}, + }), + new CUIConfig({ + {"type", "LineEdit"}, // 展向速度vr + {"name", tr("Vr")}, + {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE}, + {"value_origin", QVA_GLOBAL(&m_Vr)}, + }), + new CUIConfig({ + {"type", "LineEdit"}, // 周向速度Vtheta + {"name", tr("Vtheta")}, + {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE}, + {"value_origin", QVA_GLOBAL(&m_Vtheta)}, + }), + new CUIConfig({ + {"type", "LineEdit"}, // 轴向速度Vz + {"name", tr("Vz")}, + {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE}, + {"value_origin", QVA_GLOBAL(&m_Vz)}, + }), + new CUIConfig({ + {"type", "LineEdit"}, // 压强 + {"name", tr("pressure")}, + {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE}, + {"value_origin", QVA_GLOBAL(&m_Pressure)}, + }), + new CUIConfig({ + {"type", "LineEdit"}, // 湍流粘性比 + {"name", tr("Turbulent viscosity ratio")}, + {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE}, + {"value_origin", QVA_GLOBAL(&m_TurbulentViscosityRatio)}, + }), + new CUIConfig({ + {"type", "LineEdit"}, // 湍流强度 + {"name", tr("Turbulence intensity")}, + {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE}, + {"value_origin", QVA_GLOBAL(&m_TurbulentIntensity)}, + }), + }), + }); } -CUIConfig *CFDStructDataSolverInitializationManager::genCartesianUIConfig() -{ +CUIConfig *CFDStructDataSolverInitializationManager::genCartesianUIConfig() { return new CUIConfig({ - {"type", "Widget"}, - }, - { - new CUIConfig({ - {"type", "ComboBox"}, // 参考值取自 - {"name", tr("The reference value is taken from")}, - {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_INT}, - {"value_origin", QVA_GLOBAL(&m_ReferenceValuesFrom)}, - }, - {}), + {"type", "Widget"}, + }, + { + new CUIConfig({ + {"type", "ComboBox"}, // 参考值取自 + {"name", tr("The reference value is taken from")}, + {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_INT}, + {"value_origin", QVA_GLOBAL(&m_ReferenceValuesFrom)}, + }, + {}), + new CUIConfig({ + {"type", "ComboBox"}, // 坐标系 + {"name", tr("Coordinate System")}, + {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_INT}, + {"value_origin", QVA_GLOBAL(&m_CoordinateSystem)}, + {"semaphore", (int)SolutionAnalysisModuleProperty::Initialization}, + }, + { + new CUIConfig({ + {"type", "Item"}, + {"name", "Cylindrical Coordinate System"}, + }), + new CUIConfig({ + {"type", "Item"}, + {"name", "Cartesian Coordinate System"}, + }), + }), new CUIConfig({ - {"type","ComboBox"},//坐标系 - {"name",tr("Coordinate System")}, - {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_INT}, - {"value_origin", QVA_GLOBAL(&m_CoordinateSystem)}, - {"semaphore", (int)SolutionAnalysisModuleProperty::Initialization}, - },{ - new CUIConfig({ - {"type","Item"}, - {"name","Cylindrical Coordinate System"}, - }), - new CUIConfig({ - {"type","Item"}, - {"name","Cartesian Coordinate System"}, - }), - }), - new CUIConfig({ - {"type", "GroupBox"}, // 初始值定义 - {"name", tr("Initial value definition")}, - }, - { - new CUIConfig({ - {"type", "LineEdit"}, // 密度 - {"name", tr("density")}, - {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE}, - {"value_origin", QVA_GLOBAL(&m_Density)}, - }), - new CUIConfig({ - {"type", "LineEdit"}, // vx - {"name", tr("Vx")}, - {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE}, - {"value_origin", QVA_GLOBAL(&m_Vx)}, - }), - new CUIConfig({ - {"type", "LineEdit"}, // vy - {"name", tr("Vy")}, - {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE}, - {"value_origin", QVA_GLOBAL(&m_Vy)}, - }), - new CUIConfig({ - {"type", "LineEdit"}, // vz - {"name", tr("Vz")}, - {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE}, - {"value_origin", QVA_GLOBAL(&m_Vz)}, - }), - new CUIConfig({ - {"type", "LineEdit"}, // 压强 - {"name", tr("pressure")}, - {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE}, - {"value_origin", QVA_GLOBAL(&m_Pressure)}, - }), - new CUIConfig({ - {"type", "LineEdit"}, // 湍流粘性比 - {"name", tr("Turbulent viscosity ratio")}, - {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE}, - {"value_origin", QVA_GLOBAL(&m_TurbulentViscosityRatio)}, - }), - new CUIConfig({ - {"type", "LineEdit"}, // 湍流强度 - {"name", tr("Turbulence intensity")}, - {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE}, - {"value_origin", QVA_GLOBAL(&m_TurbulentIntensity)}, - }), - }), - }); + {"type", "GroupBox"}, // 初始值定义 + {"name", tr("Initial value definition")}, + }, + { + new CUIConfig({ + {"type", "LineEdit"}, // 密度 + {"name", tr("density")}, + {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE}, + {"value_origin", QVA_GLOBAL(&m_Density)}, + }), + new CUIConfig({ + {"type", "LineEdit"}, // vx + {"name", tr("Vx")}, + {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE}, + {"value_origin", QVA_GLOBAL(&m_Vx)}, + }), + new CUIConfig({ + {"type", "LineEdit"}, // vy + {"name", tr("Vy")}, + {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE}, + {"value_origin", QVA_GLOBAL(&m_Vy)}, + }), + new CUIConfig({ + {"type", "LineEdit"}, // vz + {"name", tr("Vz")}, + {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE}, + {"value_origin", QVA_GLOBAL(&m_Vz)}, + }), + new CUIConfig({ + {"type", "LineEdit"}, // 压强 + {"name", tr("pressure")}, + {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE}, + {"value_origin", QVA_GLOBAL(&m_Pressure)}, + }), + new CUIConfig({ + {"type", "LineEdit"}, // 湍流粘性比 + {"name", tr("Turbulent viscosity ratio")}, + {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE}, + {"value_origin", QVA_GLOBAL(&m_TurbulentViscosityRatio)}, + }), + new CUIConfig({ + {"type", "LineEdit"}, // 湍流强度 + {"name", tr("Turbulence intensity")}, + {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE}, + {"value_origin", QVA_GLOBAL(&m_TurbulentIntensity)}, + }), + }), + }); } diff --git a/CFDStruct/CFDStructDataManager/CFDStructDataSolverInitializationManager.h b/CFDStruct/CFDStructDataManager/CFDStructDataSolverInitializationManager.h index 1fcf1b2..f1c38e8 100644 --- a/CFDStruct/CFDStructDataManager/CFDStructDataSolverInitializationManager.h +++ b/CFDStruct/CFDStructDataManager/CFDStructDataSolverInitializationManager.h @@ -17,6 +17,7 @@ public: CUIConfig *getParamUIConfig(); void saveDataToDom(rapidjson::Document &dom); + void readDataFromDom(rapidjson::Document &dom); private: // 生成界面配置 柱坐标系 diff --git a/CFDStruct/CFDStructDataManager/CFDStructDataSolverSportsAttributesManager.cpp b/CFDStruct/CFDStructDataManager/CFDStructDataSolverSportsAttributesManager.cpp index 2d70baf..5eb80a4 100644 --- a/CFDStruct/CFDStructDataManager/CFDStructDataSolverSportsAttributesManager.cpp +++ b/CFDStruct/CFDStructDataManager/CFDStructDataSolverSportsAttributesManager.cpp @@ -28,6 +28,7 @@ void CFDStructDataSolverSportsAttributesItemManager::saveDataToDom(rapidjson::Do jsonAdd(dom, m_id, {"region", 0, "motion", this->getId(), "id"}); jsonAdd(dom, m_MotionName, {"region", 0, "motion", this->getId(), "meshMotion", "name"}); jsonAdd(dom, m_MotionType, {"region", 0, "motion", this->getId(), "meshMotion", "MotionType"}); + jsonAdd(dom, m_MotionMode, {"region", 0, "motion", this->getId(), "meshMotion", "attrtype"}); jsonAdd(dom, m_RotationAxisOrigin, {"region", 0, "motion", this->getId(), "meshMotion", "rigid", "origin"}); jsonAdd(dom, m_RotationAxisDirection, {"region", 0, "motion", this->getId(), "meshMotion", "rigid", "axial"}); jsonAdd(dom, m_RotationSpeed, {"region", 0, "motion", this->getId(), "meshMotion", "rigid", "speed"}); @@ -212,6 +213,10 @@ void CFDStructDataSolverSportsAttributesManager::saveDataToDom(rapidjson::Docume } } +void CFDStructDataSolverSportsAttributesManager::readDataFromDom(rapidjson::Document &dom) { + // TODO +} + void CFDStructDataSolverSportsAttributesManager::addNewSportAttributesItem() { CFDStructDataSolverSportsAttributesItemManager *item = new CFDStructDataSolverSportsAttributesItemManager; item->setId(m_itemList.size()); diff --git a/CFDStruct/CFDStructDataManager/CFDStructDataSolverSportsAttributesManager.h b/CFDStruct/CFDStructDataManager/CFDStructDataSolverSportsAttributesManager.h index c0fb547..3665d66 100644 --- a/CFDStruct/CFDStructDataManager/CFDStructDataSolverSportsAttributesManager.h +++ b/CFDStruct/CFDStructDataManager/CFDStructDataSolverSportsAttributesManager.h @@ -53,6 +53,11 @@ class CFDSTRUCTDATAMANAGER_EXPORT CFDStructDataSolverSportsAttributesItemManager // 转速 double m_RotationSpeed; // Rotation Speed in rpm + + /** + * TODO运动区域,有关列表组件 + * json:region[0] motion[$1] meshMotion zone[$2] + */ }; class CFDSTRUCTDATAMANAGER_EXPORT CFDStructDataSolverSportsAttributesManager : public CFDStructDataManagerBase { @@ -64,6 +69,8 @@ class CFDSTRUCTDATAMANAGER_EXPORT CFDStructDataSolverSportsAttributesManager : p CUIConfig *getParamUIConfig(); void saveDataToDom(rapidjson::Document &dom); + void readDataFromDom(rapidjson::Document &dom); + private: // // 生成运动坐标系的界面配置 // CUIConfig* genMovingFrameModeUIConfig(); diff --git a/Resources/case-01.json b/Resources/case-01.json index 1793d7e..5e38632 100644 --- a/Resources/case-01.json +++ b/Resources/case-01.json @@ -34,7 +34,7 @@ "accuracy": 2, "limiter": 0, "timeType": 0, - "iterType": 0, + "iterType": 2, "lussor": 0.5, "gridLevelNum": 0, "cycleType": 0,