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/CFDStructDataManager.cpp

51 lines
1.5 KiB
C++

#include "CFDStructDataManager.h"
#include "CFDStructDataSolverTimeModeManager.h"
#include "CFDStructDataSolverBasicModelManager.h"
#include "CFDStructDataSolverKvislManager.h"
#include "CFDStructDataSolverNumericalMethodManager.h"
#include "CUIProperty/CUIConfig.h"
CFDStructDataManager* CFDStructDataManager::m_instance = NULL;
CFDStructDataManager::CFDStructDataManager()
{
this->initDataManagers();
}
CFDStructDataManager *CFDStructDataManager::getInstance()
{
if (m_instance == nullptr) {
m_instance = new CFDStructDataManager;
}
return m_instance;
}
CUIConfig* CFDStructDataManager::getActionParamUIConfig(QString s)
{
if(s == "actionTimeModeEdit")
{
qDebug("DataManager create TimeMode CUIConfig");
return m_solverTimeModeManager->getParamUIConfig();
}
if(s == "actionBasicModelEdit")
return m_solverBasicModeManager->getParamUIConfig();
if(s == "actionViscosityModelEdit")
return m_solverKvislManager->getParamUIConfig();
if(s == "actionNumericalMethodsEdit")
return m_solverNumericalMethodManager->getParamUIConfig();
qDebug()<<"DataManager return null CUIConfig";
return nullptr;
}
void CFDStructDataManager::initDataManagers()
{
m_solverTimeModeManager = new CFDStructDataSolverTimeModeManager;
m_solverBasicModeManager = new CFDStructDataSolverBasicModelManager;
m_solverKvislManager = new CFDStructDataSolverKvislManager;
m_solverNumericalMethodManager = new CFDStructDataSolverNumericalMethodManager;
}