|
|
|
@ -1,97 +1,89 @@
|
|
|
|
|
#include "CFDStructDataManager.h"
|
|
|
|
|
|
|
|
|
|
#include "CFDStructDataSolverTimeModeManager.h"
|
|
|
|
|
#include "CFDStructDataSolverBasicModelManager.h"
|
|
|
|
|
#include "CFDStructDataSolverKvislManager.h"
|
|
|
|
|
#include "CFDStructDataSolverNumericalMethodManager.h"
|
|
|
|
|
#include "CFDStructDataSolverTimeModeManager.h"
|
|
|
|
|
|
|
|
|
|
#include "CFDStructDataSolverSportsAttributesManager.h"
|
|
|
|
|
#include "CFDStructDataSolverBoundaryConditionManager.h"
|
|
|
|
|
#include "CFDStructDataSolverInitializationManager.h"
|
|
|
|
|
#include "CFDStructDataSolverReferenceQuantityManager.h"
|
|
|
|
|
#include "CFDStructDataSolverComputingControlManager.h"
|
|
|
|
|
#include "CFDStructDataSolverMonitorResidualManager.h"
|
|
|
|
|
#include "CFDStructDataSolverInitializationManager.h"
|
|
|
|
|
#include "CFDStructDataSolverMonitorAerodynamicManager.h"
|
|
|
|
|
#include "CFDStructDataSolverMonitorImpellerManager.h"
|
|
|
|
|
#include "CFDStructDataSolverMonitorResidualManager.h"
|
|
|
|
|
#include "CFDStructDataSolverReferenceQuantityManager.h"
|
|
|
|
|
#include "CFDStructDataSolverSportsAttributesManager.h"
|
|
|
|
|
|
|
|
|
|
#include "CUIProperty/CUIConfig.h"
|
|
|
|
|
|
|
|
|
|
#include <rapidjson/writer.h>
|
|
|
|
|
#include <rapidjson/stringbuffer.h>
|
|
|
|
|
#include <rapidjson/writer.h>
|
|
|
|
|
|
|
|
|
|
CFDStructDataManager *CFDStructDataManager::m_instance = NULL;
|
|
|
|
|
CFDStructDataManager::CFDStructDataManager()
|
|
|
|
|
{
|
|
|
|
|
CFDStructDataManager::CFDStructDataManager() {
|
|
|
|
|
this->initDataManagers();
|
|
|
|
|
this->initJson();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CFDStructDataManager *CFDStructDataManager::getInstance()
|
|
|
|
|
{
|
|
|
|
|
if (m_instance == nullptr)
|
|
|
|
|
{
|
|
|
|
|
CFDStructDataManager *CFDStructDataManager::getInstance() {
|
|
|
|
|
if (m_instance == nullptr) {
|
|
|
|
|
m_instance = new CFDStructDataManager;
|
|
|
|
|
}
|
|
|
|
|
return m_instance;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CUIConfig *CFDStructDataManager::getActionParamUIConfig(SolutionAnalysisModuleProperty sig, QVariant idx)
|
|
|
|
|
{
|
|
|
|
|
if (m_solverBoundaryConditionManager == nullptr)
|
|
|
|
|
{
|
|
|
|
|
CUIConfig *CFDStructDataManager::getActionParamUIConfig(SolutionAnalysisModuleProperty sig, QVariant idx) {
|
|
|
|
|
if (m_solverBoundaryConditionManager == nullptr) {
|
|
|
|
|
qDebug() << "manager is null";
|
|
|
|
|
}
|
|
|
|
|
CUIConfig *res = nullptr;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
switch (sig)
|
|
|
|
|
{
|
|
|
|
|
switch (sig) {
|
|
|
|
|
case SolutionAnalysisModuleProperty::Time_Mode:
|
|
|
|
|
res = m_solverTimeModeManager->getParamUIConfig();
|
|
|
|
|
break;
|
|
|
|
|
case SolutionAnalysisModuleProperty::Basic_Model:
|
|
|
|
|
res = m_solverBasicModeManager->getParamUIConfig();
|
|
|
|
|
break;
|
|
|
|
|
break;
|
|
|
|
|
case SolutionAnalysisModuleProperty::Viscosity_Model:
|
|
|
|
|
res = m_solverKvislManager->getParamUIConfig();
|
|
|
|
|
break;
|
|
|
|
|
break;
|
|
|
|
|
case SolutionAnalysisModuleProperty::NUumerical_Methods:
|
|
|
|
|
res = m_solverNumericalMethodManager->getParamUIConfig();
|
|
|
|
|
break;
|
|
|
|
|
break;
|
|
|
|
|
case SolutionAnalysisModuleProperty::Motion_Properties:
|
|
|
|
|
res = m_solverSportsAttributesManager->getParamUIConfig();
|
|
|
|
|
break;
|
|
|
|
|
break;
|
|
|
|
|
case SolutionAnalysisModuleProperty::Boundary_Conditions:
|
|
|
|
|
res = m_solverBoundaryConditionManager->getParamUIConfig();
|
|
|
|
|
break;
|
|
|
|
|
break;
|
|
|
|
|
case SolutionAnalysisModuleProperty::Initialization:
|
|
|
|
|
res = m_solverInitializationManager->getParamUIConfig();
|
|
|
|
|
break;
|
|
|
|
|
break;
|
|
|
|
|
case SolutionAnalysisModuleProperty::Computational_Control_Reference_Quantity:
|
|
|
|
|
res = m_solverReferenceQuantityManager->getParamUIConfig();
|
|
|
|
|
break;
|
|
|
|
|
break;
|
|
|
|
|
case SolutionAnalysisModuleProperty::Computational_Control:
|
|
|
|
|
res = m_solverComputingControlManager->getParamUIConfig();
|
|
|
|
|
break;
|
|
|
|
|
break;
|
|
|
|
|
case SolutionAnalysisModuleProperty::Monitors_Residual:
|
|
|
|
|
res = m_solverMonitorResidualManager->getParamUIConfig();
|
|
|
|
|
break;
|
|
|
|
|
break;
|
|
|
|
|
case SolutionAnalysisModuleProperty::Monitors_AerodynamicForce:
|
|
|
|
|
res = m_solverMonitorAerodynamicForceManager->getParamUIConfig();
|
|
|
|
|
break;
|
|
|
|
|
break;
|
|
|
|
|
case SolutionAnalysisModuleProperty::Monitors_Tubomachinery_Performance:
|
|
|
|
|
res = m_solverMonitorTubomachineryPerformanceManager->getParamUIConfig();
|
|
|
|
|
break;
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
if(res == nullptr)
|
|
|
|
|
if (res == nullptr)
|
|
|
|
|
qDebug() << "DataManager return null CUIConfig";
|
|
|
|
|
return res;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CFDStructDataManager::initDataManagers()
|
|
|
|
|
{
|
|
|
|
|
void CFDStructDataManager::initDataManagers() {
|
|
|
|
|
m_solverTimeModeManager = new CFDStructDataSolverTimeModeManager;
|
|
|
|
|
m_solverBasicModeManager = new CFDStructDataSolverBasicModelManager;
|
|
|
|
|
m_solverKvislManager = new CFDStructDataSolverKvislManager;
|
|
|
|
@ -106,13 +98,11 @@ void CFDStructDataManager::initDataManagers()
|
|
|
|
|
m_solverMonitorTubomachineryPerformanceManager = new CFDStructDataSolverMonitorImpellerManager;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CFDStructDataManager::initJson()
|
|
|
|
|
{
|
|
|
|
|
void CFDStructDataManager::initJson() {
|
|
|
|
|
m_dom.SetObject();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CFDStructDataManager::updateJson()
|
|
|
|
|
{
|
|
|
|
|
void CFDStructDataManager::updateJson() {
|
|
|
|
|
m_dom.SetObject();
|
|
|
|
|
|
|
|
|
|
m_solverTimeModeManager->saveDataToDom(m_dom);
|
|
|
|
@ -129,10 +119,8 @@ void CFDStructDataManager::updateJson()
|
|
|
|
|
m_solverMonitorTubomachineryPerformanceManager->saveDataToDom(m_dom);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include <iostream>
|
|
|
|
|
void CFDStructDataManager::printJson()
|
|
|
|
|
{
|
|
|
|
|
void CFDStructDataManager::printJson() {
|
|
|
|
|
using namespace rapidjson;
|
|
|
|
|
|
|
|
|
|
StringBuffer buffer;
|
|
|
|
|