|
|
|
#include "CFDStructDataSolverTimeModeManager.h"
|
|
|
|
#include "CUIProperty/CUIConfig.h"
|
|
|
|
#include "CFDStructMain/CFDStructDefine.h"
|
|
|
|
#include "CFDStructSigsCenter.h"
|
|
|
|
#include "CUIProperty/CUISigsCenter.h"
|
|
|
|
#include <QVariant>
|
|
|
|
|
|
|
|
CFDStructDataSolverTimeModeManager::CFDStructDataSolverTimeModeManager(QObject *parent) : CFDStructDataManagerBase(parent)
|
|
|
|
{
|
|
|
|
m_uiConfig = nullptr;
|
|
|
|
connect(m_cuiSigsCenter, &CUISigsCenter::sig_cuiPropertyChanged, this, [ = ](int semaphore) {
|
|
|
|
if (semaphore == (int)SolutionAnalysisModuleProperty::TIME_MODE) {
|
|
|
|
emit CFDStructSigsCenter::getInstance()->sig_solverTimeModeDataChanged();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
CFDStructDataSolverTimeModeManager::~CFDStructDataSolverTimeModeManager()
|
|
|
|
{
|
|
|
|
// CFDStructDataManagerBase::~CFDStructDataManagerBase();
|
|
|
|
}
|
|
|
|
|
|
|
|
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();
|
|
|
|
}
|
|
|
|
// m_uiConfig->printConfig();
|
|
|
|
return m_uiConfig;
|
|
|
|
}
|
|
|
|
|
|
|
|
CUIConfig *CFDStructDataSolverTimeModeManager::genSteadyModeUIConfig()
|
|
|
|
{
|
|
|
|
return new CUIConfig({
|
|
|
|
{"type", "Widget"}}, {
|
|
|
|
new CUIConfig({
|
|
|
|
{"type", "ComboBox"},
|
|
|
|
{"name", "Time Mode"},
|
|
|
|
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_INT},
|
|
|
|
{"value_origin", QVA_GLOBAL(&m_runtype)},
|
|
|
|
{"semaphore", (int)SolutionAnalysisModuleProperty::TIME_MODE},
|
|
|
|
}, {
|
|
|
|
new CUIConfig({
|
|
|
|
{"type", "Item"},
|
|
|
|
{"name", "steady"},
|
|
|
|
}),
|
|
|
|
new CUIConfig({
|
|
|
|
{"type", "Item"},
|
|
|
|
{"name", "unsteady"},
|
|
|
|
})
|
|
|
|
}),
|
|
|
|
new CUIConfig({
|
|
|
|
{"type", "LineEdit"},
|
|
|
|
{"name", "iteration count"},
|
|
|
|
{"value_type", "Int"},
|
|
|
|
{"value_origin", QVA_GLOBAL(&m_mcyc)},
|
|
|
|
})
|
|
|
|
});
|
|
|
|
}
|
|
|
|
CUIConfig *CFDStructDataSolverTimeModeManager::genUnsteadyModeUIConfig()
|
|
|
|
{
|
|
|
|
return new CUIConfig({
|
|
|
|
{"type", "Widget"}
|
|
|
|
}, {
|
|
|
|
new CUIConfig({
|
|
|
|
{"type", "ComboBox"},
|
|
|
|
{"name", "Time Mode"},
|
|
|
|
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_INT},
|
|
|
|
{"value_origin", QVA_GLOBAL(&m_runtype)},
|
|
|
|
{"semaphore", (int)SolutionAnalysisModuleProperty::TIME_MODE},
|
|
|
|
}, {
|
|
|
|
new CUIConfig({
|
|
|
|
{"type", "Item"},
|
|
|
|
{"name", "steady"}
|
|
|
|
}),
|
|
|
|
new CUIConfig({
|
|
|
|
{"type", "Item"},
|
|
|
|
{"name", "unsteady"}
|
|
|
|
})
|
|
|
|
}),
|
|
|
|
new CUIConfig({
|
|
|
|
{"type", "LineEdit"},
|
|
|
|
{"name", "alf0"},
|
|
|
|
{"value_type", "Double"},
|
|
|
|
{"value_origin", QVA_GLOBAL(&m_alf0)},
|
|
|
|
}),
|
|
|
|
new CUIConfig({
|
|
|
|
{"type", "LineEdit"},
|
|
|
|
{"name", "realdt"},
|
|
|
|
{"value_type", "Double"},
|
|
|
|
{"value_origin", QVA_GLOBAL(&m_realdt)},
|
|
|
|
}),
|
|
|
|
new CUIConfig({
|
|
|
|
{"type", "LineEdit"},
|
|
|
|
{"name", "nstep"},
|
|
|
|
{"value_type", "Int"},
|
|
|
|
{"value_origin", QVA_GLOBAL(&m_nstep)},
|
|
|
|
}),
|
|
|
|
new CUIConfig({
|
|
|
|
{"type", "LineEdit"},
|
|
|
|
{"name", "mcyc"},
|
|
|
|
{"value_type", "Int"},
|
|
|
|
{"value_origin", QVA_GLOBAL(&m_mcyc)},
|
|
|
|
})
|
|
|
|
});
|
|
|
|
}
|