1、完成时间模式,数据从json中读入

feature/struct-menu-20241023
mzh 1 week ago
parent de48fffe11
commit cf82571cae

@ -41,36 +41,45 @@ CUIConfig *CFDStructDataSolverTimeModeManager::getParamUIConfig() {
void CFDStructDataSolverTimeModeManager::saveDataToDom(rapidjson::Document &dom) { void CFDStructDataSolverTimeModeManager::saveDataToDom(rapidjson::Document &dom) {
jsonAdd(dom, m_runtype, {"region", 0, "solver", "time"}); jsonAdd(dom, m_runtype, {"region", 0, "solver", "time"});
jsonAdd(dom, m_innerIters, { jsonAdd(dom, m_innerIters, {"couplingSolver", "unSteady", "innerIters"});
"couplingSolver", jsonAdd(dom, m_iters, {"couplingSolver", "steady", "iters"});
"unSteady", jsonAdd(dom, m_alf0, {"couplingSolver", "unSteady", "stepType"});
"innerIters", jsonAdd(dom, m_realdt, {"couplingSolver", "unSteady", "timeStep"});
}); jsonAdd(dom, m_nstep, {"couplingSolver", "unSteady", "timeStepsNumber"});
jsonAdd(dom, m_iters, { jsonAdd(dom, m_timeaverage, {"couplingSolver", "unSteady", "Timeverage"});
"couplingSolver", }
"steady",
"iters", void CFDStructDataSolverTimeModeManager::readDataFromDom(rapidjson::Document &dom) {
}); QVariant temp;
jsonAdd(dom, m_alf0, {
"couplingSolver", jsonRead(dom, temp, {"region", 0, "solver", "time"});
"unSteady", if (temp != QVariant()) {
"stepType", m_runtype = temp.toInt();
}); }
jsonAdd(dom, m_realdt, { jsonRead(dom, temp, {"couplingSolver", "unSteady", "innerIters"});
"couplingSolver", if (temp != QVariant()) {
"unSteady", m_innerIters = temp.toInt();
"timeStep", }
}); jsonRead(dom, temp, {"couplingSolver", "steady", "iters"});
jsonAdd(dom, m_nstep, { if (temp != QVariant()) {
"couplingSolver", m_iters = temp.toInt();
"unSteady", }
"timeStepsNumber", jsonRead(dom, temp, {"couplingSolver", "unSteady", "stepType"});
}); if (temp != QVariant()) {
jsonAdd(dom, m_timeaverage, { m_alf0 = temp.toDouble();
"couplingSolver", }
"unSteady", jsonRead(dom, temp, {"couplingSolver", "unSteady", "timeStep"});
"Timeverage", if (temp != QVariant()) {
}); m_realdt = temp.toDouble();
}
jsonRead(dom, temp, {"couplingSolver", "unSteady", "timeStepsNumber"});
if (temp != QVariant()) {
m_nstep = temp.toInt();
}
jsonRead(dom, temp, {"couplingSolver", "unSteady", "Timeverage"});
if (temp != QVariant()) {
m_timeaverage = temp.toInt();
}
} }
CUIConfig *CFDStructDataSolverTimeModeManager::genSteadyModeUIConfig() { CUIConfig *CFDStructDataSolverTimeModeManager::genSteadyModeUIConfig() {

@ -1,12 +1,14 @@
#ifndef CFDSTRUCTDATASOLVERTIMEMODEMANAGER_H /**
*
*/
#ifndef CFDSTRUCTDATASOLVERTIMEMODEMANAGER_H
#define CFDSTRUCTDATASOLVERTIMEMODEMANAGER_H #define CFDSTRUCTDATASOLVERTIMEMODEMANAGER_H
#include <CFDStructDataManagerBase.h>
#include "CFDStructDataManager_global.h" #include "CFDStructDataManager_global.h"
#include <CFDStructDataManagerBase.h>
class CUIConfig; class CUIConfig;
class CFDSTRUCTDATAMANAGER_EXPORT CFDStructDataSolverTimeModeManager : public CFDStructDataManagerBase class CFDSTRUCTDATAMANAGER_EXPORT CFDStructDataSolverTimeModeManager : public CFDStructDataManagerBase {
{
Q_OBJECT Q_OBJECT
public: public:
explicit CFDStructDataSolverTimeModeManager(QObject *parent = nullptr); explicit CFDStructDataSolverTimeModeManager(QObject *parent = nullptr);
@ -15,6 +17,8 @@ public:
CUIConfig *getParamUIConfig(); CUIConfig *getParamUIConfig();
void saveDataToDom(rapidjson::Document &dom); void saveDataToDom(rapidjson::Document &dom);
void readDataFromDom(rapidjson::Document &dom);
private: private:
// 生成定常的界面配置 // 生成定常的界面配置
CUIConfig *genSteadyModeUIConfig(); CUIConfig *genSteadyModeUIConfig();

Loading…
Cancel
Save