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) {
jsonAdd(dom, m_runtype, {"region", 0, "solver", "time"});
jsonAdd(dom, m_innerIters, {
"couplingSolver",
"unSteady",
"innerIters",
});
jsonAdd(dom, m_iters, {
"couplingSolver",
"steady",
"iters",
});
jsonAdd(dom, m_alf0, {
"couplingSolver",
"unSteady",
"stepType",
});
jsonAdd(dom, m_realdt, {
"couplingSolver",
"unSteady",
"timeStep",
});
jsonAdd(dom, m_nstep, {
"couplingSolver",
"unSteady",
"timeStepsNumber",
});
jsonAdd(dom, m_timeaverage, {
"couplingSolver",
"unSteady",
"Timeverage",
});
jsonAdd(dom, m_innerIters, {"couplingSolver", "unSteady", "innerIters"});
jsonAdd(dom, m_iters, {"couplingSolver", "steady", "iters"});
jsonAdd(dom, m_alf0, {"couplingSolver", "unSteady", "stepType"});
jsonAdd(dom, m_realdt, {"couplingSolver", "unSteady", "timeStep"});
jsonAdd(dom, m_nstep, {"couplingSolver", "unSteady", "timeStepsNumber"});
jsonAdd(dom, m_timeaverage, {"couplingSolver", "unSteady", "Timeverage"});
}
void CFDStructDataSolverTimeModeManager::readDataFromDom(rapidjson::Document &dom) {
QVariant temp;
jsonRead(dom, temp, {"region", 0, "solver", "time"});
if (temp != QVariant()) {
m_runtype = temp.toInt();
}
jsonRead(dom, temp, {"couplingSolver", "unSteady", "innerIters"});
if (temp != QVariant()) {
m_innerIters = temp.toInt();
}
jsonRead(dom, temp, {"couplingSolver", "steady", "iters"});
if (temp != QVariant()) {
m_iters = temp.toInt();
}
jsonRead(dom, temp, {"couplingSolver", "unSteady", "stepType"});
if (temp != QVariant()) {
m_alf0 = temp.toDouble();
}
jsonRead(dom, temp, {"couplingSolver", "unSteady", "timeStep"});
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() {

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

Loading…
Cancel
Save