|
|
|
|
@ -99,9 +99,8 @@ nmWxNumericalDesign::nmWxNumericalDesign(
|
|
|
|
|
|
|
|
|
|
// 设置当前实例为静态指针
|
|
|
|
|
s_pCurrentInstance = this;
|
|
|
|
|
m_pResultWellGroup = nullptr;
|
|
|
|
|
m_pModelAndResultGroup = nullptr;
|
|
|
|
|
m_pResultWellCombo = nullptr;
|
|
|
|
|
m_pCurrentModelGroup = nullptr;
|
|
|
|
|
m_pCurrentModelCombo = nullptr;
|
|
|
|
|
m_bFillingResultWellCombo = false;
|
|
|
|
|
m_bFillingCurrentModelCombo = false;
|
|
|
|
|
@ -127,8 +126,7 @@ nmWxNumericalDesign::nmWxNumericalDesign(
|
|
|
|
|
|
|
|
|
|
// 初始化所有UI组件
|
|
|
|
|
initMainOptionsGroup(); // 初始化主选项组
|
|
|
|
|
initResultWellGroup();
|
|
|
|
|
initCurrentModelGroup();
|
|
|
|
|
initModelAndResultGroup();
|
|
|
|
|
initOutputGroup(); // 初始化输出组 (新)
|
|
|
|
|
initAdvancedGroup(); // 初始化高级组 (新)
|
|
|
|
|
initTimeSteppingGroup(); // 初始化时间步进组
|
|
|
|
|
@ -138,8 +136,7 @@ nmWxNumericalDesign::nmWxNumericalDesign(
|
|
|
|
|
|
|
|
|
|
// 将各个组添加到滚动区域的布局中
|
|
|
|
|
pScrollLayout->addWidget(m_pMainOptionsGroup);
|
|
|
|
|
pScrollLayout->addWidget(m_pResultWellGroup);
|
|
|
|
|
pScrollLayout->addWidget(m_pCurrentModelGroup);
|
|
|
|
|
pScrollLayout->addWidget(m_pModelAndResultGroup);
|
|
|
|
|
pScrollLayout->addWidget(m_pOutputGroup);
|
|
|
|
|
pScrollLayout->addWidget(m_pAdvancedGroup);
|
|
|
|
|
pScrollLayout->addWidget(m_pTimeSteppingGroup);
|
|
|
|
|
@ -250,43 +247,47 @@ void nmWxNumericalDesign::notifyResultWellSelectorChanged(const QString& wellNam
|
|
|
|
|
s_pCurrentInstance->fillResultWellCombo(wellName);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 初始化查看井结果切换控件
|
|
|
|
|
void nmWxNumericalDesign::initResultWellGroup()
|
|
|
|
|
// 初始化模型与结果切换控件
|
|
|
|
|
void nmWxNumericalDesign::initModelAndResultGroup()
|
|
|
|
|
{
|
|
|
|
|
m_pResultWellGroup = new QGroupBox(tr("View well result"), this);
|
|
|
|
|
QGridLayout* pGridLayout = new QGridLayout(m_pResultWellGroup);
|
|
|
|
|
|
|
|
|
|
QLabel* pCurrentWellLabel = new QLabel(tr("Current well:"), this);
|
|
|
|
|
m_pResultWellCombo = new QComboBox(this);
|
|
|
|
|
fillResultWellCombo();
|
|
|
|
|
|
|
|
|
|
pGridLayout->addWidget(pCurrentWellLabel, 0, 0, Qt::AlignLeft);
|
|
|
|
|
pGridLayout->addWidget(m_pResultWellCombo, 0, 1);
|
|
|
|
|
pGridLayout->setColumnStretch(0, 0);
|
|
|
|
|
pGridLayout->setColumnStretch(1, 1);
|
|
|
|
|
|
|
|
|
|
m_pResultWellGroup->setLayout(pGridLayout);
|
|
|
|
|
m_pResultWellGroup->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 初始化当前模型切换控件
|
|
|
|
|
void nmWxNumericalDesign::initCurrentModelGroup()
|
|
|
|
|
{
|
|
|
|
|
m_pCurrentModelGroup = new QGroupBox(tr("Model selection"), this);
|
|
|
|
|
QGridLayout* pGridLayout = new QGridLayout(m_pCurrentModelGroup);
|
|
|
|
|
|
|
|
|
|
QLabel* pCurrentModelLabel = new QLabel(tr("Current model:"), this);
|
|
|
|
|
m_pCurrentModelCombo = new QComboBox(this);
|
|
|
|
|
m_pModelAndResultGroup = new QGroupBox(tr("Model and result"), this);
|
|
|
|
|
QGridLayout* pGridLayout = new QGridLayout(m_pModelAndResultGroup);
|
|
|
|
|
pGridLayout->setContentsMargins(8, 15, 8, 10);
|
|
|
|
|
pGridLayout->setHorizontalSpacing(6);
|
|
|
|
|
pGridLayout->setVerticalSpacing(6);
|
|
|
|
|
|
|
|
|
|
QLabel* pCurrentModelLabel = new QLabel(
|
|
|
|
|
tr("Current model"), m_pModelAndResultGroup);
|
|
|
|
|
QLabel* pCurrentWellLabel = new QLabel(
|
|
|
|
|
tr("Current well"), m_pModelAndResultGroup);
|
|
|
|
|
pCurrentModelLabel->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
|
|
|
|
|
pCurrentWellLabel->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
|
|
|
|
|
|
|
|
|
|
m_pCurrentModelCombo = new QComboBox(m_pModelAndResultGroup);
|
|
|
|
|
m_pResultWellCombo = new QComboBox(m_pModelAndResultGroup);
|
|
|
|
|
QList<QComboBox*> listCombos;
|
|
|
|
|
listCombos << m_pCurrentModelCombo << m_pResultWellCombo;
|
|
|
|
|
for(int nIndex = 0; nIndex < listCombos.size(); ++nIndex) {
|
|
|
|
|
listCombos[nIndex]->setFixedHeight(nmParameterField::editorHeight());
|
|
|
|
|
listCombos[nIndex]->setMinimumWidth(
|
|
|
|
|
nmParameterField::editorMinimumWidth());
|
|
|
|
|
listCombos[nIndex]->setSizePolicy(
|
|
|
|
|
QSizePolicy::Expanding, QSizePolicy::Fixed);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 按当前成果回填模型和结果井
|
|
|
|
|
updateCurrentModelDisplay();
|
|
|
|
|
fillResultWellCombo();
|
|
|
|
|
|
|
|
|
|
pGridLayout->addWidget(pCurrentModelLabel, 0, 0, Qt::AlignLeft);
|
|
|
|
|
pGridLayout->addWidget(pCurrentModelLabel, 0, 0);
|
|
|
|
|
pGridLayout->addWidget(m_pCurrentModelCombo, 0, 1);
|
|
|
|
|
pGridLayout->addWidget(pCurrentWellLabel, 1, 0);
|
|
|
|
|
pGridLayout->addWidget(m_pResultWellCombo, 1, 1);
|
|
|
|
|
pGridLayout->setColumnStretch(0, 0);
|
|
|
|
|
pGridLayout->setColumnStretch(1, 1);
|
|
|
|
|
|
|
|
|
|
m_pCurrentModelGroup->setLayout(pGridLayout);
|
|
|
|
|
m_pCurrentModelGroup->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
|
|
|
|
|
m_pModelAndResultGroup->setSizePolicy(
|
|
|
|
|
QSizePolicy::Expanding, QSizePolicy::Preferred);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 按当前成果对应的数据管理器刷新模型下拉框选中项
|
|
|
|
|
@ -404,6 +405,9 @@ void nmWxNumericalDesign::initMainOptionsGroup()
|
|
|
|
|
{
|
|
|
|
|
m_pMainOptionsGroup = new QGroupBox(tr("Main options"), this);
|
|
|
|
|
QGridLayout* pGridLayout = new QGridLayout(m_pMainOptionsGroup); // 使用 QGridLayout
|
|
|
|
|
pGridLayout->setContentsMargins(8, 15, 8, 10);
|
|
|
|
|
pGridLayout->setHorizontalSpacing(6);
|
|
|
|
|
pGridLayout->setVerticalSpacing(6);
|
|
|
|
|
|
|
|
|
|
// 第一行: Include other wells + Gear Icon (左侧), Reset from diagnostic (右侧)
|
|
|
|
|
m_pIncludeOtherWellsCheck = new QCheckBox(tr("Include other wells"), this);
|
|
|
|
|
@ -414,7 +418,9 @@ void nmWxNumericalDesign::initMainOptionsGroup()
|
|
|
|
|
m_pOptionsGearButton->setEnabled(m_pIncludeOtherWellsCheck->isChecked());
|
|
|
|
|
|
|
|
|
|
m_pResetDiagnosticButton = new QPushButton(tr("Reset from diagnostic"), this);
|
|
|
|
|
m_pResetDiagnosticButton->setFixedWidth(150);
|
|
|
|
|
m_pResetDiagnosticButton->setFixedHeight(nmParameterField::editorHeight());
|
|
|
|
|
m_pResetDiagnosticButton->setSizePolicy(
|
|
|
|
|
QSizePolicy::Expanding, QSizePolicy::Fixed);
|
|
|
|
|
|
|
|
|
|
// 为左侧的复选框和齿轮创建一个QHBoxLayout,以便它们可以紧密排列
|
|
|
|
|
QHBoxLayout* pIncludeWellsLayout = new QHBoxLayout();
|
|
|
|
|
@ -423,17 +429,19 @@ void nmWxNumericalDesign::initMainOptionsGroup()
|
|
|
|
|
pIncludeWellsLayout->addStretch(); // 将它们推到左侧
|
|
|
|
|
|
|
|
|
|
pGridLayout->addLayout(pIncludeWellsLayout, 0, 0, Qt::AlignLeft); // 第0行,第0列,左对齐
|
|
|
|
|
pGridLayout->addWidget(m_pResetDiagnosticButton, 0, 1, Qt::AlignLeft); // 第0行,第1列,左对齐
|
|
|
|
|
pGridLayout->addWidget(m_pResetDiagnosticButton, 0, 1);
|
|
|
|
|
|
|
|
|
|
// 第二行: Impose pi (左侧), Reset from analytical (右侧)
|
|
|
|
|
m_pImposePiCheck = new QCheckBox(tr("Impose pi"), this);
|
|
|
|
|
m_pImposePiCheck->setChecked(true); // 默认选中
|
|
|
|
|
|
|
|
|
|
m_pResetAnalyticalButton = new QPushButton(tr("Reset from analytical"), this);
|
|
|
|
|
m_pResetAnalyticalButton->setFixedWidth(150);
|
|
|
|
|
m_pResetAnalyticalButton->setFixedHeight(nmParameterField::editorHeight());
|
|
|
|
|
m_pResetAnalyticalButton->setSizePolicy(
|
|
|
|
|
QSizePolicy::Expanding, QSizePolicy::Fixed);
|
|
|
|
|
|
|
|
|
|
pGridLayout->addWidget(m_pImposePiCheck, 1, 0, Qt::AlignLeft); // 第1行,第0列,左对齐
|
|
|
|
|
pGridLayout->addWidget(m_pResetAnalyticalButton, 1, 1, Qt::AlignLeft); // 第1行,第1列,左对齐
|
|
|
|
|
pGridLayout->addWidget(m_pResetAnalyticalButton, 1, 1);
|
|
|
|
|
|
|
|
|
|
// 第三行: Show average pressure (左侧), 右侧留空
|
|
|
|
|
m_pShowAveragePressureCheck = new QCheckBox(tr("Show average pressure"), this);
|
|
|
|
|
@ -654,10 +662,13 @@ void nmWxNumericalDesign::initPebiSolverSettingsGroup()
|
|
|
|
|
{
|
|
|
|
|
m_pPebiSolverSettingsGroup = new QGroupBox(tr("Solver settings"), this);
|
|
|
|
|
QGridLayout* pGridLayout = new QGridLayout(m_pPebiSolverSettingsGroup);
|
|
|
|
|
pGridLayout->setContentsMargins(8, 15, 8, 10);
|
|
|
|
|
pGridLayout->setHorizontalSpacing(6);
|
|
|
|
|
pGridLayout->setVerticalSpacing(6);
|
|
|
|
|
|
|
|
|
|
QLabel* pSolverTypeLabel = new QLabel(tr("Solver library:"), this);
|
|
|
|
|
QLabel* pOmpThreadsLabel = new QLabel(tr("OpenMP threads:"), this);
|
|
|
|
|
QLabel* pIluReuseStepsLabel = new QLabel(tr("ILU reuse steps:"), this);
|
|
|
|
|
QLabel* pSolverTypeLabel = new QLabel(tr("Solver library"), this);
|
|
|
|
|
QLabel* pOmpThreadsLabel = new QLabel(tr("OpenMP threads"), this);
|
|
|
|
|
QLabel* pIluReuseStepsLabel = new QLabel(tr("ILU reuse steps"), this);
|
|
|
|
|
pSolverTypeLabel->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
|
|
|
|
|
pOmpThreadsLabel->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
|
|
|
|
|
pIluReuseStepsLabel->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
|
|
|
|
|
@ -678,6 +689,22 @@ void nmWxNumericalDesign::initPebiSolverSettingsGroup()
|
|
|
|
|
m_pPebiIluReuseStepsSpin = new QSpinBox(this);
|
|
|
|
|
m_pPebiIluReuseStepsSpin->setRange(1, 100);
|
|
|
|
|
|
|
|
|
|
m_pPebiSolverTypeCombo->setFixedHeight(nmParameterField::editorHeight());
|
|
|
|
|
m_pPebiOmpThreadsCombo->setFixedHeight(nmParameterField::editorHeight());
|
|
|
|
|
m_pPebiIluReuseStepsSpin->setFixedHeight(nmParameterField::editorHeight());
|
|
|
|
|
m_pPebiSolverTypeCombo->setMinimumWidth(
|
|
|
|
|
nmParameterField::editorMinimumWidth());
|
|
|
|
|
m_pPebiOmpThreadsCombo->setMinimumWidth(
|
|
|
|
|
nmParameterField::editorMinimumWidth());
|
|
|
|
|
m_pPebiIluReuseStepsSpin->setMinimumWidth(
|
|
|
|
|
nmParameterField::editorMinimumWidth());
|
|
|
|
|
m_pPebiSolverTypeCombo->setSizePolicy(
|
|
|
|
|
QSizePolicy::Expanding, QSizePolicy::Fixed);
|
|
|
|
|
m_pPebiOmpThreadsCombo->setSizePolicy(
|
|
|
|
|
QSizePolicy::Expanding, QSizePolicy::Fixed);
|
|
|
|
|
m_pPebiIluReuseStepsSpin->setSizePolicy(
|
|
|
|
|
QSizePolicy::Expanding, QSizePolicy::Fixed);
|
|
|
|
|
|
|
|
|
|
pGridLayout->addWidget(pSolverTypeLabel, 0, 0);
|
|
|
|
|
pGridLayout->addWidget(m_pPebiSolverTypeCombo, 0, 1);
|
|
|
|
|
pGridLayout->addWidget(pOmpThreadsLabel, 1, 0);
|
|
|
|
|
|