1、结构化时间模式设置管理;

feature/struct-menu-20241023
simonyan 2 weeks ago
parent 327e18a0cb
commit 57a590f984

@ -0,0 +1,95 @@
#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"}
})
});
}

@ -0,0 +1,40 @@
#ifndef CFDSTRUCTDATASOLVERTIMEMODEMANAGER_H
#define CFDSTRUCTDATASOLVERTIMEMODEMANAGER_H
#include <QObject>
class CUIConfig;
class CFDStructDataSolverTimeModeManager : public QObject
{
Q_OBJECT
public:
explicit CFDStructDataSolverTimeModeManager(QObject *parent = nullptr);
~CFDStructDataSolverTimeModeManager();
CUIConfig* getParamUIConfig();
private:
// 生成定常的界面配置
CUIConfig* genSteadyModeUIConfig();
// 生成非定常的截面配置
CUIConfig* genUnsteadyModeUIConfig();
signals:
private:
// 鏃堕棿妯″紡
int m_runtype = 0;
// 杩唬姝ユ暟锛>=1锛屽畾甯告椂锛氳凯浠鏁帮紝闈炲畾甯革細鍐呰凯浠鏁 int m_mcyc = 1000;
// 姝ラ暱妯″紡锛屽浐瀹氾紝涓嶅彲淇敼
double m_alf0 = 1.0;
// 鏃堕棿姝ラ暱锛0
double m_realdt = 1.0;
// 鏃堕棿姝ユ暟锛=1
double m_nstep = 10;
// 鏃跺潎缁熻閲忔暟鎹噰鏍0,1
int m_timeaverage = 0;
CUIConfig* m_uiConfig;
};
#endif // CFDSTRUCTDATASOLVERTIMEMODEMANAGER_H
Loading…
Cancel
Save