diff --git a/Bin/Config/Lang/cn/nmNum_cn.qm b/Bin/Config/Lang/cn/nmNum_cn.qm
index b0806ed..003de21 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 d27e00e..b604758 100644
--- a/Bin/Config/Lang/cn/nmNum_cn.ts
+++ b/Bin/Config/Lang/cn/nmNum_cn.ts
@@ -6815,9 +6815,11 @@ Average pressure in contour: %2 MPa
Homogeneous均质储层
Dual porosity pseudo steady state双重介质拟稳态
Fault flow model断层流动模型
- Region flow model复合区流动模型
+ Boundary type边界类型
Leaky泄漏
Composite limit复合边界
+ Permeable boundary可渗透边界
+ Composite boundary复合边界
Fracture flow model裂缝流动模型
Finite conductivity有限导流
Infinite conductivity无限导流
@@ -6830,11 +6832,11 @@ Average pressure in contour: %2 MPa
Basic properties基础特性
Fluid parameters流体参数
Compression and saturation压缩与饱和度
- Dual-medium parameters双重介质参数
+ Reservoir medium parameters储层介质参数
Geometry几何位置
Flow properties流动属性
Conductivity properties导流属性
- Region properties区域属性
+ Boundary properties边界属性
nmSubWndMain
diff --git a/Include/nmNum/nmSubWxs/nmReservoirParameterCatalog.h b/Include/nmNum/nmSubWxs/nmReservoirParameterCatalog.h
index 0824746..37b6783 100644
--- a/Include/nmNum/nmSubWxs/nmReservoirParameterCatalog.h
+++ b/Include/nmNum/nmSubWxs/nmReservoirParameterCatalog.h
@@ -72,6 +72,7 @@ struct NM_SUB_WXS_EXPORT nmReservoirParameterGroupInfo
int m_nRowSpan; ///< 分组纵向跨越的行数。
int m_nColumnSpan; ///< 分组横跨的列数。
bool m_bValueRightAligned; ///< 数值输入是否右对齐。
+ bool m_bFieldsCentered; ///< 分组内字段是否水平居中并随宽度伸展。
QList m_listFields; ///< 分组内按显示顺序排列的字段。
};
diff --git a/Include/nmNum/nmSubWxs/nmReservoirParameterField.h b/Include/nmNum/nmSubWxs/nmReservoirParameterField.h
index 8e7a3fe..d1d67a2 100644
--- a/Include/nmNum/nmSubWxs/nmReservoirParameterField.h
+++ b/Include/nmNum/nmSubWxs/nmReservoirParameterField.h
@@ -70,10 +70,14 @@ public:
* @brief 将字段的三个直接控件加入分组网格。
* @param pLayout 所属分组的网格布局。
* @param nRow 字段所在行。
+ * @param nColumnOffset 字段起始列偏移。
* @param sError 初始化失败原因。
* @return 参数元数据和单位绑定均成功时返回true。
*/
- bool initialize(QGridLayout* pLayout, int nRow, QString& sError);
+ bool initialize(QGridLayout* pLayout,
+ int nRow,
+ int nColumnOffset,
+ QString& sError);
/** @brief 返回编辑会话使用的稳定参数ID。 */
QString parameterId() const;
@@ -131,10 +135,13 @@ private:
/** @brief 创建数值输入框及单位控件。 */
bool createNumericEditor(QGridLayout* pLayout,
int nRow,
+ int nColumnOffset,
QString& sError);
/** @brief 创建稳定code枚举下拉框。 */
- void createEnumEditor(QGridLayout* pLayout, int nRow);
+ void createEnumEditor(QGridLayout* pLayout,
+ int nRow,
+ int nColumnOffset);
/** @brief 按XML精度格式化无单位或整数参数。 */
QString formatBaseValue(double dValue) const;
diff --git a/Src/nmNum/nmSubWxs/nmReservoirParameterCatalog.cpp b/Src/nmNum/nmSubWxs/nmReservoirParameterCatalog.cpp
index 6dd421d..d9f8beb 100644
--- a/Src/nmNum/nmSubWxs/nmReservoirParameterCatalog.cpp
+++ b/Src/nmNum/nmSubWxs/nmReservoirParameterCatalog.cpp
@@ -20,9 +20,11 @@ static const char* const s_pCatalogTranslationMarkers[] =
QT_TRANSLATE_NOOP("nmWxReservoirPropertiesEditor", "Homogeneous"),
QT_TRANSLATE_NOOP("nmWxReservoirPropertiesEditor", "Dual porosity pseudo steady state"),
QT_TRANSLATE_NOOP("nmWxReservoirPropertiesEditor", "Fault flow model"),
- QT_TRANSLATE_NOOP("nmWxReservoirPropertiesEditor", "Region flow model"),
+ QT_TRANSLATE_NOOP("nmWxReservoirPropertiesEditor", "Boundary type"),
QT_TRANSLATE_NOOP("nmWxReservoirPropertiesEditor", "Leaky"),
QT_TRANSLATE_NOOP("nmWxReservoirPropertiesEditor", "Composite limit"),
+ QT_TRANSLATE_NOOP("nmWxReservoirPropertiesEditor", "Permeable boundary"),
+ QT_TRANSLATE_NOOP("nmWxReservoirPropertiesEditor", "Composite boundary"),
QT_TRANSLATE_NOOP("nmWxReservoirPropertiesEditor", "Fracture flow model"),
QT_TRANSLATE_NOOP("nmWxReservoirPropertiesEditor", "Finite conductivity"),
QT_TRANSLATE_NOOP("nmWxReservoirPropertiesEditor", "Infinite conductivity"),
@@ -36,11 +38,11 @@ static const char* const s_pCatalogTranslationMarkers[] =
QT_TRANSLATE_NOOP("nmWxReservoirPropertiesEditor", "Vertical well"),
QT_TRANSLATE_NOOP("nmWxReservoirPropertiesEditor", "Fractured vertical well"),
QT_TRANSLATE_NOOP("nmWxReservoirPropertiesEditor", "Multistage fractured horizontal well"),
- QT_TRANSLATE_NOOP("nmWxReservoirPropertiesEditor", "Dual-medium parameters"),
+ QT_TRANSLATE_NOOP("nmWxReservoirPropertiesEditor", "Reservoir medium parameters"),
QT_TRANSLATE_NOOP("nmWxReservoirPropertiesEditor", "Geometry"),
QT_TRANSLATE_NOOP("nmWxReservoirPropertiesEditor", "Flow properties"),
QT_TRANSLATE_NOOP("nmWxReservoirPropertiesEditor", "Conductivity properties"),
- QT_TRANSLATE_NOOP("nmWxReservoirPropertiesEditor", "Region properties")
+ QT_TRANSLATE_NOOP("nmWxReservoirPropertiesEditor", "Boundary properties")
};
/** @brief 返回当前语言下的界面文字。 */
@@ -108,19 +110,21 @@ nmReservoirParameterFieldInfo reservoirModelField(
return oField;
}
-/** @brief 创建断层或复合区流动模型字段。 */
+/** @brief 按指定显示文字创建断层或复合区流动模型字段。 */
nmReservoirParameterFieldInfo leakageModelField(
const QString& sParameterId,
- const char* pLabel)
+ const char* pLabel,
+ const char* pLeakyText,
+ const char* pCompositeText)
{
nmReservoirParameterFieldInfo oField;
oField.m_sParameterId = sParameterId;
oField.m_sLabel = editorText(pLabel);
oField.m_eEditorType = NM_RESERVOIR_EDITOR_ENUM;
oField.m_bUnitEnabled = false;
- oField.m_listOptions.append(enumOption("leaky", "Leaky"));
+ oField.m_listOptions.append(enumOption("leaky", pLeakyText));
oField.m_listOptions.append(enumOption(
- "composite_limit", "Composite limit"));
+ "composite_limit", pCompositeText));
return oField;
}
@@ -154,6 +158,7 @@ nmReservoirParameterGroupInfo parameterGroup(
oGroup.m_nRowSpan = 1;
oGroup.m_nColumnSpan = nColumnSpan;
oGroup.m_bValueRightAligned = false;
+ oGroup.m_bFieldsCentered = false;
return oGroup;
}
@@ -535,7 +540,8 @@ nmReservoirParameterCatalog::createObjectInfos(
oSnapshot.m_vecRegionMarks[nIndex].getRegionMarkName();
nmReservoirParameterGroupInfo oDual =
- parameterGroup("Dual-medium parameters", 0, 0, 2);
+ parameterGroup("Reservoir medium parameters", 0, 0, 2);
+ oDual.m_bFieldsCentered = true;
oDual.m_listFields
<< reservoirModelField(prefixed(
oInfo.m_sObjectCode, "RM_ReservoirType"))
@@ -584,7 +590,9 @@ nmReservoirParameterCatalog::createObjectInfos(
oFlow.m_listFields
<< leakageModelField(prefixed(
oInfo.m_sObjectCode, "FT_FlowModel"),
- "Fault flow model")
+ "Fault flow model",
+ "Leaky",
+ "Composite limit")
<< numericField(prefixed(
oInfo.m_sObjectCode, "FT_Leakage"),
"FT_Leakage");
@@ -659,11 +667,14 @@ nmReservoirParameterCatalog::createObjectInfos(
oSnapshot.m_vecRegions[nIndex].getRegoinName();
nmReservoirParameterGroupInfo oRegion =
- parameterGroup("Region properties", 0, 0, 2);
+ parameterGroup("Boundary properties", 0, 0, 2);
+ oRegion.m_bFieldsCentered = true;
oRegion.m_listFields
<< leakageModelField(prefixed(
oInfo.m_sObjectCode, "R_FlowModel"),
- "Region flow model")
+ "Boundary type",
+ "Permeable boundary",
+ "Composite boundary")
<< numericField(prefixed(
oInfo.m_sObjectCode, "R_Leakage"),
"R_Leakage");
diff --git a/Src/nmNum/nmSubWxs/nmReservoirParameterField.cpp b/Src/nmNum/nmSubWxs/nmReservoirParameterField.cpp
index 23a1755..6e80ce8 100644
--- a/Src/nmNum/nmSubWxs/nmReservoirParameterField.cpp
+++ b/Src/nmNum/nmSubWxs/nmReservoirParameterField.cpp
@@ -64,6 +64,7 @@ nmReservoirParameterField::~nmReservoirParameterField()
bool nmReservoirParameterField::initialize(QGridLayout* pLayout,
int nRow,
+ int nColumnOffset,
QString& sError)
{
if (pLayout == nullptr)
@@ -75,7 +76,7 @@ bool nmReservoirParameterField::initialize(QGridLayout* pLayout,
// 第一步:枚举字段不依赖XML数值定义,直接创建稳定code下拉框。
if (isEnum())
{
- createEnumEditor(pLayout, nRow);
+ createEnumEditor(pLayout, nRow, nColumnOffset);
sError.clear();
return true;
}
@@ -91,7 +92,7 @@ bool nmReservoirParameterField::initialize(QGridLayout* pLayout,
}
// 第三步:创建原型中的标签、输入框和单位列,不增加字段外框。
- return createNumericEditor(pLayout, nRow, sError);
+ return createNumericEditor(pLayout, nRow, nColumnOffset, sError);
}
QString nmReservoirParameterField::parameterId() const
@@ -137,6 +138,7 @@ int nmReservoirParameterField::editorHeight()
bool nmReservoirParameterField::createNumericEditor(
QGridLayout* pLayout,
int nRow,
+ int nColumnOffset,
QString& sError)
{
QWidget* pParentWidget = pLayout->parentWidget();
@@ -153,8 +155,8 @@ bool nmReservoirParameterField::createNumericEditor(
m_pLineEdit->setSizePolicy(QSizePolicy::Expanding,
QSizePolicy::Fixed);
- pLayout->addWidget(m_pLabel, nRow, 0);
- pLayout->addWidget(m_pLineEdit, nRow, 1);
+ pLayout->addWidget(m_pLabel, nRow, nColumnOffset);
+ pLayout->addWidget(m_pLineEdit, nRow, nColumnOffset + 1);
// 有单位参数直接注册到主对话框绑定器;字段只按控件指针读写,
// 因此多口井共用同一基础参数ID时也不会发生串值。
@@ -166,7 +168,7 @@ bool nmReservoirParameterField::createNumericEditor(
m_pUnitComboBox->setMinimumWidth(unitMinimumWidth());
m_pUnitComboBox->setSizePolicy(QSizePolicy::Expanding,
QSizePolicy::Fixed);
- pLayout->addWidget(m_pUnitComboBox, nRow, 2);
+ pLayout->addWidget(m_pUnitComboBox, nRow, nColumnOffset + 2);
if (m_pUnitService == nullptr ||
!m_pUnitService->bindUnitField(
m_pLineEdit,
@@ -186,7 +188,7 @@ bool nmReservoirParameterField::createNumericEditor(
m_pUnitLabel->setMinimumWidth(unitMinimumWidth());
m_pUnitLabel->setSizePolicy(QSizePolicy::Expanding,
QSizePolicy::Fixed);
- pLayout->addWidget(m_pUnitLabel, nRow, 2);
+ pLayout->addWidget(m_pUnitLabel, nRow, nColumnOffset + 2);
}
updateValidationAppearance(true);
@@ -195,7 +197,8 @@ bool nmReservoirParameterField::createNumericEditor(
}
void nmReservoirParameterField::createEnumEditor(QGridLayout* pLayout,
- int nRow)
+ int nRow,
+ int nColumnOffset)
{
QWidget* pParentWidget = pLayout->parentWidget();
m_pLabel = new QLabel(m_oFieldInfo.m_sLabel, pParentWidget);
@@ -224,9 +227,9 @@ void nmReservoirParameterField::createEnumEditor(QGridLayout* pLayout,
m_pUnitLabel->setSizePolicy(QSizePolicy::Expanding,
QSizePolicy::Fixed);
- pLayout->addWidget(m_pLabel, nRow, 0);
- pLayout->addWidget(m_pValueComboBox, nRow, 1);
- pLayout->addWidget(m_pUnitLabel, nRow, 2);
+ pLayout->addWidget(m_pLabel, nRow, nColumnOffset);
+ pLayout->addWidget(m_pValueComboBox, nRow, nColumnOffset + 1);
+ pLayout->addWidget(m_pUnitLabel, nRow, nColumnOffset + 2);
}
void nmReservoirParameterField::setBaseValue(const QVariant& oValue)
diff --git a/Src/nmNum/nmSubWxs/nmReservoirParameterPage.cpp b/Src/nmNum/nmSubWxs/nmReservoirParameterPage.cpp
index 3a0f630..b1d2884 100644
--- a/Src/nmNum/nmSubWxs/nmReservoirParameterPage.cpp
+++ b/Src/nmNum/nmSubWxs/nmReservoirParameterPage.cpp
@@ -234,14 +234,31 @@ bool nmReservoirParameterPage::buildGroup(
pFieldLayout->setContentsMargins(8, 15, 8, 10);
pFieldLayout->setHorizontalSpacing(6);
pFieldLayout->setVerticalSpacing(6);
- // 标签列由本组最长标签的自然宽度决定,数值列和单位列按比例使用剩余空间。
- pFieldLayout->setColumnStretch(0, 0);
- pFieldLayout->setColumnStretch(1, 8);
- pFieldLayout->setColumnStretch(2, 5);
+ int nFieldColumnOffset = 0;
+ // 字段较少的通栏分组使用独立的左右弹性列,
+ // 使参数区域保持居中,输入列仍可随窗口宽度适度伸展。
+ if (oGroupInfo.m_bFieldsCentered)
+ {
+ nFieldColumnOffset = 1;
+ pFieldLayout->setColumnStretch(0, 1);
+ pFieldLayout->setColumnStretch(1, 0);
+ pFieldLayout->setColumnStretch(2, 1);
+ pFieldLayout->setColumnStretch(3, 0);
+ pFieldLayout->setColumnStretch(4, 1);
+ }
+ else
+ {
+ // 常规分组由最长标签决定标签列宽,数值列和单位列按比例伸展。
+ pFieldLayout->setColumnStretch(0, 0);
+ pFieldLayout->setColumnStretch(1, 8);
+ pFieldLayout->setColumnStretch(2, 5);
+ }
pFieldLayout->setColumnMinimumWidth(
- 1, nmReservoirParameterField::editorMinimumWidth());
+ nFieldColumnOffset + 1,
+ nmReservoirParameterField::editorMinimumWidth());
pFieldLayout->setColumnMinimumWidth(
- 2, nmReservoirParameterField::unitMinimumWidth());
+ nFieldColumnOffset + 2,
+ nmReservoirParameterField::unitMinimumWidth());
// 每个字段只把三个直接控件放入此网格,不产生字段外框或子面板。
for (int nFieldIndex = 0;
@@ -253,7 +270,10 @@ bool nmReservoirParameterPage::buildGroup(
oGroupInfo.m_listFields[nFieldIndex],
m_pUnitService,
pGroupBox);
- if (!pField->initialize(pFieldLayout, nFieldIndex, sError))
+ if (!pField->initialize(pFieldLayout,
+ nFieldIndex,
+ nFieldColumnOffset,
+ sError))
{
delete pGroupContainer;
return false;