diff --git a/Bin/Config/Lang/cn/nmNum_cn.qm b/Bin/Config/Lang/cn/nmNum_cn.qm index 43deca2..7c15864 100644 Binary files a/Bin/Config/Lang/cn/nmNum_cn.qm and b/Bin/Config/Lang/cn/nmNum_cn.qm differ diff --git a/Bin/Config/Lang/cn/nmNum_cn.ts b/Bin/Config/Lang/cn/nmNum_cn.ts index f02d5d3..3516394 100644 --- a/Bin/Config/Lang/cn/nmNum_cn.ts +++ b/Bin/Config/Lang/cn/nmNum_cn.ts @@ -5065,6 +5065,34 @@ Please check your input coordinates. Current well: 当前井: + + Current model + 当前模型 + + + Oil single-phase constant pvt + 油单相常数pvt + + + Oil single-phase variable pvt + 油单相变化pvt + + + Water single-phase constant pvt + 水单相常数pvt + + + Water single-phase variable pvt + 水单相变化pvt + + + Gas single-phase variable pvt + 气单相变化pvt + + + Oil-water two-phase + 油水两相 + Include other wells 包含其他井 diff --git a/Include/nmNum/nmSubWxs/nmWxNumericalDesign.h b/Include/nmNum/nmSubWxs/nmWxNumericalDesign.h index b63e67a..37898e9 100644 --- a/Include/nmNum/nmSubWxs/nmWxNumericalDesign.h +++ b/Include/nmNum/nmSubWxs/nmWxNumericalDesign.h @@ -85,9 +85,12 @@ signals: private: // 初始化UI组件的私有函数 - void initMainOptionsGroup(); // 初始化主选项组 + // 初始化主选项组 + void initMainOptionsGroup(); // 初始化查看井结果组 void initResultWellGroup(); + // 初始化当前模型显示组 + void initCurrentModelGroup(); void initOutputGroup(); // 初始化输出组 (新) void initAdvancedGroup(); // 初始化高级组 (新) void initTimeSteppingGroup(); // 初始化时间步进组 @@ -101,6 +104,8 @@ private: void updateDataFromUi(); // 填充查看井结果下拉框 void fillResultWellCombo(const QString& selectedWellName = QString()); + // 刷新当前模型显示 + void updateCurrentModelDisplay(); private: @@ -118,6 +123,10 @@ private: QComboBox* m_pResultWellCombo; bool m_bFillingResultWellCombo; + // 当前模型显示 + QGroupBox* m_pCurrentModelGroup; + QLabel* m_pCurrentModelValueLabel; + // 输出组组件 (新) QGroupBox* m_pOutputGroup; // 输出分组框 QCheckBox* m_pOutputResultFieldsCheck; // 输出结果文件复选框 diff --git a/Src/nmNum/nmSubWxs/nmWxNumericalDesign.cpp b/Src/nmNum/nmSubWxs/nmWxNumericalDesign.cpp index 182f2be..aa693e3 100644 --- a/Src/nmNum/nmSubWxs/nmWxNumericalDesign.cpp +++ b/Src/nmNum/nmSubWxs/nmWxNumericalDesign.cpp @@ -41,6 +41,27 @@ static bool isNumericalDesignDebugOptionsVisible() return false; } +// 显示当前模型类型 +static QString solverModelDisplayName(NM_SOLVER_MODEL_TYPE eType) +{ + switch(eType) { + case SMT_Oil_ConstPvt: + return nmWxNumericalDesign::tr("Oil single-phase constant pvt"); + case SMT_Oil_VariablePvt: + return nmWxNumericalDesign::tr("Oil single-phase variable pvt"); + case SMT_Water_ConstPvt: + return nmWxNumericalDesign::tr("Water single-phase constant pvt"); + case SMT_Water_VariablePvt: + return nmWxNumericalDesign::tr("Water single-phase variable pvt"); + case SMT_Gas_VariablePvt: + return nmWxNumericalDesign::tr("Gas single-phase variable pvt"); + case SMT_Oil_Water_TwoPhase: + return nmWxNumericalDesign::tr("Oil-water two-phase"); + default: + return QString(); + } +} + nmWxNumericalDesign::nmWxNumericalDesign(QWidget *parent) : iDlgBase(parent) { @@ -48,6 +69,8 @@ nmWxNumericalDesign::nmWxNumericalDesign(QWidget *parent) s_pCurrentInstance = this; m_pResultWellGroup = nullptr; m_pResultWellCombo = nullptr; + m_pCurrentModelGroup = nullptr; + m_pCurrentModelValueLabel = nullptr; m_bFillingResultWellCombo = false; // 初始化图标路径 @@ -70,6 +93,7 @@ nmWxNumericalDesign::nmWxNumericalDesign(QWidget *parent) // 初始化所有UI组件 initMainOptionsGroup(); // 初始化主选项组 initResultWellGroup(); + initCurrentModelGroup(); initOutputGroup(); // 初始化输出组 (新) initAdvancedGroup(); // 初始化高级组 (新) initTimeSteppingGroup(); // 初始化时间步进组 @@ -79,6 +103,7 @@ nmWxNumericalDesign::nmWxNumericalDesign(QWidget *parent) // 将各个组添加到滚动区域的布局中 pScrollLayout->addWidget(m_pMainOptionsGroup); pScrollLayout->addWidget(m_pResultWellGroup); + pScrollLayout->addWidget(m_pCurrentModelGroup); pScrollLayout->addWidget(m_pOutputGroup); pScrollLayout->addWidget(m_pAdvancedGroup); pScrollLayout->addWidget(m_pTimeSteppingGroup); @@ -132,6 +157,7 @@ void nmWxNumericalDesign::activateCurrentInstance() s_pCurrentInstance = this; // 调用前已经切换到当前成果的数据中心,此处按照当前成果重新填充下拉框。 fillResultWellCombo(); + updateCurrentModelDisplay(); } // 外部刷新当前查看井下拉框 @@ -163,6 +189,40 @@ void nmWxNumericalDesign::initResultWellGroup() m_pResultWellGroup->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); } +// 显示当前模型名 +void nmWxNumericalDesign::initCurrentModelGroup() +{ + m_pCurrentModelGroup = new QGroupBox(tr("Current model"), this); + QGridLayout* pGridLayout = new QGridLayout(m_pCurrentModelGroup); + + m_pCurrentModelValueLabel = new QLabel(this); + m_pCurrentModelValueLabel->setTextInteractionFlags(Qt::TextSelectableByMouse); + m_pCurrentModelValueLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); + updateCurrentModelDisplay(); + + pGridLayout->addWidget(m_pCurrentModelValueLabel, 0, 0); + pGridLayout->setColumnStretch(0, 1); + + m_pCurrentModelGroup->setLayout(pGridLayout); + m_pCurrentModelGroup->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); +} + +// 按当前成果对应的数据管理器刷新模型名 +void nmWxNumericalDesign::updateCurrentModelDisplay() +{ + if(m_pCurrentModelValueLabel == nullptr) { + return; + } + + nmDataAnalyzeManager* pManager = nmDataAnalyzeManager::getCurrentInstance(); + if(pManager == nullptr) { + m_pCurrentModelValueLabel->clear(); + return; + } + + m_pCurrentModelValueLabel->setText(solverModelDisplayName(pManager->getSolverModelType())); +} + // 按参与计算井刷新下拉框 void nmWxNumericalDesign::fillResultWellCombo(const QString& selectedWellName) {