|
|
|
@ -1,5 +1,30 @@
|
|
|
|
|
#include "CFDTreeWidget.h"
|
|
|
|
|
|
|
|
|
|
#include "GUIFrame/MainWindow.h"
|
|
|
|
|
#include "GUIFrame/PropertyWidget.h"
|
|
|
|
|
#include "GUIFrame/MainTreeWidget.h"
|
|
|
|
|
#include "OperatorsInterface/GraphEventOperator.h"
|
|
|
|
|
#include "OperatorsInterface/TreeEventOperator.h"
|
|
|
|
|
#include "CFDOperatorsModel/CFDOperatorsTimeModeManager.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "FITK_Kernel/FITKAppFramework/FITKAppFramework.h"
|
|
|
|
|
#include "FITK_Kernel/FITKAppFramework/FITKGlobalData.h"
|
|
|
|
|
#include "FITK_Kernel/FITKCore/FITKOperatorRepo.h"
|
|
|
|
|
#include "FITK_Kernel/FITKCore/FITKActionOperator.h"
|
|
|
|
|
#include "FITK_Interface/FITKInterfaceFlowOF/FITKOFGeometryData.h"
|
|
|
|
|
#include "FITK_Interface/FITKInterfaceFlowOF/FITKOFEnum.hpp"
|
|
|
|
|
#include "FITK_Interface/FITKInterfaceFlowOF/FITKAbstractOFSolver.h"
|
|
|
|
|
#include "FITK_Interface/FITKInterfaceFlowOF/FITKOFPhysicsData.h"
|
|
|
|
|
#include "FITK_Interface/FITKInterfaceFlowOF/FITKOFBoundary.h"
|
|
|
|
|
#include "FITK_Interface/FITKInterfaceGeometry/FITKAbsGeoCommand.h"
|
|
|
|
|
#include "FITK_Interface/FITKInterfaceModel/FITKAbstractGeoModel.h"
|
|
|
|
|
#include "FITK_Interface/FITKInterfaceMeshGen/FITKMeshGenInterface.h"
|
|
|
|
|
#include "FITK_Interface/FITKInterfaceMeshGen/FITKAbstractGeometryMeshSizeGenerator.h"
|
|
|
|
|
#include "FITK_Interface/FITKInterfaceMeshGen/FITKGeometryMeshSize.h"
|
|
|
|
|
#include "FITK_Interface/FITKInterfaceMesh/FITKUnstructuredFluidMeshVTK.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include <QWidget>
|
|
|
|
|
#include <GUIFrame/PropertyWidget.h>
|
|
|
|
|
#include <QLabel>
|
|
|
|
@ -14,10 +39,9 @@ namespace GUI{
|
|
|
|
|
|
|
|
|
|
//右键 不可少否则右键无反应
|
|
|
|
|
setContextMenuPolicy(Qt::CustomContextMenu);
|
|
|
|
|
disconnect(this, SIGNAL(itemClicked(QTreeWidgetItem*, int)), nullptr, nullptr);
|
|
|
|
|
connect(this, SIGNAL(itemClicked(QTreeWidgetItem*, int)), this, SLOT(onItemClicked(QTreeWidgetItem*, int)));
|
|
|
|
|
connect(this, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(onModelCustomContextMenu(QPoint)));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CFDTreeWidget::updateTree(QString s){
|
|
|
|
@ -38,7 +62,7 @@ namespace GUI{
|
|
|
|
|
QTreeWidgetItem* GeometryAndMeshingItem = new QTreeWidgetItem();
|
|
|
|
|
GeometryAndMeshingItem->setText(0,tr("Preprocessing"));
|
|
|
|
|
GeometryAndMeshingItem->setData(1,0,-1);
|
|
|
|
|
// GeometryAndMeshingItem->setData(2, 0, QVariant::fromValue(GUI::MainTreeEnum::MainTree_Mesh));
|
|
|
|
|
// GeometryAndMeshingItem->setData(2, 0, QVariant::fromValue(GUI::SolutionAnalysisTreeEnum::SATree_GeometryandMeshing));
|
|
|
|
|
this->addTopLevelItem(GeometryAndMeshingItem);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -47,53 +71,62 @@ namespace GUI{
|
|
|
|
|
QTreeWidgetItem* GeometryAndMeshingItem = new QTreeWidgetItem();
|
|
|
|
|
GeometryAndMeshingItem->setText(0,tr("Geometry and Meshing"));
|
|
|
|
|
GeometryAndMeshingItem->setData(1,0,-1);
|
|
|
|
|
// GeometryAndMeshingItem->setData(2, 0, QVariant::fromValue(GUI::MainTreeEnum::MainTree_Mesh));
|
|
|
|
|
GeometryAndMeshingItem->setData(2, 0, QVariant::fromValue(GUI::SolutionAnalysisTreeEnum::SATree_GeometryandMeshing));
|
|
|
|
|
this->addTopLevelItem(GeometryAndMeshingItem);
|
|
|
|
|
|
|
|
|
|
QTreeWidgetItem* mesh = new QTreeWidgetItem();
|
|
|
|
|
mesh->setText(0,tr("Mesh001"));
|
|
|
|
|
mesh->setData(1,0,-1);
|
|
|
|
|
// mesh->setdata(2,0,QVariant::fromValue(GUI::SolutionAnalysisTreeEnum::))
|
|
|
|
|
GeometryAndMeshingItem->addChild(mesh);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QTreeWidgetItem* ComputationalSetupItem = new QTreeWidgetItem();
|
|
|
|
|
ComputationalSetupItem->setText(0,tr("Computational Setup"));
|
|
|
|
|
ComputationalSetupItem->setData(1,0,-1);
|
|
|
|
|
ComputationalSetupItem->setData(2, 0, QVariant::fromValue(GUI::SolutionAnalysisTreeEnum::SATree_ComputationalSetup));
|
|
|
|
|
this->addTopLevelItem(ComputationalSetupItem);
|
|
|
|
|
|
|
|
|
|
QTreeWidgetItem* TimeModeItem = new QTreeWidgetItem();
|
|
|
|
|
TimeModeItem->setText(0,tr("Time Mode"));
|
|
|
|
|
TimeModeItem->setData(1,0,-1);
|
|
|
|
|
TimeModeItem->setData(2, 0, QVariant::fromValue(GUI::SolutionAnalysisTreeEnum::SATree_ComputationalSetupTimeMode));
|
|
|
|
|
ComputationalSetupItem->addChild(TimeModeItem);
|
|
|
|
|
|
|
|
|
|
QTreeWidgetItem* ComputationalDomainItem = new QTreeWidgetItem();
|
|
|
|
|
ComputationalDomainItem->setText(0,tr("Computational Domain"));
|
|
|
|
|
ComputationalDomainItem->setData(1,0,-1);
|
|
|
|
|
ComputationalDomainItem->setData(2, 0, QVariant::fromValue(GUI::SolutionAnalysisTreeEnum::SATree_ComputationalSetupComputationalDomain));
|
|
|
|
|
ComputationalSetupItem->addChild(ComputationalDomainItem);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QTreeWidgetItem* SolverItem = new QTreeWidgetItem();
|
|
|
|
|
SolverItem->setText(0,tr("Solver"));
|
|
|
|
|
SolverItem->setData(1,0,-1);
|
|
|
|
|
SolverItem->setData(2, 0, QVariant::fromValue(GUI::SolutionAnalysisTreeEnum::SATree_ComputationalSetupComputationalDomainSolver));
|
|
|
|
|
ComputationalDomainItem->addChild(SolverItem);
|
|
|
|
|
|
|
|
|
|
QTreeWidgetItem* BasicModelItem = new QTreeWidgetItem();
|
|
|
|
|
BasicModelItem->setText(0,tr("Basic Model"));
|
|
|
|
|
BasicModelItem->setData(1,0,-1);
|
|
|
|
|
BasicModelItem->setData(2, 0, QVariant::fromValue(GUI::SolutionAnalysisTreeEnum::SATree_ComputationalSetupComputationalDomainSolverBasicModel));
|
|
|
|
|
SolverItem->addChild(BasicModelItem);
|
|
|
|
|
QTreeWidgetItem* ViscosityModelItem = new QTreeWidgetItem();
|
|
|
|
|
ViscosityModelItem->setText(0,tr("Viscosity Model"));
|
|
|
|
|
ViscosityModelItem->setData(1,0,-1);
|
|
|
|
|
ViscosityModelItem->setData(2, 0, QVariant::fromValue(GUI::SolutionAnalysisTreeEnum::SATree_ComputationalSetupComputationalDomainSolverViscosityModel));
|
|
|
|
|
SolverItem->addChild(ViscosityModelItem);
|
|
|
|
|
QTreeWidgetItem* NumericalMethodsItem = new QTreeWidgetItem();
|
|
|
|
|
NumericalMethodsItem->setText(0,tr("Numerical Methods"));
|
|
|
|
|
NumericalMethodsItem->setData(1,0,-1);
|
|
|
|
|
NumericalMethodsItem->setData(2, 0, QVariant::fromValue(GUI::SolutionAnalysisTreeEnum::SATree_ComputationalSetupComputationalDomainSolverNumericalMethods));
|
|
|
|
|
SolverItem->addChild(NumericalMethodsItem);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QTreeWidgetItem* MotionPropertiesItem = new QTreeWidgetItem();
|
|
|
|
|
MotionPropertiesItem->setText(0,tr("Motion Properties"));
|
|
|
|
|
MotionPropertiesItem->setData(1,0,-1);
|
|
|
|
|
MotionPropertiesItem->setData(2, 0, QVariant::fromValue(GUI::SolutionAnalysisTreeEnum::SATree_ComputationalSetupComputationalDomainSolverMotionProperties));
|
|
|
|
|
ComputationalDomainItem->addChild(MotionPropertiesItem);
|
|
|
|
|
|
|
|
|
|
QTreeWidgetItem* motion1Item = new QTreeWidgetItem();
|
|
|
|
@ -104,28 +137,33 @@ namespace GUI{
|
|
|
|
|
QTreeWidgetItem* BoundaryConditionsItem = new QTreeWidgetItem();
|
|
|
|
|
BoundaryConditionsItem->setText(0,tr("Boundary Conditions"));
|
|
|
|
|
BoundaryConditionsItem->setData(1,0,-1);
|
|
|
|
|
BoundaryConditionsItem->setData(2, 0, QVariant::fromValue(GUI::SolutionAnalysisTreeEnum::SATree_ComputationalSetupComputationalDomainSolverBoundaryConditions));
|
|
|
|
|
ComputationalDomainItem->addChild(BoundaryConditionsItem);
|
|
|
|
|
|
|
|
|
|
QTreeWidgetItem* pressureinletItem = new QTreeWidgetItem();
|
|
|
|
|
pressureinletItem->setText(0,tr("pressure-inlet"));
|
|
|
|
|
pressureinletItem->setText(0,tr("Pressure-Inlet"));
|
|
|
|
|
pressureinletItem->setData(1,0,-1);
|
|
|
|
|
pressureinletItem->setData(2, 0, QVariant::fromValue(GUI::SolutionAnalysisTreeEnum::SATree_ComputationalSetupComputationalDomainSolverBoundaryConditionsPressureInlet));
|
|
|
|
|
BoundaryConditionsItem->addChild(pressureinletItem);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QTreeWidgetItem* InitializationItem = new QTreeWidgetItem();
|
|
|
|
|
InitializationItem->setText(0,tr("Initialization"));
|
|
|
|
|
InitializationItem->setData(1,0,-1);
|
|
|
|
|
InitializationItem->setData(2, 0, QVariant::fromValue(GUI::SolutionAnalysisTreeEnum::SATree_ComputationalSetupComputationalDomainSolverInitialization));
|
|
|
|
|
ComputationalDomainItem->addChild(InitializationItem);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QTreeWidgetItem* ComputationalControlItem = new QTreeWidgetItem();
|
|
|
|
|
ComputationalControlItem->setText(0,tr("Computational Control"));
|
|
|
|
|
ComputationalControlItem->setData(1,0,-1);
|
|
|
|
|
ComputationalControlItem->setData(2, 0, QVariant::fromValue(GUI::SolutionAnalysisTreeEnum::SATree_ComputationalSetupComputationalDomainSolverComputationalControl));
|
|
|
|
|
ComputationalDomainItem->addChild(ComputationalControlItem);
|
|
|
|
|
|
|
|
|
|
QTreeWidgetItem* ReferenceQuantityItem = new QTreeWidgetItem();
|
|
|
|
|
ReferenceQuantityItem->setText(0,tr("reference quantity"));
|
|
|
|
|
ReferenceQuantityItem->setText(0,tr("Reference Quantity"));
|
|
|
|
|
ReferenceQuantityItem->setData(1,0,-1);
|
|
|
|
|
ReferenceQuantityItem->setData(2, 0, QVariant::fromValue(GUI::SolutionAnalysisTreeEnum::SATree_ComputationalSetupComputationalDomainSolverComputationalControlReferenceQuantity));
|
|
|
|
|
ComputationalControlItem->addChild(ReferenceQuantityItem);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -133,19 +171,23 @@ namespace GUI{
|
|
|
|
|
QTreeWidgetItem* MonitorsItem = new QTreeWidgetItem();
|
|
|
|
|
MonitorsItem->setText(0,tr("Monitors"));
|
|
|
|
|
MonitorsItem->setData(1,0,-1);
|
|
|
|
|
MonitorsItem->setData(2, 0, QVariant::fromValue(GUI::SolutionAnalysisTreeEnum::SATree_ComputationalSetupComputationalDomainSolverMonitors));
|
|
|
|
|
ComputationalDomainItem->addChild(MonitorsItem);
|
|
|
|
|
|
|
|
|
|
QTreeWidgetItem* ResidualItem = new QTreeWidgetItem();
|
|
|
|
|
ResidualItem->setText(0,tr("Residual"));
|
|
|
|
|
ResidualItem->setData(1,0,-1);
|
|
|
|
|
ResidualItem->setData(2, 0, QVariant::fromValue(GUI::SolutionAnalysisTreeEnum::SATree_ComputationalSetupComputationalDomainSolverMonitorsResidual));
|
|
|
|
|
MonitorsItem->addChild(ResidualItem);
|
|
|
|
|
QTreeWidgetItem* AerodynamicForceItem = new QTreeWidgetItem();
|
|
|
|
|
AerodynamicForceItem->setText(0,tr("Aerodynamic Force"));
|
|
|
|
|
AerodynamicForceItem->setData(1,0,-1);
|
|
|
|
|
AerodynamicForceItem->setData(2, 0, QVariant::fromValue(GUI::SolutionAnalysisTreeEnum::SATree_ComputationalSetupComputationalDomainSolverMonitorsAerodynamicForce));
|
|
|
|
|
MonitorsItem->addChild(AerodynamicForceItem);
|
|
|
|
|
QTreeWidgetItem* TurbomachineryPerformanceItem = new QTreeWidgetItem();
|
|
|
|
|
TurbomachineryPerformanceItem->setText(0,tr("Turbomachinery Performance"));
|
|
|
|
|
TurbomachineryPerformanceItem->setData(1,0,-1);
|
|
|
|
|
TurbomachineryPerformanceItem->setData(2, 0, QVariant::fromValue(GUI::SolutionAnalysisTreeEnum::SATree_ComputationalSetupComputationalDomainSolverMonitorsTurbomachineryPerformance));
|
|
|
|
|
MonitorsItem->addChild(TurbomachineryPerformanceItem);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@ -207,7 +249,48 @@ namespace GUI{
|
|
|
|
|
|
|
|
|
|
void CFDTreeWidget::onItemClicked(QTreeWidgetItem *item, int column)
|
|
|
|
|
{
|
|
|
|
|
qDebug()<<item->text(0);
|
|
|
|
|
EventOper::TreeEventOperator* treeOper = Core::FITKOperatorRepo::getInstance()->getOperatorT<EventOper::TreeEventOperator>("ModelTreeEvent");
|
|
|
|
|
if (treeOper == nullptr) return;
|
|
|
|
|
EventOper::GraphEventOperator* graphOper = FITKOPERREPO->getOperatorT<EventOper::GraphEventOperator>("GraphPreprocess");
|
|
|
|
|
if (graphOper == nullptr)return;
|
|
|
|
|
graphOper->clearHighlight();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (item == nullptr)return;
|
|
|
|
|
int objID = item->data(1, 0).toInt();
|
|
|
|
|
GUI::SolutionAnalysisTreeEnum treeType = item->data(2, 0).value<GUI::SolutionAnalysisTreeEnum>();
|
|
|
|
|
Interface::FITKGeoEnum::FITKGeometryComType geometryType = item->data(3, 0).value<Interface::FITKGeoEnum::FITKGeometryComType>();
|
|
|
|
|
|
|
|
|
|
QString name = "";
|
|
|
|
|
|
|
|
|
|
switch (treeType) {
|
|
|
|
|
case GUI::SolutionAnalysisTreeEnum::SATree_ComputationalSetupTimeMode:name = "actionTimeModeEdit"; break;
|
|
|
|
|
case GUI::SolutionAnalysisTreeEnum::SATree_ComputationalSetupComputationalDomainSolverBasicModel:name = "actionBasicModelEdit"; break;
|
|
|
|
|
default:name = "";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
qDebug()<<name;
|
|
|
|
|
|
|
|
|
|
if (!name.isEmpty()) {
|
|
|
|
|
QObject sender;
|
|
|
|
|
sender.setObjectName(name);
|
|
|
|
|
auto acOper = Core::FITKOperatorRepo::getInstance()->getOperatorT<Core::FITKActionOperator>(name);
|
|
|
|
|
if (acOper == nullptr){
|
|
|
|
|
qDebug("acOper is nullptr");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
acOper->setEmitter(&sender);
|
|
|
|
|
acOper->setArgs("objID", objID);
|
|
|
|
|
acOper->actionTriggered();
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
treeOper->moveProcessToStep(0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// if(name == "actionTimeModeEdit"){
|
|
|
|
|
// ModelOper::CFDOperatorsTimeModeManager* manage = new ModelOper::CFDOperatorsTimeModeManager();
|
|
|
|
|
// manage->execGUI();
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|