#include "CFDStructDataSolverTimeModeManager.h" #include "CUIProperty/CUIConfig.h" #include "CFDStructDataDefine.h" #include CFDStructDataSolverTimeModeManager::CFDStructDataSolverTimeModeManager(QObject *parent) : QObject(parent) { m_uiConfig = nullptr; } CFDStructDataSolverTimeModeManager::~CFDStructDataSolverTimeModeManager() { if (m_uiConfig != nullptr) { delete m_uiConfig; m_uiConfig = nullptr; } } CUIConfig *CFDStructDataSolverTimeModeManager::getParamUIConfig() { if (m_uiConfig != nullptr) { delete m_uiConfig; m_uiConfig = nullptr; } // 如果是定常 if (m_runtype == 0) { m_uiConfig = this->genSteadyModeUIConfig(); qDebug() << " steady ============"; } else { // 如果是非定常 m_uiConfig = this->genUnsteadyModeUIConfig(); qDebug() << " unsteady ============"; } m_uiConfig->printConfig(); return m_uiConfig; } CUIConfig *CFDStructDataSolverTimeModeManager::genSteadyModeUIConfig() { return new CUIConfig({ {"type", "Widget"}}, { new CUIConfig({ {"type", "ComboBox"}, {"name", "Time Mode"}, {"valueType", "Int"}, {"valueOrigin", QVA_GLOBAL(&m_runtype)} }, { new CUIConfig({ {"type", "Item"}, {"name", "steady"}, {"data", "0"}, }), new CUIConfig({ {"type", "Item"}, {"name", "unsteady"}, {"data", "1"}, }) }), new CUIConfig({ {"type", "LineEdit"}, {"name", "iteration count"} }) }); } CUIConfig *CFDStructDataSolverTimeModeManager::genUnsteadyModeUIConfig() { return new CUIConfig({ {"type", "Widget"} }, { new CUIConfig({ {"type", "ComboBox"}, {"name", "Time Mode"}, {"valueType", "Int"}, {"valueOrigin", QVA_GLOBAL(&m_runtype)} }, { new CUIConfig({ {"type", "Item"}, {"name", "steady"} }), new CUIConfig({ {"type", "Item"}, {"name", "unsteady"} }) }), new CUIConfig({ {"type", "LineEdit"}, {"name", "alf0"} }), new CUIConfig({ {"type", "LineEdit"}, {"name", "realdt"} }), new CUIConfig({ {"type", "LineEdit"}, {"name", "nstep"} }), new CUIConfig({ {"type", "LineEdit"}, {"name", "mcyc"} }) }); }