diff --git a/CFDStruct/CFDStructDataManager/CFDStructDataSolverInitializationManager.cpp b/CFDStruct/CFDStructDataManager/CFDStructDataSolverInitializationManager.cpp index e01f63a..ea283e4 100644 --- a/CFDStruct/CFDStructDataManager/CFDStructDataSolverInitializationManager.cpp +++ b/CFDStruct/CFDStructDataManager/CFDStructDataSolverInitializationManager.cpp @@ -9,23 +9,23 @@ 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() { -// CFDStructDataManagerBase::~CFDStructDataManagerBase(); + // CFDStructDataManagerBase::~CFDStructDataManagerBase(); } CUIConfig *CFDStructDataSolverInitializationManager::getParamUIConfig() { - if (m_uiConfig != nullptr) { + if (m_uiConfig != nullptr) + { delete m_uiConfig; m_uiConfig = nullptr; } -// m_uiConfig->printConfig(); + // m_uiConfig->printConfig(); m_uiConfig = this->genUIConfig(); return m_uiConfig; } @@ -33,45 +33,64 @@ CUIConfig *CFDStructDataSolverInitializationManager::getParamUIConfig() CUIConfig *CFDStructDataSolverInitializationManager::genUIConfig() { new CUIConfig({ - {"type","Widget"}, - },{ - new CUIConfig({ - {"type","ComboBox"},//参考值取自 - {"name",tr("The reference value is taken from")}, - },{}), - new CUIConfig({ - {"type","GroupBox"},//初始值定义 - {"name",tr("Initial value definition")}, - },{ - new CUIConfig({ - {"type","LineEdit"},//密度 - {"name",tr("density")}, - }), - new CUIConfig({ - {"type","LineEdit"},//μ速度 - {"name",tr("μ speed")}, - }), - new CUIConfig({ - {"type","LineEdit"},//ν速度 - {"name",tr("v Speed")}, - }), - new CUIConfig({ - {"type","LineEdit"},//ω速度 - {"name",tr("ω velocity")}, - }), - new CUIConfig({ - {"type","LineEdit"},//压强 - {"name",tr("pressure")}, - }), - new CUIConfig({ - {"type","LineEdit"},//湍流粘性比 - {"name",tr("Turbulent viscosity ratio")}, - }), - new CUIConfig({ - {"type","LineEdit"},//湍流强度 - {"name",tr("Turbulence intensity")}, - }), - }), - }); + {"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", "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"}, // μ速度 + {"name", tr("μ speed")}, + {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE}, + {"value_origin", QVA_GLOBAL(&m_MuVelocity)}, + }), + new CUIConfig({ + {"type", "LineEdit"}, // ν速度 + {"name", tr("v Speed")}, + {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE}, + {"value_origin", QVA_GLOBAL(&m_VVelocity)}, + }), + new CUIConfig({ + {"type", "LineEdit"}, // ω速度 + {"name", tr("ω velocity")}, + {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE}, + {"value_origin", QVA_GLOBAL(&m_WVelocity)}, + }), + 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)}, + }), + }), + }); return nullptr; } diff --git a/CFDStruct/CFDStructDataManager/CFDStructDataSolverInitializationManager.h b/CFDStruct/CFDStructDataManager/CFDStructDataSolverInitializationManager.h index 80d761f..2b64c0f 100644 --- a/CFDStruct/CFDStructDataManager/CFDStructDataSolverInitializationManager.h +++ b/CFDStruct/CFDStructDataManager/CFDStructDataSolverInitializationManager.h @@ -15,26 +15,37 @@ public: explicit CFDStructDataSolverInitializationManager(QObject *parent = nullptr); ~CFDStructDataSolverInitializationManager(); - CUIConfig* getParamUIConfig(); + CUIConfig *getParamUIConfig(); private: // 生成界面配置 - CUIConfig* genUIConfig(); + CUIConfig *genUIConfig(); signals: private: - // 时间模式:定常0,非定常1 - int m_runtype = 0; - // 时间模式:定常0,则是迭代步数;时间模式:非定常1,则是内迭代步数 - int m_mcyc = 1000; - // 步长模式 >=1 - double m_alf0 = 1.0; - // 时间步长 >0 - double m_realdt = 1.0; - // 时间步数 >=1 - int m_nstep = 10; - // 时均统计量数据采样:0 | 1 - int m_timeaverage = 0; + // 参考值取自 + int m_ReferenceValuesFrom; // Reference Values From + + // 密度 + double m_Density; // Density + + // μ速度 + double m_MuVelocity; // Mu Velocity + + // v速度 + double m_VVelocity; // V Velocity + + // w速度 + double m_WVelocity; // W Velocity + + // 压强 + double m_Pressure; // Pressure + + // 湍流粘性比 + double m_TurbulentViscosityRatio; // Turbulent Viscosity Ratio + + // 湍流强度 + double m_TurbulentIntensity; // Turbulent Intensity }; #endif // CFDSTRUCTDATASOLVERINITIALIZATIONEMANAGER_H