1、将saveDataToDom和readDataFromDom函数改为纯虚函数

2、实现各个继承base的类
3、添加运动属性备注-----运动区域相关
feature/struct-menu-20241023
mzh 1 week ago
parent ee50694540
commit 84b1ce0bf3

@ -1,35 +1,29 @@
#include "CFDStructDataSolverBoundaryConditionManager.h"
#include "CFDStructDataSolverTimeModeManager.h"
#include "CUIProperty/CUIConfig.h"
#include "CFDStructMain/CFDStructDefine.h"
#include "CFDStructSigsCenter.h"
#include "CUIProperty/CUIConfig.h"
#include "CUIProperty/CUISigsCenter.h"
#include <QVariant>
#include "CFDStructDataSolverBoundaryConditionManager.h"
CFDStructDataSolverBoundaryConditionManager::CFDStructDataSolverBoundaryConditionManager(QObject *parent) : CFDStructDataManagerBase(parent)
{
CFDStructDataSolverBoundaryConditionManager::CFDStructDataSolverBoundaryConditionManager(QObject *parent) : CFDStructDataManagerBase(parent) {
m_uiConfig = nullptr;
connect(m_cuiSigsCenter, &CUISigsCenter::sig_cuiPropertyChanged, this, [=](int semaphore)
{ emit CFDStructSigsCenter::getInstance() -> sig_solverTimeModeDataChanged(); });
connect(m_cuiSigsCenter, &CUISigsCenter::sig_cuiPropertyChanged, this, [=](int semaphore) { emit CFDStructSigsCenter::getInstance() -> sig_solverTimeModeDataChanged(); });
}
CFDStructDataSolverBoundaryConditionManager::~CFDStructDataSolverBoundaryConditionManager()
{
CFDStructDataSolverBoundaryConditionManager::~CFDStructDataSolverBoundaryConditionManager() {
// CFDStructDataManagerBase::~CFDStructDataManagerBase();
}
CUIConfig *CFDStructDataSolverBoundaryConditionManager::getParamUIConfig()
{
if (m_uiConfig != nullptr)
{
CUIConfig *CFDStructDataSolverBoundaryConditionManager::getParamUIConfig() {
if (m_uiConfig != nullptr) {
delete m_uiConfig;
m_uiConfig = nullptr;
}
qDebug() << "in manager " << m_BoundaryType;
if (m_BoundaryType == 0)
{
if (m_BoundaryType == 0) {
qDebug() << "walltype is :" << m_WallType;
if (m_WallType == 0)
return genWallAdiabaticWallUIConfig();
@ -43,35 +37,26 @@ CUIConfig *CFDStructDataSolverBoundaryConditionManager::getParamUIConfig()
if (m_BoundaryType == 1)
return genFarFieldModeUIConfig();
if (m_BoundaryType == 2)
{
if (m_BoundaryType_sub == 0)
{
if (m_VelocityDirectionType == 0)
{
if (m_BoundaryType == 2) {
if (m_BoundaryType_sub == 0) {
if (m_VelocityDirectionType == 0) {
return genPressureInletModeSupersonicCylindricalUIConfig();
}
if (m_VelocityDirectionType == 1)
{
if (m_VelocityDirectionType == 1) {
return genPressureInletModeSupersonicCartesianUIConfig();
}
if (m_VelocityDirectionType == 2)
{
if (m_VelocityDirectionType == 2) {
return genPressureInletModeSupersonicSurfaceUIConfig();
}
}
if (m_BoundaryType_sub == 1)
{
if (m_VelocityDirectionType == 0)
{
if (m_BoundaryType_sub == 1) {
if (m_VelocityDirectionType == 0) {
return genPressureInletModeSubsonicCylindricalUIConfig();
}
if (m_VelocityDirectionType == 1)
{
if (m_VelocityDirectionType == 1) {
return genPressureInletModeSubsonicCartesianUIConfig();
}
if (m_VelocityDirectionType == 2)
{
if (m_VelocityDirectionType == 2) {
return genPressureInletModeSubsonicSurfaceUIConfig();
}
}
@ -80,38 +65,36 @@ CUIConfig *CFDStructDataSolverBoundaryConditionManager::getParamUIConfig()
return genPressureOutletUIConfig();
if (m_BoundaryType == 4)
return genSymmetricUIConfig();
if (m_BoundaryType == 5)
{
if (m_BoundaryType == 5) {
return genSupersonicOutlet_ExtrapolateUIConfig();
}
if (m_BoundaryType == 6)
{
if (m_BoundaryType == 6) {
return genMeshInterfaceUIConfig();
}
if (m_BoundaryType == 7)
{
if (m_BoundaryType == 7) {
if (m_PeriodicType == 0)
return genCycleTranslationUIConfig();
if (m_PeriodicType == 1)
return genCycleRotationUIConfig();
return genCycleTranslationUIConfig();
}
if (m_BoundaryType == 8)
{
if (m_BoundaryType == 8) {
return genMassFlowOutletUIConfig();
}
return m_uiConfig;
}
void CFDStructDataSolverBoundaryConditionManager::saveDataToDom(rapidjson::Document &dom)
{
void CFDStructDataSolverBoundaryConditionManager::saveDataToDom(rapidjson::Document &dom) {
// TODO
}
void CFDStructDataSolverBoundaryConditionManager::readDataFromDom(rapidjson::Document &dom) {
// TODO
}
CUIConfig *CFDStructDataSolverBoundaryConditionManager::genFarFieldModeUIConfig()
{
CUIConfig *CFDStructDataSolverBoundaryConditionManager::genFarFieldModeUIConfig() {
return new CUIConfig({{"type", "Widget"}}, {
new CUIConfig({
@ -233,8 +216,7 @@ CUIConfig *CFDStructDataSolverBoundaryConditionManager::genFarFieldModeUIConfig(
return nullptr;
}
CUIConfig *CFDStructDataSolverBoundaryConditionManager::genPressureInletModeSupersonicCylindricalUIConfig()
{
CUIConfig *CFDStructDataSolverBoundaryConditionManager::genPressureInletModeSupersonicCylindricalUIConfig() {
return new CUIConfig({{"type", "Widget"}}, {
new CUIConfig({
{"type", "LineEdit"}, // 边界名称
@ -381,8 +363,7 @@ CUIConfig *CFDStructDataSolverBoundaryConditionManager::genPressureInletModeSupe
});
}
CUIConfig *CFDStructDataSolverBoundaryConditionManager::genPressureInletModeSupersonicCartesianUIConfig()
{
CUIConfig *CFDStructDataSolverBoundaryConditionManager::genPressureInletModeSupersonicCartesianUIConfig() {
return new CUIConfig({{"type", "Widget"}}, {
new CUIConfig({
{"type", "LineEdit"}, // 边界名称
@ -529,8 +510,7 @@ CUIConfig *CFDStructDataSolverBoundaryConditionManager::genPressureInletModeSupe
});
}
CUIConfig *CFDStructDataSolverBoundaryConditionManager::genPressureInletModeSupersonicSurfaceUIConfig()
{
CUIConfig *CFDStructDataSolverBoundaryConditionManager::genPressureInletModeSupersonicSurfaceUIConfig() {
return new CUIConfig({{"type", "Widget"}}, {
new CUIConfig({
{"type", "LineEdit"}, // 边界名称
@ -670,8 +650,7 @@ CUIConfig *CFDStructDataSolverBoundaryConditionManager::genPressureInletModeSupe
});
}
CUIConfig *CFDStructDataSolverBoundaryConditionManager::genPressureInletModeSubsonicCylindricalUIConfig()
{
CUIConfig *CFDStructDataSolverBoundaryConditionManager::genPressureInletModeSubsonicCylindricalUIConfig() {
return new CUIConfig({{"type", "Widget"}}, {
new CUIConfig({
{"type", "LineEdit"}, // 边界名称
@ -812,8 +791,7 @@ CUIConfig *CFDStructDataSolverBoundaryConditionManager::genPressureInletModeSubs
return nullptr;
}
CUIConfig *CFDStructDataSolverBoundaryConditionManager::genPressureInletModeSubsonicCartesianUIConfig()
{
CUIConfig *CFDStructDataSolverBoundaryConditionManager::genPressureInletModeSubsonicCartesianUIConfig() {
return new CUIConfig({{"type", "Widget"}}, {
new CUIConfig({
{"type", "LineEdit"}, // 边界名称
@ -953,8 +931,7 @@ CUIConfig *CFDStructDataSolverBoundaryConditionManager::genPressureInletModeSubs
});
}
CUIConfig *CFDStructDataSolverBoundaryConditionManager::genPressureInletModeSubsonicSurfaceUIConfig()
{
CUIConfig *CFDStructDataSolverBoundaryConditionManager::genPressureInletModeSubsonicSurfaceUIConfig() {
return new CUIConfig({{"type", "Widget"}}, {
new CUIConfig({
{"type", "LineEdit"}, // 边界名称
@ -1087,8 +1064,7 @@ CUIConfig *CFDStructDataSolverBoundaryConditionManager::genPressureInletModeSubs
});
}
CUIConfig *CFDStructDataSolverBoundaryConditionManager::genPressureOutletUIConfig()
{
CUIConfig *CFDStructDataSolverBoundaryConditionManager::genPressureOutletUIConfig() {
return new CUIConfig({{"type", "Widget"}}, {
new CUIConfig({
{"type", "LineEdit"}, // 边界名称
@ -1188,8 +1164,7 @@ CUIConfig *CFDStructDataSolverBoundaryConditionManager::genPressureOutletUIConfi
return nullptr;
}
CUIConfig *CFDStructDataSolverBoundaryConditionManager::genSymmetricUIConfig()
{
CUIConfig *CFDStructDataSolverBoundaryConditionManager::genSymmetricUIConfig() {
return new CUIConfig({{"type", "Widget"}}, {
new CUIConfig({
{"type", "LineEdit"}, // 边界名称
@ -1256,8 +1231,7 @@ CUIConfig *CFDStructDataSolverBoundaryConditionManager::genSymmetricUIConfig()
return nullptr;
}
CUIConfig *CFDStructDataSolverBoundaryConditionManager::genSupersonicOutlet_ExtrapolateUIConfig()
{
CUIConfig *CFDStructDataSolverBoundaryConditionManager::genSupersonicOutlet_ExtrapolateUIConfig() {
return new CUIConfig({{"type", "Widget"}}, {
new CUIConfig({
{"type", "LineEdit"}, // 边界名称
@ -1323,8 +1297,7 @@ CUIConfig *CFDStructDataSolverBoundaryConditionManager::genSupersonicOutlet_Extr
});
}
CUIConfig *CFDStructDataSolverBoundaryConditionManager::genMeshInterfaceUIConfig()
{
CUIConfig *CFDStructDataSolverBoundaryConditionManager::genMeshInterfaceUIConfig() {
return new CUIConfig({{"type", "Widget"}}, {
new CUIConfig({
{"type", "LineEdit"}, // 边界名称
@ -1407,8 +1380,7 @@ CUIConfig *CFDStructDataSolverBoundaryConditionManager::genMeshInterfaceUIConfig
});
}
CUIConfig *CFDStructDataSolverBoundaryConditionManager::genCycleTranslationUIConfig()
{
CUIConfig *CFDStructDataSolverBoundaryConditionManager::genCycleTranslationUIConfig() {
return new CUIConfig({{"type", "Widget"}}, {
new CUIConfig({
{"type", "LineEdit"}, // 边界名称
@ -1513,8 +1485,7 @@ CUIConfig *CFDStructDataSolverBoundaryConditionManager::genCycleTranslationUICon
return nullptr;
}
CUIConfig *CFDStructDataSolverBoundaryConditionManager::genCycleRotationUIConfig()
{
CUIConfig *CFDStructDataSolverBoundaryConditionManager::genCycleRotationUIConfig() {
return new CUIConfig({{"type", "Widget"}}, {
new CUIConfig({
{"type", "LineEdit"}, // 边界名称
@ -1633,8 +1604,7 @@ CUIConfig *CFDStructDataSolverBoundaryConditionManager::genCycleRotationUIConfig
return nullptr;
}
CUIConfig *CFDStructDataSolverBoundaryConditionManager::genMassFlowOutletUIConfig()
{
CUIConfig *CFDStructDataSolverBoundaryConditionManager::genMassFlowOutletUIConfig() {
return new CUIConfig({{"type", "Widget"}}, {
new CUIConfig({
{"type", "LineEdit"}, // 边界名称
@ -1737,8 +1707,7 @@ CUIConfig *CFDStructDataSolverBoundaryConditionManager::genMassFlowOutletUIConfi
});
}
CUIConfig *CFDStructDataSolverBoundaryConditionManager::genWallAdiabaticWallUIConfig()
{
CUIConfig *CFDStructDataSolverBoundaryConditionManager::genWallAdiabaticWallUIConfig() {
return new CUIConfig({{"type", "Widget"}}, {
new CUIConfig({
{"type", "LineEdit"}, // 边界名称
@ -1847,8 +1816,7 @@ CUIConfig *CFDStructDataSolverBoundaryConditionManager::genWallAdiabaticWallUICo
return nullptr;
}
CUIConfig *CFDStructDataSolverBoundaryConditionManager::genWallIsothermalWallUIConfig()
{
CUIConfig *CFDStructDataSolverBoundaryConditionManager::genWallIsothermalWallUIConfig() {
return new CUIConfig({{"type", "Widget"}}, {
new CUIConfig({
{"type", "LineEdit"}, // 边界名称
@ -1963,8 +1931,7 @@ CUIConfig *CFDStructDataSolverBoundaryConditionManager::genWallIsothermalWallUIC
return nullptr;
}
CUIConfig *CFDStructDataSolverBoundaryConditionManager::genWallHotFlowWallUIConfig()
{
CUIConfig *CFDStructDataSolverBoundaryConditionManager::genWallHotFlowWallUIConfig() {
return new CUIConfig({{"type", "Widget"}}, {
new CUIConfig({
{"type", "LineEdit"}, // 边界名称

@ -4,21 +4,21 @@
#ifndef CFDSTRUCTDATASOLVERBOUNDARYCONDITIONEMANAGER_H
#define CFDSTRUCTDATASOLVERBOUNDARYCONDITIONEMANAGER_H
#include <CFDStructDataManagerBase.h>
#include "CFDStructDataManager_global.h"
#include <CFDStructDataManagerBase.h>
class CUIConfig;
class CFDSTRUCTDATAMANAGER_EXPORT CFDStructDataSolverBoundaryConditionManager : public CFDStructDataManagerBase
{
class CFDSTRUCTDATAMANAGER_EXPORT CFDStructDataSolverBoundaryConditionManager : public CFDStructDataManagerBase {
Q_OBJECT
public:
public:
explicit CFDStructDataSolverBoundaryConditionManager(QObject *parent = nullptr);
~CFDStructDataSolverBoundaryConditionManager();
CUIConfig *getParamUIConfig();
void saveDataToDom(rapidjson::Document &dom);
void readDataFromDom(rapidjson::Document &dom);
private:
private:
// 生成界面配置 壁面 绝热壁
CUIConfig *genWallAdiabaticWallUIConfig();
// 生成界面配置 壁面 绝热壁
@ -42,7 +42,6 @@ private:
// 生成界面配置 压强入口 亚声速 面法相
CUIConfig *genPressureInletModeSubsonicSurfaceUIConfig();
// 生成界面配置 压强出口
CUIConfig *genPressureOutletUIConfig();
@ -62,9 +61,9 @@ private:
// 流量出口
CUIConfig *genMassFlowOutletUIConfig();
signals:
signals:
private:
private:
// 边界名称
QString m_BoundaryName; // Boundary Name
@ -149,16 +148,16 @@ private:
// 压强松弛因子
double m_PressureRelaxationFactor = 0;
//速度方向类型
// 速度方向类型
int m_VelocityDirectionType = 0;
//方向矢量
// 方向矢量
QString m_DirectionVector = "";
//边界类型,选中总压入口时,出现的子选项,可选声速、亚声速
// 边界类型,选中总压入口时,出现的子选项,可选声速、亚声速
int m_BoundaryType_sub = 0;
//用户自定义
// 用户自定义
int m_UserDefined = 0;
};

@ -1,201 +1,198 @@
#include "CFDStructDataSolverInitializationManager.h"
#include "CFDStructDataSolverTimeModeManager.h"
#include "CUIProperty/CUIConfig.h"
#include "CFDStructMain/CFDStructDefine.h"
#include "CFDStructSigsCenter.h"
#include "CUIProperty/CUIConfig.h"
#include "CUIProperty/CUISigsCenter.h"
#include <QVariant>
#include "CFDStructDataSolverInitializationManager.h"
CFDStructDataSolverInitializationManager::CFDStructDataSolverInitializationManager(QObject *parent) : CFDStructDataManagerBase(parent)
{
CFDStructDataSolverInitializationManager::CFDStructDataSolverInitializationManager(QObject *parent) : CFDStructDataManagerBase(parent) {
m_uiConfig = nullptr;
connect(m_cuiSigsCenter, &CUISigsCenter::sig_cuiPropertyChanged, this, [=](int semaphore)
{ emit CFDStructSigsCenter::getInstance() -> sig_solverTimeModeDataChanged(); });
connect(m_cuiSigsCenter, &CUISigsCenter::sig_cuiPropertyChanged, this, [=](int semaphore) { emit CFDStructSigsCenter::getInstance() -> sig_solverTimeModeDataChanged(); });
}
CFDStructDataSolverInitializationManager::~CFDStructDataSolverInitializationManager()
{
CFDStructDataSolverInitializationManager::~CFDStructDataSolverInitializationManager() {
// CFDStructDataManagerBase::~CFDStructDataManagerBase();
}
CUIConfig *CFDStructDataSolverInitializationManager::getParamUIConfig()
{
if (m_uiConfig != nullptr)
{
CUIConfig *CFDStructDataSolverInitializationManager::getParamUIConfig() {
if (m_uiConfig != nullptr) {
delete m_uiConfig;
m_uiConfig = nullptr;
}
if(m_CoordinateSystem == 0)
if (m_CoordinateSystem == 0)
return genCylindricalUIConfig();
if(m_CoordinateSystem == 1)
if (m_CoordinateSystem == 1)
return genCartesianUIConfig();
return m_uiConfig;
}
void CFDStructDataSolverInitializationManager::saveDataToDom(rapidjson::Document &dom)
{
void CFDStructDataSolverInitializationManager::saveDataToDom(rapidjson::Document &dom) {
// TODO
}
void CFDStructDataSolverInitializationManager::readDataFromDom(rapidjson::Document &dom) {
// TODO
}
CUIConfig *CFDStructDataSolverInitializationManager::genCylindricalUIConfig()
{
CUIConfig *CFDStructDataSolverInitializationManager::genCylindricalUIConfig() {
return new CUIConfig({
{"type", "Widget"},
},
{
new CUIConfig({
{"type", "ComboBox"}, // 参考值取自
{"name", tr("The reference value is taken from")},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_INT},
{"value_origin", QVA_GLOBAL(&m_ReferenceValuesFrom)},
},
{}),
{"type", "Widget"},
},
{
new CUIConfig({
{"type", "ComboBox"}, // 参考值取自
{"name", tr("The reference value is taken from")},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_INT},
{"value_origin", QVA_GLOBAL(&m_ReferenceValuesFrom)},
},
{}),
new CUIConfig({
{"type", "ComboBox"}, // 坐标系
{"name", tr("Coordinate System")},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_INT},
{"value_origin", QVA_GLOBAL(&m_CoordinateSystem)},
{"semaphore", (int)SolutionAnalysisModuleProperty::Initialization},
},
{
new CUIConfig({
{"type", "Item"},
{"name", "Cylindrical Coordinate System"},
}),
new CUIConfig({
{"type", "Item"},
{"name", "Cartesian Coordinate System"},
}),
}),
new CUIConfig({
{"type","ComboBox"},//坐标系
{"name",tr("Coordinate System")},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_INT},
{"value_origin", QVA_GLOBAL(&m_CoordinateSystem)},
{"semaphore", (int)SolutionAnalysisModuleProperty::Initialization},
},{
new CUIConfig({
{"type","Item"},
{"name","Cylindrical Coordinate System"},
}),
new CUIConfig({
{"type","Item"},
{"name","Cartesian Coordinate System"},
}),
}),
new CUIConfig({
{"type", "GroupBox"}, // 初始值定义
{"name", tr("Initial value definition")},
},
{
new CUIConfig({
{"type", "LineEdit"}, // 密度
{"name", tr("density")},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE},
{"value_origin", QVA_GLOBAL(&m_Density)},
}),
new CUIConfig({
{"type", "LineEdit"}, // 展向速度vr
{"name", tr("Vr")},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE},
{"value_origin", QVA_GLOBAL(&m_Vr)},
}),
new CUIConfig({
{"type", "LineEdit"}, // 周向速度Vtheta
{"name", tr("Vtheta")},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE},
{"value_origin", QVA_GLOBAL(&m_Vtheta)},
}),
new CUIConfig({
{"type", "LineEdit"}, // 轴向速度Vz
{"name", tr("Vz")},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE},
{"value_origin", QVA_GLOBAL(&m_Vz)},
}),
new CUIConfig({
{"type", "LineEdit"}, // 压强
{"name", tr("pressure")},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE},
{"value_origin", QVA_GLOBAL(&m_Pressure)},
}),
new CUIConfig({
{"type", "LineEdit"}, // 湍流粘性比
{"name", tr("Turbulent viscosity ratio")},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE},
{"value_origin", QVA_GLOBAL(&m_TurbulentViscosityRatio)},
}),
new CUIConfig({
{"type", "LineEdit"}, // 湍流强度
{"name", tr("Turbulence intensity")},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE},
{"value_origin", QVA_GLOBAL(&m_TurbulentIntensity)},
}),
}),
});
{"type", "GroupBox"}, // 初始值定义
{"name", tr("Initial value definition")},
},
{
new CUIConfig({
{"type", "LineEdit"}, // 密度
{"name", tr("density")},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE},
{"value_origin", QVA_GLOBAL(&m_Density)},
}),
new CUIConfig({
{"type", "LineEdit"}, // 展向速度vr
{"name", tr("Vr")},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE},
{"value_origin", QVA_GLOBAL(&m_Vr)},
}),
new CUIConfig({
{"type", "LineEdit"}, // 周向速度Vtheta
{"name", tr("Vtheta")},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE},
{"value_origin", QVA_GLOBAL(&m_Vtheta)},
}),
new CUIConfig({
{"type", "LineEdit"}, // 轴向速度Vz
{"name", tr("Vz")},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE},
{"value_origin", QVA_GLOBAL(&m_Vz)},
}),
new CUIConfig({
{"type", "LineEdit"}, // 压强
{"name", tr("pressure")},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE},
{"value_origin", QVA_GLOBAL(&m_Pressure)},
}),
new CUIConfig({
{"type", "LineEdit"}, // 湍流粘性比
{"name", tr("Turbulent viscosity ratio")},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE},
{"value_origin", QVA_GLOBAL(&m_TurbulentViscosityRatio)},
}),
new CUIConfig({
{"type", "LineEdit"}, // 湍流强度
{"name", tr("Turbulence intensity")},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE},
{"value_origin", QVA_GLOBAL(&m_TurbulentIntensity)},
}),
}),
});
}
CUIConfig *CFDStructDataSolverInitializationManager::genCartesianUIConfig()
{
CUIConfig *CFDStructDataSolverInitializationManager::genCartesianUIConfig() {
return new CUIConfig({
{"type", "Widget"},
},
{
new CUIConfig({
{"type", "ComboBox"}, // 参考值取自
{"name", tr("The reference value is taken from")},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_INT},
{"value_origin", QVA_GLOBAL(&m_ReferenceValuesFrom)},
},
{}),
{"type", "Widget"},
},
{
new CUIConfig({
{"type", "ComboBox"}, // 参考值取自
{"name", tr("The reference value is taken from")},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_INT},
{"value_origin", QVA_GLOBAL(&m_ReferenceValuesFrom)},
},
{}),
new CUIConfig({
{"type", "ComboBox"}, // 坐标系
{"name", tr("Coordinate System")},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_INT},
{"value_origin", QVA_GLOBAL(&m_CoordinateSystem)},
{"semaphore", (int)SolutionAnalysisModuleProperty::Initialization},
},
{
new CUIConfig({
{"type", "Item"},
{"name", "Cylindrical Coordinate System"},
}),
new CUIConfig({
{"type", "Item"},
{"name", "Cartesian Coordinate System"},
}),
}),
new CUIConfig({
{"type","ComboBox"},//坐标系
{"name",tr("Coordinate System")},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_INT},
{"value_origin", QVA_GLOBAL(&m_CoordinateSystem)},
{"semaphore", (int)SolutionAnalysisModuleProperty::Initialization},
},{
new CUIConfig({
{"type","Item"},
{"name","Cylindrical Coordinate System"},
}),
new CUIConfig({
{"type","Item"},
{"name","Cartesian Coordinate System"},
}),
}),
new CUIConfig({
{"type", "GroupBox"}, // 初始值定义
{"name", tr("Initial value definition")},
},
{
new CUIConfig({
{"type", "LineEdit"}, // 密度
{"name", tr("density")},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE},
{"value_origin", QVA_GLOBAL(&m_Density)},
}),
new CUIConfig({
{"type", "LineEdit"}, // vx
{"name", tr("Vx")},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE},
{"value_origin", QVA_GLOBAL(&m_Vx)},
}),
new CUIConfig({
{"type", "LineEdit"}, // vy
{"name", tr("Vy")},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE},
{"value_origin", QVA_GLOBAL(&m_Vy)},
}),
new CUIConfig({
{"type", "LineEdit"}, // vz
{"name", tr("Vz")},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE},
{"value_origin", QVA_GLOBAL(&m_Vz)},
}),
new CUIConfig({
{"type", "LineEdit"}, // 压强
{"name", tr("pressure")},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE},
{"value_origin", QVA_GLOBAL(&m_Pressure)},
}),
new CUIConfig({
{"type", "LineEdit"}, // 湍流粘性比
{"name", tr("Turbulent viscosity ratio")},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE},
{"value_origin", QVA_GLOBAL(&m_TurbulentViscosityRatio)},
}),
new CUIConfig({
{"type", "LineEdit"}, // 湍流强度
{"name", tr("Turbulence intensity")},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE},
{"value_origin", QVA_GLOBAL(&m_TurbulentIntensity)},
}),
}),
});
{"type", "GroupBox"}, // 初始值定义
{"name", tr("Initial value definition")},
},
{
new CUIConfig({
{"type", "LineEdit"}, // 密度
{"name", tr("density")},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE},
{"value_origin", QVA_GLOBAL(&m_Density)},
}),
new CUIConfig({
{"type", "LineEdit"}, // vx
{"name", tr("Vx")},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE},
{"value_origin", QVA_GLOBAL(&m_Vx)},
}),
new CUIConfig({
{"type", "LineEdit"}, // vy
{"name", tr("Vy")},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE},
{"value_origin", QVA_GLOBAL(&m_Vy)},
}),
new CUIConfig({
{"type", "LineEdit"}, // vz
{"name", tr("Vz")},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE},
{"value_origin", QVA_GLOBAL(&m_Vz)},
}),
new CUIConfig({
{"type", "LineEdit"}, // 压强
{"name", tr("pressure")},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE},
{"value_origin", QVA_GLOBAL(&m_Pressure)},
}),
new CUIConfig({
{"type", "LineEdit"}, // 湍流粘性比
{"name", tr("Turbulent viscosity ratio")},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE},
{"value_origin", QVA_GLOBAL(&m_TurbulentViscosityRatio)},
}),
new CUIConfig({
{"type", "LineEdit"}, // 湍流强度
{"name", tr("Turbulence intensity")},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE},
{"value_origin", QVA_GLOBAL(&m_TurbulentIntensity)},
}),
}),
});
}

@ -17,6 +17,7 @@ public:
CUIConfig *getParamUIConfig();
void saveDataToDom(rapidjson::Document &dom);
void readDataFromDom(rapidjson::Document &dom);
private:
// 生成界面配置 柱坐标系

@ -28,6 +28,7 @@ void CFDStructDataSolverSportsAttributesItemManager::saveDataToDom(rapidjson::Do
jsonAdd(dom, m_id, {"region", 0, "motion", this->getId(), "id"});
jsonAdd(dom, m_MotionName, {"region", 0, "motion", this->getId(), "meshMotion", "name"});
jsonAdd(dom, m_MotionType, {"region", 0, "motion", this->getId(), "meshMotion", "MotionType"});
jsonAdd(dom, m_MotionMode, {"region", 0, "motion", this->getId(), "meshMotion", "attrtype"});
jsonAdd(dom, m_RotationAxisOrigin, {"region", 0, "motion", this->getId(), "meshMotion", "rigid", "origin"});
jsonAdd(dom, m_RotationAxisDirection, {"region", 0, "motion", this->getId(), "meshMotion", "rigid", "axial"});
jsonAdd(dom, m_RotationSpeed, {"region", 0, "motion", this->getId(), "meshMotion", "rigid", "speed"});
@ -212,6 +213,10 @@ void CFDStructDataSolverSportsAttributesManager::saveDataToDom(rapidjson::Docume
}
}
void CFDStructDataSolverSportsAttributesManager::readDataFromDom(rapidjson::Document &dom) {
// TODO
}
void CFDStructDataSolverSportsAttributesManager::addNewSportAttributesItem() {
CFDStructDataSolverSportsAttributesItemManager *item = new CFDStructDataSolverSportsAttributesItemManager;
item->setId(m_itemList.size());

@ -53,6 +53,11 @@ class CFDSTRUCTDATAMANAGER_EXPORT CFDStructDataSolverSportsAttributesItemManager
// 转速
double m_RotationSpeed; // Rotation Speed in rpm
/**
* TODO
* jsonregion[0] motion[$1] meshMotion zone[$2]
*/
};
class CFDSTRUCTDATAMANAGER_EXPORT CFDStructDataSolverSportsAttributesManager : public CFDStructDataManagerBase {
@ -64,6 +69,8 @@ class CFDSTRUCTDATAMANAGER_EXPORT CFDStructDataSolverSportsAttributesManager : p
CUIConfig *getParamUIConfig();
void saveDataToDom(rapidjson::Document &dom);
void readDataFromDom(rapidjson::Document &dom);
private:
// // 生成运动坐标系的界面配置
// CUIConfig* genMovingFrameModeUIConfig();

@ -34,7 +34,7 @@
"accuracy": 2,
"limiter": 0,
"timeType": 0,
"iterType": 0,
"iterType": 2,
"lussor": 0.5,
"gridLevelNum": 0,
"cycleType": 0,

Loading…
Cancel
Save