在界面中添加显示当前模型

feature/UI-20260528
lvjunjie 4 days ago
parent c6d08b13cf
commit 7ae104839d

Binary file not shown.

@ -5065,6 +5065,34 @@ Please check your input coordinates.</source>
<source>Current well:</source> <source>Current well:</source>
<translation></translation> <translation></translation>
</message> </message>
<message>
<source>Current model</source>
<translation></translation>
</message>
<message>
<source>Oil single-phase constant pvt</source>
<translation>pvt</translation>
</message>
<message>
<source>Oil single-phase variable pvt</source>
<translation>pvt</translation>
</message>
<message>
<source>Water single-phase constant pvt</source>
<translation>pvt</translation>
</message>
<message>
<source>Water single-phase variable pvt</source>
<translation>pvt</translation>
</message>
<message>
<source>Gas single-phase variable pvt</source>
<translation>pvt</translation>
</message>
<message>
<source>Oil-water two-phase</source>
<translation></translation>
</message>
<message> <message>
<source>Include other wells</source> <source>Include other wells</source>
<translation></translation> <translation></translation>

@ -85,9 +85,12 @@ signals:
private: private:
// 初始化UI组件的私有函数 // 初始化UI组件的私有函数
void initMainOptionsGroup(); // 初始化主选项组 // 初始化主选项组
void initMainOptionsGroup();
// 初始化查看井结果组 // 初始化查看井结果组
void initResultWellGroup(); void initResultWellGroup();
// 初始化当前模型显示组
void initCurrentModelGroup();
void initOutputGroup(); // 初始化输出组 (新) void initOutputGroup(); // 初始化输出组 (新)
void initAdvancedGroup(); // 初始化高级组 (新) void initAdvancedGroup(); // 初始化高级组 (新)
void initTimeSteppingGroup(); // 初始化时间步进组 void initTimeSteppingGroup(); // 初始化时间步进组
@ -101,6 +104,8 @@ private:
void updateDataFromUi(); void updateDataFromUi();
// 填充查看井结果下拉框 // 填充查看井结果下拉框
void fillResultWellCombo(const QString& selectedWellName = QString()); void fillResultWellCombo(const QString& selectedWellName = QString());
// 刷新当前模型显示
void updateCurrentModelDisplay();
private: private:
@ -118,6 +123,10 @@ private:
QComboBox* m_pResultWellCombo; QComboBox* m_pResultWellCombo;
bool m_bFillingResultWellCombo; bool m_bFillingResultWellCombo;
// 当前模型显示
QGroupBox* m_pCurrentModelGroup;
QLabel* m_pCurrentModelValueLabel;
// 输出组组件 (新) // 输出组组件 (新)
QGroupBox* m_pOutputGroup; // 输出分组框 QGroupBox* m_pOutputGroup; // 输出分组框
QCheckBox* m_pOutputResultFieldsCheck; // 输出结果文件复选框 QCheckBox* m_pOutputResultFieldsCheck; // 输出结果文件复选框

@ -41,6 +41,27 @@ static bool isNumericalDesignDebugOptionsVisible()
return false; 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) nmWxNumericalDesign::nmWxNumericalDesign(QWidget *parent)
: iDlgBase(parent) : iDlgBase(parent)
{ {
@ -48,6 +69,8 @@ nmWxNumericalDesign::nmWxNumericalDesign(QWidget *parent)
s_pCurrentInstance = this; s_pCurrentInstance = this;
m_pResultWellGroup = nullptr; m_pResultWellGroup = nullptr;
m_pResultWellCombo = nullptr; m_pResultWellCombo = nullptr;
m_pCurrentModelGroup = nullptr;
m_pCurrentModelValueLabel = nullptr;
m_bFillingResultWellCombo = false; m_bFillingResultWellCombo = false;
// 初始化图标路径 // 初始化图标路径
@ -70,6 +93,7 @@ nmWxNumericalDesign::nmWxNumericalDesign(QWidget *parent)
// 初始化所有UI组件 // 初始化所有UI组件
initMainOptionsGroup(); // 初始化主选项组 initMainOptionsGroup(); // 初始化主选项组
initResultWellGroup(); initResultWellGroup();
initCurrentModelGroup();
initOutputGroup(); // 初始化输出组 (新) initOutputGroup(); // 初始化输出组 (新)
initAdvancedGroup(); // 初始化高级组 (新) initAdvancedGroup(); // 初始化高级组 (新)
initTimeSteppingGroup(); // 初始化时间步进组 initTimeSteppingGroup(); // 初始化时间步进组
@ -79,6 +103,7 @@ nmWxNumericalDesign::nmWxNumericalDesign(QWidget *parent)
// 将各个组添加到滚动区域的布局中 // 将各个组添加到滚动区域的布局中
pScrollLayout->addWidget(m_pMainOptionsGroup); pScrollLayout->addWidget(m_pMainOptionsGroup);
pScrollLayout->addWidget(m_pResultWellGroup); pScrollLayout->addWidget(m_pResultWellGroup);
pScrollLayout->addWidget(m_pCurrentModelGroup);
pScrollLayout->addWidget(m_pOutputGroup); pScrollLayout->addWidget(m_pOutputGroup);
pScrollLayout->addWidget(m_pAdvancedGroup); pScrollLayout->addWidget(m_pAdvancedGroup);
pScrollLayout->addWidget(m_pTimeSteppingGroup); pScrollLayout->addWidget(m_pTimeSteppingGroup);
@ -132,6 +157,7 @@ void nmWxNumericalDesign::activateCurrentInstance()
s_pCurrentInstance = this; s_pCurrentInstance = this;
// 调用前已经切换到当前成果的数据中心,此处按照当前成果重新填充下拉框。 // 调用前已经切换到当前成果的数据中心,此处按照当前成果重新填充下拉框。
fillResultWellCombo(); fillResultWellCombo();
updateCurrentModelDisplay();
} }
// 外部刷新当前查看井下拉框 // 外部刷新当前查看井下拉框
@ -163,6 +189,40 @@ void nmWxNumericalDesign::initResultWellGroup()
m_pResultWellGroup->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); 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) void nmWxNumericalDesign::fillResultWellCombo(const QString& selectedWellName)
{ {

Loading…
Cancel
Save