#include "CFDStructMainWindow.h" #include "GUIFrame/PropertyWidget.h" #include "FITK_Kernel/FITKCore/FITKAbstractGUIObject.h" #include "Tools/Win64/SARibbon/include/SARibbon-2.0.1/SARibbonMainWindow.h" #include "Tools/Win64/SARibbon/include/SARibbon-2.0.1/SARibbonPannelItem.h" #include "Tools/Win64/SARibbon/include/SARibbon-2.0.1/SARibbonBar.h" #include #include #include #include //CFDStructMainWindow::CFDStructMainWindow() : GUI::MainWindow() //{ // qDebug()<<"new CFSStructMainWindow"; //} // //void CFDStructMainWindow::initCentralWidget() { // qDebug() << "CFDStruct iniCentralWidget"; // //} using namespace GUI; CFDStructMainWindow::CFDStructMainWindow() { qDebug() << "new Empty CFDStructMainWindow"; initMainWindowMenu(); initCentralWidget(); initPropertyWidget(); setWindowTitle("TF-CFlow"); } void CFDStructMainWindow::initPropertyWidget() { //m_PropertyWidget->setWidget(); } void CFDStructMainWindow::initMainWindowMenu() { initApplicationButton(); addSARibbonCategoryGeometry(); addSARibbonCategoryMesh(); addSARibbonCategoryCalculation(); addSARibbonCategoryPostProcessing(); addSARibbonCategoryTool(); addSARibbonCategoryCivilAircraftTemplateLibrary(); _ribbonBar->setCurrentIndex(0); } void CFDStructMainWindow::addSARibbonCategoryGeometry() { QString type = tr("Geometry"); SARibbonCategory* gategory = _ribbonBar->addCategoryPage(type); _ribbonBar->raiseCategory(gategory); } void CFDStructMainWindow::addSARibbonCategoryMesh() { QString type = tr("Mesh"); SARibbonCategory* gategory = _ribbonBar->addCategoryPage(type); _ribbonBar->raiseCategory(gategory); } void CFDStructMainWindow::addSARibbonCategoryCalculation() { // 创建一个新的标签 QString type = tr("Calculation"); SARibbonCategory* gategory = _ribbonBar->addCategoryPage(type); _ribbonBar->raiseCategory(gategory); QAction* action = nullptr; //pannel 定义一个区块 "仿真运行" SARibbonPannel* pannel = gategory->addPannel(tr("Simulation Run")); //action = getAction("actionImportGeometry"); //定义一个图标 "开始计算" action = createAction(tr("Start Calculation"), "actionStartCalculation", ":/icons/createbox.png", tr("Start Calculation")); //将图标放入区块中,并设置图标大小 pannelAddAction(pannel, action, SARibbonPannelItem::Large); //定义区块 "导入和导出" pannel = gategory->addPannel(tr("Import and Export")); //定义图标"网格导入" action = createAction(tr("Mesh Import"), "actionMeshImport", ":/icons/createbox.png", tr("Mesh Import")); //"网格导入"加入"导入和导出" pannelAddAction(pannel, action, SARibbonPannelItem::Large); //定义图标"导出" action = createAction(tr("Import"), "actionImport", ":/icons/createsphere.png", tr("Import")); //"导出"加入"导入和导出" pannelAddAction(pannel, action, SARibbonPannelItem::Large); //定义区块"求解器设置" pannel = gategory->addPannel(tr("Solver Settings")); //定义图标 时间模式 action = createAction(tr("Time Mode"), "actionTimeMode", ":/icons/BoolFause.png", tr("Time Mode")); pannelAddAction(pannel, action, SARibbonPannelItem::Large); //定义图标 基本模型 action = createAction(tr("Basic Model"), "actionBasicModel", ":/icons/BoolCut.png", tr("Basic Model")); pannelAddAction(pannel, action, SARibbonPannelItem::Large); //定义图标 粘性模型 action = createAction(tr("Viscosity Model"), "actionViscosityModel", ":/icons/BoolCommon.png", tr("Viscosity Model")); pannelAddAction(pannel, action, SARibbonPannelItem::Large); //定义图标 数值方法 action = createAction(tr("Numerical Method"), "actionNumericalMethod", ":/icons/BoolCommon.png", tr("Numerical Method")); pannelAddAction(pannel, action, SARibbonPannelItem::Large); //定义图标 运动属性 action = createAction(tr("Motion Properties"), "actionMotionProperties", ":/icons/BoolCommon.png", tr("Motion Properties")); //定义区块"边界条件和初始条件" pannel = gategory->addPannel(tr("Boundary Conditions and Initial Conditions")); //定义图标 边界条件 action = createAction(tr("Boundary Conditions"), "actionBoundaryConditions", ":/icons/BoolCommon.png", tr("Boundary Conditions")); pannelAddAction(pannel, action, SARibbonPannelItem::Large); //定义图标 参考量 action = createAction(tr("Reference Quantities"), "actionReferenceQuantities", ":/icons/BoolCommon.png", tr("Reference Quantities")); pannelAddAction(pannel, action, SARibbonPannelItem::Large); //定义图标 初始化 action = createAction(tr("Initialization"), "actionInitialization", ":/icons/BoolCommon.png", tr("Initialization")); pannelAddAction(pannel, action, SARibbonPannelItem::Large); //定义区块"计算控制" pannel = gategory->addPannel(tr("Computational Control")); //定义图标 计算控制 action = createAction(tr("Computational Control"), "actionComputational Control", ":/icons/Computational Control.png", tr("Computational Control")); pannelAddAction(pannel, action, SARibbonPannelItem::Large); //定义区块"监控器" pannel = gategory->addPannel(tr("Monitors")); //定义图标 残差 action = createAction(tr("Residuals"), "actionResiduals", ":/icons/Residuals.png", tr("Residuals")); pannelAddAction(pannel, action, SARibbonPannelItem::Large); //定义图标 气动力 action = createAction(tr("Aerodynamic Forces"), "actionAerodynamicForces", ":/icons/AerodynamicForces.png", tr("Aerodynamic Forces")); pannelAddAction(pannel, action, SARibbonPannelItem::Large); //定义图标 信息汇总 action = createAction(tr("Summary"), "actionSummary", ":/icons/Summary.png", tr("Summary")); pannelAddAction(pannel, action, SARibbonPannelItem::Large); } void CFDStructMainWindow::addSARibbonCategoryPostProcessing() { QString type = tr("Post Processing"); SARibbonCategory* gategory = _ribbonBar->addCategoryPage(type); _ribbonBar->raiseCategory(gategory); } void CFDStructMainWindow::addSARibbonCategoryTool() { QString type = tr("Tool"); SARibbonCategory* gategory = _ribbonBar->addCategoryPage(type); _ribbonBar->raiseCategory(gategory); } void CFDStructMainWindow::addSARibbonCategoryCivilAircraftTemplateLibrary() { QString type = tr("CivilAircraft Template sLibrary"); SARibbonCategory* gategory = _ribbonBar->addCategoryPage(type); _ribbonBar->raiseCategory(gategory); }