From 8a040a2adfc4ace46aba6202bf1006aa7b8d47d0 Mon Sep 17 00:00:00 2001 From: mzh Date: Thu, 7 Nov 2024 15:42:48 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E5=AE=8C=E6=88=90=E8=AE=A1=E7=AE=97?= =?UTF-8?q?=E6=8E=A7=E5=88=B6=EF=BC=8C=E6=95=B0=E6=8D=AE=E4=BB=8Ejson?= =?UTF-8?q?=E4=B8=AD=E8=AF=BB=E5=87=BA=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...tructDataSolverComputingControlManager.cpp | 24 +++++++++++++++++++ ...DStructDataSolverComputingControlManager.h | 2 ++ 2 files changed, 26 insertions(+) diff --git a/CFDStruct/CFDStructDataManager/CFDStructDataSolverComputingControlManager.cpp b/CFDStruct/CFDStructDataManager/CFDStructDataSolverComputingControlManager.cpp index 8686890..251c536 100644 --- a/CFDStruct/CFDStructDataManager/CFDStructDataSolverComputingControlManager.cpp +++ b/CFDStruct/CFDStructDataManager/CFDStructDataSolverComputingControlManager.cpp @@ -33,6 +33,30 @@ void CFDStructDataSolverComputingControlManager::saveDataToDom(rapidjson::Docume jsonAdd(dom, m_mpiLibType, {"couplingSolver", "mpi", "type"}); } +void CFDStructDataSolverComputingControlManager::readDataFromDom(rapidjson::Document &dom) { + QVariant temp; + jsonAdd(dom, temp, {"couplingSolver", "unSteady", "savedSteps"}); + if (temp != QVariant()) { + m_DataSaveFrequency = temp.toInt(); + } + jsonAdd(dom, temp, {"couplingSolver", "steady", "savedIters"}); + if (temp != QVariant()) { + m_DataSaveFrequency = temp.toInt(); + } + jsonAdd(dom, temp, {"couplingSolver", "mpi", "core"}); + if (temp != QVariant()) { + m_NumericalComputationCores = temp.toInt(); + } + jsonAdd(dom, temp, {"couplingSolver", "mpi", "on"}); + if (temp != QVariant()) { + m_enableMPI = temp.toInt(); + } + jsonAdd(dom, temp, {"couplingSolver", "mpi", "type"}); + if (temp != QVariant()) { + m_mpiLibType = temp.toInt(); + } +} + CUIConfig *CFDStructDataSolverComputingControlManager::genUIConfig() { return new CUIConfig( { diff --git a/CFDStruct/CFDStructDataManager/CFDStructDataSolverComputingControlManager.h b/CFDStruct/CFDStructDataManager/CFDStructDataSolverComputingControlManager.h index 8700945..e8bab8e 100644 --- a/CFDStruct/CFDStructDataManager/CFDStructDataSolverComputingControlManager.h +++ b/CFDStruct/CFDStructDataManager/CFDStructDataSolverComputingControlManager.h @@ -17,6 +17,8 @@ class CFDSTRUCTDATAMANAGER_EXPORT CFDStructDataSolverComputingControlManager : p CUIConfig *getParamUIConfig(); void saveDataToDom(rapidjson::Document &dom); + void readDataFromDom(rapidjson::Document &dom); + private: // 生成界面配置 CUIConfig *genUIConfig();