You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
AppFlow/CFDStruct/CFDStructDataManager/CFDStructDataSolverSportsAt...

179 lines
9.1 KiB
C++

#include "CFDStructDataSolverTimeModeManager.h"
#include "CUIProperty/CUIConfig.h"
#include "CFDStructMain/CFDStructDefine.h"
#include "CFDStructSigsCenter.h"
#include "CUIProperty/CUISigsCenter.h"
#include <QVariant>
#include "CFDStructDataSolverSportsAttributesManager.h"
CFDStructDataSolverSportsAttributesItemManager::CFDStructDataSolverSportsAttributesItemManager(QObject *parent) : CFDStructDataManagerBase(parent)
{
m_uiConfig = nullptr;
}
CFDStructDataSolverSportsAttributesItemManager::~CFDStructDataSolverSportsAttributesItemManager()
{
// CFDStructDataManagerBase::~CFDStructDataManagerBase();
}
CUIConfig *CFDStructDataSolverSportsAttributesItemManager::getParamUIConfig()
{
if (m_MotionType == 0)
return genMovingFrameModeUIConfig();
if (m_MotionType == 1)
return genRigidBodyModeUIConfig();
return genMovingFrameModeUIConfig();
}
CUIConfig *CFDStructDataSolverSportsAttributesItemManager::genMovingFrameModeUIConfig()
{
return new CUIConfig({
{"type", "Widget"},
},
{
new CUIConfig({
{"type", "LineEdit"}, // 运动名称
{"name", tr("Sports name")},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_STRING},
{"value_origin", QVA_GLOBAL(&m_MotionName)},
},
{}),
new CUIConfig({
{"type", "ComboBox"}, // 运动类型
{"name", tr("Sports type")},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_INT},
{"value_origin", QVA_GLOBAL(&m_MotionType)},
{"semaphore", (int)SolutionAnalysisModuleProperty::Motion_Properties},
},
{
new CUIConfig({
{"type", "Item"}, // 运动坐标系
{"name", tr("Moving Frame")},
}),
new CUIConfig({
{"type", "Item"}, // 刚体
{"name", tr("RigidBody")},
}),
}),
new CUIConfig({
{"type", "GroupBox"}, // 运动特征
{"name", tr("Sports characteristics")},
},
{
new CUIConfig({
{"type", "LineEdit"}, // 运动方式
{"name", tr("Sports Style")},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_STRING},
{"value_origin", QVA_GLOBAL(&m_MotionMode)},
}),
new CUIConfig({
{"type", "LineEdit"}, // 转轴原点
{"name", tr("Axis origin")},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_STRING},
{"value_origin", QVA_GLOBAL(&m_RotationAxisOrigin)},
}),
new CUIConfig({
{"type", "LineEdit"}, // 转轴方向
{"name", tr("Axis direction")},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_STRING},
{"value_origin", QVA_GLOBAL(&m_RotationAxisDirection)},
}),
new CUIConfig({
{"type", "LineEdit"}, // 转速
{"name", tr("speed")},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_STRING},
{"value_origin", QVA_GLOBAL(&m_RotationSpeed)},
}),
}),
// TODO
new CUIConfig({
{"type", "List"}, // 域列表
{"name", tr("Domain List")},
},
{}),
});
return nullptr;
}
CUIConfig *CFDStructDataSolverSportsAttributesItemManager::genRigidBodyModeUIConfig()
{
return new CUIConfig({
{"type", "Widget"},
},
{
new CUIConfig({
{"type", "LineEdit"}, // 运动名称
{"name", tr("Sports name")},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_STRING},
{"value_origin", QVA_GLOBAL(&m_MotionName)},
},
{}),
new CUIConfig({
{"type", "ComboBox"}, // 运动类型
{"name", tr("Sports type")},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_INT},
{"value_origin", QVA_GLOBAL(&m_MotionType)},
{"semaphore", (int)SolutionAnalysisModuleProperty::Motion_Properties},
},
{
new CUIConfig({
{"type", "Item"}, // 运动坐标系
{"name", tr("Moving Frame")},
}),
new CUIConfig({
{"type", "Item"}, // 刚体
{"name", tr("RigidBody")},
}),
}),
new CUIConfig({
{"type", "GroupBox"}, // 用户自定义
{"name", tr("User defined")},
},
{
// TODO
new CUIConfig({
{"type", "LineEdit"}, // 打开文件
{"name", tr("Open file")},
}),
new CUIConfig({
{"type", "LineEdit"}, // 函数名称
{"name", tr("Function Name")},
}),
}),
// TODO
new CUIConfig({
{"type", "List"}, // 域列表
{"name", tr("Domain List")},
},
{}),
});
return nullptr;
}
CFDStructDataSolverSportsAttributesManager::CFDStructDataSolverSportsAttributesManager(QObject *parent)
{
m_itemList.push_back(new CFDStructDataSolverSportsAttributesItemManager);
}
CFDStructDataSolverSportsAttributesManager::~CFDStructDataSolverSportsAttributesManager()
{
}
CUIConfig *CFDStructDataSolverSportsAttributesManager::getParamUIConfig()
{
return m_itemList[0]->getParamUIConfig();
return NULL;
}
void CFDStructDataSolverSportsAttributesManager::addNewSportAttributesItem()
{
}
void CFDStructDataSolverSportsAttributesManager::deleteSportAttributesItem(int index)
{
}