From 36e41041ddfc739abcf4a99a37e3c5b6035728d7 Mon Sep 17 00:00:00 2001 From: mzh Date: Fri, 8 Nov 2024 10:05:15 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E6=B7=BB=E5=8A=A0=E6=A8=A1=E6=9D=BFj?= =?UTF-8?q?son=E6=96=87=E4=BB=B6=E8=B7=AF=E5=BE=84=E5=AE=9A=E4=B9=89=202?= =?UTF-8?q?=E3=80=81=E6=B7=BB=E5=8A=A0case-01json=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E8=B7=AF=E5=BE=84=E5=AE=9A=E4=B9=89=203=E3=80=81=E5=B0=86json?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E8=BE=93=E5=87=BA=E8=87=B3=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CFDStructDataManager.cpp | 6 ++++- ...DStructDataSolverSportsAttributesManager.h | 4 ++-- CFDStruct/CFDStructMain/CFDStructDefine.h | 23 +++++++++++-------- 3 files changed, 21 insertions(+), 12 deletions(-) diff --git a/CFDStruct/CFDStructDataManager/CFDStructDataManager.cpp b/CFDStruct/CFDStructDataManager/CFDStructDataManager.cpp index eeee5d4..cdb03df 100644 --- a/CFDStruct/CFDStructDataManager/CFDStructDataManager.cpp +++ b/CFDStruct/CFDStructDataManager/CFDStructDataManager.cpp @@ -127,5 +127,9 @@ void CFDStructDataManager::printJson() { Writer writer(buffer); m_dom.Accept(writer); - qDebug() << buffer.GetString(); + freopen(caseJSONPath.c_str(), "w", stdout); + + std::cout << buffer.GetString() << std::endl; + + fclose(stdout); } diff --git a/CFDStruct/CFDStructDataManager/CFDStructDataSolverSportsAttributesManager.h b/CFDStruct/CFDStructDataManager/CFDStructDataSolverSportsAttributesManager.h index 3665d66..a12eae0 100644 --- a/CFDStruct/CFDStructDataManager/CFDStructDataSolverSportsAttributesManager.h +++ b/CFDStruct/CFDStructDataManager/CFDStructDataSolverSportsAttributesManager.h @@ -36,10 +36,10 @@ class CFDSTRUCTDATAMANAGER_EXPORT CFDStructDataSolverSportsAttributesItemManager private: // 运动名称 - QString m_MotionName; // Motion Name + QString m_MotionName = ""; // Motion Name // 运动类型 - int m_MotionType; // Motion Type + int m_MotionType = 0; // Motion Type // 运动方式 // json中没有对应位置 diff --git a/CFDStruct/CFDStructMain/CFDStructDefine.h b/CFDStruct/CFDStructMain/CFDStructDefine.h index 764275c..49599df 100644 --- a/CFDStruct/CFDStructMain/CFDStructDefine.h +++ b/CFDStruct/CFDStructMain/CFDStructDefine.h @@ -1,19 +1,20 @@ #ifndef CFDSTRUCTDEFINE_H #define CFDSTRUCTDEFINE_H +#include #include #define QVA_GLOBAL(x) QVariant::fromValue(x) -#define QVA_QS(x) QVariant::fromValue(QString(x)) -#define QVA_FROM_QS(x) qvariant_cast(x) +#define QVA_QS(x) QVariant::fromValue(QString(x)) +#define QVA_FROM_QS(x) qvariant_cast(x) #ifndef QVAR_DECLARE - #define QVAR_DECLARE - Q_DECLARE_METATYPE(int*) - Q_DECLARE_METATYPE(bool*) - Q_DECLARE_METATYPE(double*) - Q_DECLARE_METATYPE(QString*) - Q_DECLARE_METATYPE(QString) +#define QVAR_DECLARE +Q_DECLARE_METATYPE(int *) +Q_DECLARE_METATYPE(bool *) +Q_DECLARE_METATYPE(double *) +Q_DECLARE_METATYPE(QString *) +Q_DECLARE_METATYPE(QString) #endif // 结构树中节点 @@ -64,5 +65,9 @@ enum class SolutionAnalysisModuleProperty { UNKNOW, }; -#endif // CFDSTRUCTDEFINE_H +// 模板json文件路径 +const std::string templateJSONPath = QCoreApplication::applicationDirPath().toStdString() + "..\\Resources\\template.json"; +// 输出json文件路径 +const std::string caseJSONPath = QCoreApplication::applicationDirPath().toStdString() + "..\\Resources\\case-01.json"; +#endif // CFDSTRUCTDEFINE_H