#include "CFDStructDataSolverTimeModeManager.h" #include "CUIProperty/CUIConfig.h" CFDStructDataSolverTimeModeManager::CFDStructDataSolverTimeModeManager(QObject *parent) : QObject(parent) { } 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(); } else { // 如果是非定常 m_uiConfig = this->genUnsteadyModeUIConfig(); } return m_uiConfig; } CUIConfig *CFDStructDataSolverTimeModeManager::genSteadyModeUIConfig() { return new CUIConfig({ {"type", "Widget"} }, { new CUIConfig({ {"type", "ComboBox"}, {"name", "Time Mode"}, }, { new CUIConfig({ {"type", "Item"}, {"name", "steady"} }), new CUIConfig({ {"type", "Item"}, {"name", "unsteady"} }) }), new CUIConfig({ {"type", "LineEdit"}, {"name", "iteration count"} }) }); } CUIConfig *CFDStructDataSolverTimeModeManager::genUnsteadyModeUIConfig() { return new CUIConfig({ {"type", "Widget"} }, { new CUIConfig({ {"type", "ComboBox"}, {"name", "Time Mode"}, }, { 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"} }) }); }