新增网格属性插值功能入口

- 新增属性插值菜单及基础参数配置窗口
- 完成中英文界面配置与窗口生命周期管理
feature/Interpolation-20260803
lvjunjie 2 weeks ago
parent ac7413680e
commit 19ed90ce86

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

@ -6548,4 +6548,111 @@ Average pressure in contour: %2 MPa</source>
<translation>3D</translation>
</message>
</context>
<context>
<name>nmWxPropertyInterpolationDlg</name>
<message>
<source>Property Interpolation</source>
<translation></translation>
</message>
<message>
<source>Property:</source>
<translation></translation>
</message>
<message>
<source>Permeability k</source>
<translation> k</translation>
</message>
<message>
<source>Porosity phi</source>
<translation> phi</translation>
</message>
<message>
<source>Reservoir thickness h</source>
<translation> h</translation>
</message>
<message>
<source>Name:</source>
<translation></translation>
</message>
<message>
<source>Permeability</source>
<translation></translation>
</message>
<message>
<source>Measurement Points</source>
<translation></translation>
</message>
<message>
<source>New value:</source>
<translation></translation>
</message>
<message>
<source>Select on Map</source>
<translation></translation>
</message>
<message>
<source>X</source>
<translation>X</translation>
</message>
<message>
<source>Y</source>
<translation>Y</translation>
</message>
<message>
<source>Value</source>
<translation></translation>
</message>
<message>
<source>Delete Selected</source>
<translation></translation>
</message>
<message>
<source>Clear</source>
<translation></translation>
</message>
<message>
<source>Kriging Parameters</source>
<translation>Kriging</translation>
</message>
<message>
<source>Nugget:</source>
<translation>Nugget</translation>
</message>
<message>
<source>Sill:</source>
<translation>Sill</translation>
</message>
<message>
<source>Range:</source>
<translation>Range</translation>
</message>
<message>
<source>Model:</source>
<translation></translation>
</message>
<message>
<source>Spherical (0)</source>
<translation>0</translation>
</message>
<message>
<source>Exponential (1)</source>
<translation>1</translation>
</message>
<message>
<source>Gaussian (2)</source>
<translation>2</translation>
</message>
<message>
<source>Preview</source>
<translation></translation>
</message>
<message>
<source>Apply</source>
<translation></translation>
</message>
<message>
<source>Close</source>
<translation></translation>
</message>
</context>
</TS>

@ -248,6 +248,7 @@
<Cmd ID="5112" Bounds="0,0,2,1" Name="NmGeometry" Alias="分层" Icon="NmGeometry" />
<Cmd ID="5113" Bounds="0,1,2,1" Name="NmProperties" Alias="储层特性" Icon="NmProperties" />
<Cmd ID="5122" Bounds="0,2,2,1" Name="NmDFN" Alias="DFN" Icon="NmDFN" />
<Cmd ID="5126" Bounds="0,3,2,1" Name="NmInterpolation" Alias="属性插值" Icon="NmProperties" />
</Group>
<Group Name="NtModel" Alias="模型生成">

@ -246,6 +246,7 @@
<Cmd ID="5112" Bounds="0,0,2,1" Name="NmGeometry" Alias="Layer Division" Icon="NmGeometry" />
<Cmd ID="5113" Bounds="0,1,2,1" Name="NmProperties" Alias="Reservoir Properties" Icon="NmProperties" />
<Cmd ID="5122" Bounds="0,2,2,1" Name="NmDFN" Alias="DFN" Icon="NmDFN" />
<Cmd ID="5126" Bounds="0,3,2,1" Name="NmInterpolation" Alias="Property Interpolation" Icon="NmProperties" />
</Group>
<Group Name="NtModel" Alias="Model Generation">

@ -205,6 +205,8 @@ class NM_SUB_WND_EXPORT nmSubWndMain : public iSubWndBaseFit {
QWidget* showMeasureDialog();
// 显示模型位置对话框
QWidget* showPointerPosDialog();
// 显示属性插值对话框
QWidget* showPropertyInterpolationDialog();
void bindDialogCmdDestroyed(QWidget* dialog, int nId);
void bindMeasureDialog(QWidget* measureDlg);
bool isDialogCmdOpened(int nId) const;

@ -0,0 +1,45 @@
#ifndef NMWXPROPERTYINTERPOLATIONDLG_H
#define NMWXPROPERTYINTERPOLATIONDLG_H
#include "iDlgBase.h"
#include "nmSubWxs_global.h"
class QComboBox;
class QDoubleSpinBox;
class QLineEdit;
class QPushButton;
class QTableWidget;
class NM_SUB_WXS_EXPORT nmWxPropertyInterpolationDlg : public iDlgBase
{
public:
explicit nmWxPropertyInterpolationDlg(QWidget* parent = 0);
private:
// 初始化属性插值界面
void initInterpolationUI();
private:
// 插值属性及名称
QComboBox* m_pPropertyCombo;
QLineEdit* m_pNameEdit;
// 测点数据录入
QDoubleSpinBox* m_pNewValueSpin;
QPushButton* m_pMapPickButton;
QTableWidget* m_pPointTable;
QPushButton* m_pDeletePointButton;
QPushButton* m_pClearPointsButton;
// Kriging插值参数
QDoubleSpinBox* m_pNuggetSpin;
QDoubleSpinBox* m_pSillSpin;
QDoubleSpinBox* m_pRangeSpin;
QComboBox* m_pModelCombo;
// 结果预览及应用
QPushButton* m_pPreviewButton;
QPushButton* m_pApplyButton;
};
#endif // NMWXPROPERTYINTERPOLATIONDLG_H

@ -57,6 +57,7 @@
#include "nmWxWellLayerDlg.h"
#include "nmWxGeometryLayerDlg.h"
#include "nmWxReservoirPropertiesDlg.h"
#include "nmWxPropertyInterpolationDlg.h"
#include "nmWxPostprocessingAnimationWidget.h"
#include "nmWxGeoRefDlg.h"
@ -512,6 +513,13 @@ bool nmSubWndMain::runCmdBy(QString sName, QString sID)
}
this->drawPointerPos();
return true;
case 5126:
if(isDialogCmdOpened(5126)) {
return true;
}
this->showPropertyInterpolationDialog();
return true;
}
if(_isSame(s, "RunGrid")) {
@ -557,6 +565,7 @@ bool nmSubWndMain::checkCmdEnable(bool &b, \
if(sName == "NmMap" || sName == "NmUnlocked" || sName == "NmGeometry" ||
sName == "NmProperties" || sName == "NmDFN" || sName == "NmCaculation" ||
sName == "NmBack" || sName == "NmResult" || sName == "NmGrid" ||
sName == "NmInterpolation" ||
sName == "NmShow" || sName == "NmPrintPreview" || sName == "NmPrint" ||
sName == "VisibleAnalBasic" || sName == "VisibleAnalPVT" || sName == "VisibleAnalDiff" ||
sName == "VisibleAnalPseu" || sName == "nmFitModel" || sName == "NmAnalChange") {
@ -1435,6 +1444,20 @@ QWidget* nmSubWndMain::showPointerPosDialog()
return pointerPosDlg;
}
QWidget* nmSubWndMain::showPropertyInterpolationDialog()
{
nmWxPropertyInterpolationDlg* interpolationDlg = new nmWxPropertyInterpolationDlg(this);
markDialogCmdOpened(5126);
interpolationDlg->setObjectName("nmPropertyInterpolationDialog");
// 关闭窗口时自动释放,并恢复菜单命令的可用状态
interpolationDlg->setAttribute(Qt::WA_DeleteOnClose, true);
bindDialogCmdDestroyed(interpolationDlg, 5126);
interpolationDlg->show();
interpolationDlg->raise();
interpolationDlg->activateWindow();
return interpolationDlg;
}
void nmSubWndMain::generationMesh()
{
// // TODO还不支持原型边界

@ -0,0 +1,146 @@
#include "nmWxPropertyInterpolationDlg.h"
#include <QAbstractItemView>
#include <QComboBox>
#include <QCoreApplication>
#include <QDoubleSpinBox>
#include <QFormLayout>
#include <QGroupBox>
#include <QHBoxLayout>
#include <QHeaderView>
#include <QLabel>
#include <QLineEdit>
#include <QPushButton>
#include <QTableWidget>
#include <QVBoxLayout>
namespace
{
// 使用独立翻译上下文,便于统一维护对话框文本
QString interpolationText(const char* sourceText)
{
return QCoreApplication::translate("nmWxPropertyInterpolationDlg", sourceText);
}
// 创建统一格式的非负数值输入框
QDoubleSpinBox* createNumberSpinBox(QWidget* parent, double value)
{
QDoubleSpinBox* spinBox = new QDoubleSpinBox(parent);
spinBox->setRange(0.0, 1.0e12);
spinBox->setDecimals(6);
spinBox->setValue(value);
spinBox->setButtonSymbols(QAbstractSpinBox::NoButtons);
return spinBox;
}
}
nmWxPropertyInterpolationDlg::nmWxPropertyInterpolationDlg(QWidget* parent)
: iDlgBase(parent),
m_pPropertyCombo(NULL),
m_pNameEdit(NULL),
m_pNewValueSpin(NULL),
m_pMapPickButton(NULL),
m_pPointTable(NULL),
m_pDeletePointButton(NULL),
m_pClearPointsButton(NULL),
m_pNuggetSpin(NULL),
m_pSillSpin(NULL),
m_pRangeSpin(NULL),
m_pModelCombo(NULL),
m_pPreviewButton(NULL),
m_pApplyButton(NULL)
{
setWindowTitle(interpolationText("Property Interpolation"));
setWindowModality(Qt::NonModal);
setModal(false);
setMinimumSize(520, 620);
resize(560, 680);
initInterpolationUI();
}
void nmWxPropertyInterpolationDlg::initInterpolationUI()
{
QVBoxLayout* mainLayout = new QVBoxLayout(this);
// 插值属性及名称设置
QFormLayout* dataSetLayout = new QFormLayout;
m_pPropertyCombo = new QComboBox(this);
m_pPropertyCombo->addItem(interpolationText("Permeability k"), QString("k"));
m_pPropertyCombo->addItem(interpolationText("Porosity phi"), QString("phi"));
m_pPropertyCombo->addItem(interpolationText("Reservoir thickness h"), QString("h"));
dataSetLayout->addRow(interpolationText("Property:"), m_pPropertyCombo);
m_pNameEdit = new QLineEdit(interpolationText("Permeability"), this);
dataSetLayout->addRow(interpolationText("Name:"), m_pNameEdit);
mainLayout->addLayout(dataSetLayout);
// 测点数据录入区域
QGroupBox* pointGroup = new QGroupBox(interpolationText("Measurement Points"), this);
QVBoxLayout* pointLayout = new QVBoxLayout(pointGroup);
QHBoxLayout* newPointLayout = new QHBoxLayout;
newPointLayout->addWidget(new QLabel(interpolationText("New value:"), pointGroup));
m_pNewValueSpin = createNumberSpinBox(pointGroup, 0.0);
newPointLayout->addWidget(m_pNewValueSpin, 1);
m_pMapPickButton = new QPushButton(interpolationText("Select on Map"), pointGroup);
m_pMapPickButton->setCheckable(true);
// 地图选点功能将在后续阶段接入
m_pMapPickButton->setEnabled(false);
newPointLayout->addWidget(m_pMapPickButton);
pointLayout->addLayout(newPointLayout);
// 每个测点保存坐标及对应的属性值
m_pPointTable = new QTableWidget(0, 3, pointGroup);
QStringList headers;
headers << interpolationText("X") << interpolationText("Y") << interpolationText("Value");
m_pPointTable->setHorizontalHeaderLabels(headers);
m_pPointTable->horizontalHeader()->setResizeMode(QHeaderView::Stretch);
m_pPointTable->setSelectionBehavior(QAbstractItemView::SelectRows);
m_pPointTable->setSelectionMode(QAbstractItemView::SingleSelection);
m_pPointTable->setAlternatingRowColors(true);
pointLayout->addWidget(m_pPointTable, 1);
// 测点列表管理按钮
QHBoxLayout* pointButtonLayout = new QHBoxLayout;
pointButtonLayout->addStretch();
m_pDeletePointButton = new QPushButton(interpolationText("Delete Selected"), pointGroup);
m_pDeletePointButton->setEnabled(false);
pointButtonLayout->addWidget(m_pDeletePointButton);
m_pClearPointsButton = new QPushButton(interpolationText("Clear"), pointGroup);
m_pClearPointsButton->setEnabled(false);
pointButtonLayout->addWidget(m_pClearPointsButton);
pointLayout->addLayout(pointButtonLayout);
mainLayout->addWidget(pointGroup, 1);
// Kriging插值参数设置
QGroupBox* parameterGroup = new QGroupBox(interpolationText("Kriging Parameters"), this);
QFormLayout* parameterLayout = new QFormLayout(parameterGroup);
m_pNuggetSpin = createNumberSpinBox(parameterGroup, 0.01);
parameterLayout->addRow(interpolationText("Nugget:"), m_pNuggetSpin);
m_pSillSpin = createNumberSpinBox(parameterGroup, 100.0);
parameterLayout->addRow(interpolationText("Sill:"), m_pSillSpin);
m_pRangeSpin = createNumberSpinBox(parameterGroup, 1000.0);
parameterLayout->addRow(interpolationText("Range:"), m_pRangeSpin);
m_pModelCombo = new QComboBox(parameterGroup);
m_pModelCombo->addItem(interpolationText("Spherical (0)"), 0);
m_pModelCombo->addItem(interpolationText("Exponential (1)"), 1);
m_pModelCombo->addItem(interpolationText("Gaussian (2)"), 2);
parameterLayout->addRow(interpolationText("Model:"), m_pModelCombo);
mainLayout->addWidget(parameterGroup);
// 底部操作按钮
QHBoxLayout* buttonLayout = new QHBoxLayout;
m_pPreviewButton = new QPushButton(interpolationText("Preview"), this);
// 插值计算和预览功能将在后续阶段接入
m_pPreviewButton->setEnabled(false);
buttonLayout->addWidget(m_pPreviewButton);
buttonLayout->addStretch();
m_pApplyButton = new QPushButton(interpolationText("Apply"), this);
m_pApplyButton->setEnabled(false);
buttonLayout->addWidget(m_pApplyButton);
QPushButton* closeButton = new QPushButton(interpolationText("Close"), this);
buttonLayout->addWidget(closeButton);
mainLayout->addLayout(buttonLayout);
connect(closeButton, SIGNAL(clicked()), this, SLOT(close()));
}
Loading…
Cancel
Save