|
|
#ifndef NMWXNUMERICALDESIGN_H
|
|
|
#define NMWXNUMERICALDESIGN_H
|
|
|
|
|
|
#include "nmSubWxs_global.h"
|
|
|
#include "iDlgBase.h"
|
|
|
#include "nmParameterField.h"
|
|
|
#include <QWidget>
|
|
|
|
|
|
// 前向声明
|
|
|
class QGroupBox;
|
|
|
class QCheckBox;
|
|
|
class QLineEdit;
|
|
|
class QPushButton;
|
|
|
class QVBoxLayout;
|
|
|
class QHBoxLayout;
|
|
|
class QLabel;
|
|
|
class QRadioButton;
|
|
|
class QComboBox;
|
|
|
class QSpinBox;
|
|
|
class nmDataWellBase;
|
|
|
class nmDataDiagnostic;
|
|
|
class nmDataReservoir;
|
|
|
class nmDataAnalyzeManager;
|
|
|
|
|
|
/**
|
|
|
* @brief 生成数值模型Dock面板。
|
|
|
* @note 面板常驻成果窗口,输入校验通过后直接提交到所属数据管理器。
|
|
|
*/
|
|
|
class NM_SUB_WXS_EXPORT nmWxNumericalDesign :
|
|
|
public iDlgBase,
|
|
|
public nmIParameterUnitService
|
|
|
{
|
|
|
Q_OBJECT
|
|
|
public:
|
|
|
/** @brief 创建绑定到指定数值分析数据管理器的设计面板。 */
|
|
|
explicit nmWxNumericalDesign(nmDataAnalyzeManager* pDataManager,
|
|
|
QWidget* pParent = nullptr);
|
|
|
~nmWxNumericalDesign();
|
|
|
|
|
|
/** @brief 通过iDlgBase按NM参数系列绑定单位控件。 */
|
|
|
virtual bool bindUnitField(QLineEdit* pLineEdit,
|
|
|
QComboBox* pUnitComboBox,
|
|
|
const QString& sBaseParameterId);
|
|
|
|
|
|
/** @brief 将业务基准单位值写入字段。 */
|
|
|
virtual void setUnitBaseValue(QLineEdit* pLineEdit,
|
|
|
double dBaseValue);
|
|
|
|
|
|
/** @brief 读取字段的业务基准单位值。 */
|
|
|
virtual double unitBaseValue(QLineEdit* pLineEdit) const;
|
|
|
|
|
|
/** @brief 使用参数定义校验单位字段输入。 */
|
|
|
virtual bool isUnitInputValid(QLineEdit* pLineEdit);
|
|
|
|
|
|
/** @brief 返回字段当前显示单位。 */
|
|
|
virtual QString currentUnit(QLineEdit* pLineEdit) const;
|
|
|
|
|
|
/** @brief 返回字段单位组,不转移所有权。 */
|
|
|
virtual iUnitGroup* unitGroup(QLineEdit* pLineEdit) const;
|
|
|
|
|
|
// 静态方法,供外部调用以通知时间变表皮状态变化
|
|
|
static void notifyTimeDependentSkinChanged(const QString& wellName, bool checked);
|
|
|
/** @brief 仅刷新属于指定数据管理器的活动面板结果井列表。 */
|
|
|
static void notifyResultWellSelectorChanged(
|
|
|
nmDataAnalyzeManager* pDataManager,
|
|
|
const QString& sWellCode = QString());
|
|
|
/** @brief 将本面板设为活动实例,并按所属数据管理器刷新结果井列表。 */
|
|
|
void activateCurrentInstance();
|
|
|
|
|
|
signals:
|
|
|
void sigGenerateClicked(); // 点击生成按钮时发出的信号
|
|
|
void sigIncludeWells(); // 包含其他井后刷新参数栏的信号
|
|
|
/** @brief 用户切换结果井时发送稳定 WellCode。 */
|
|
|
void sigResultWellChanged(const QString& sWellCode);
|
|
|
|
|
|
private slots:
|
|
|
// 新增的槽函数
|
|
|
void onGenerateClicked(); // 生成按钮点击槽
|
|
|
void onResetFromDiagnosticClicked(); // "从诊断复位"按钮点击槽
|
|
|
void onResetFromAnalyticalClicked(); // "从解析复位"按钮点击槽
|
|
|
void onManualOutputSettingsClicked(); // "手动输出设置"按钮点击槽
|
|
|
void onRedefineKrPcIconClicked(); // "重新定义 KrPc"图标按钮点击槽
|
|
|
void onApplyUnconsolidationIconClicked(); // "应用未固结"图标按钮点击槽
|
|
|
void onCustomNumericalSettingsClicked(); // "自定义数值设置"按钮点击槽
|
|
|
void onAutomaticFittingClicked();
|
|
|
void onForecastClicked();
|
|
|
void onSensitiveClicked();
|
|
|
|
|
|
// 现有和调整的槽函数
|
|
|
void onOptionsIconClicked(); // "包含其他井"按钮点击
|
|
|
/** @brief 同步包含井总开关,并按实际有效井集合处理网格失效。 */
|
|
|
void onIncludeOtherWellsToggled(bool bChecked);
|
|
|
/** @brief Map 井或井数据变化后刷新包含井入口和结果井列表。 */
|
|
|
void onWellCollectionChanged();
|
|
|
void onTimeIconClicked(); // "时间相关"按钮 (在Advanced组中)
|
|
|
void onOutputResultFieldsAutomaticToggled(bool checked); // "输出结果字段"自动单选按钮状态改变槽
|
|
|
void onOutputResultFieldsManualToggled(bool checked); // "输出结果字段"手动单选按钮状态改变槽
|
|
|
|
|
|
// 处理 Output result fields 复选框的切换
|
|
|
void onOutputResultFieldsToggled(bool checked);
|
|
|
// 查看井结果下拉框切换槽
|
|
|
void onResultWellChanged(int index);
|
|
|
// 当前模型下拉框切换槽
|
|
|
void onCurrentModelChanged(int index);
|
|
|
/** @brief 求解器库选择发生变化。 */
|
|
|
void onPebiSolverTypeChanged(int index);
|
|
|
/** @brief 将求解器设置同步到当前数据管理器。 */
|
|
|
void onPebiSolverSettingsChanged();
|
|
|
|
|
|
/** @brief 输入变化时刷新时间步校验状态。 */
|
|
|
void onTimeStepValueChanged(const QString& sText);
|
|
|
/** @brief 编辑完成后提交完整且合法的时间步设置。 */
|
|
|
void onTimeStepEditingFinished();
|
|
|
// 保存时间变表皮状态
|
|
|
void onTimeDependentCheck(bool checked);
|
|
|
|
|
|
private:
|
|
|
// 初始化UI组件的私有函数
|
|
|
// 初始化主选项组
|
|
|
void initMainOptionsGroup();
|
|
|
// 初始化模型与结果组
|
|
|
void initModelAndResultGroup();
|
|
|
void initOutputGroup(); // 初始化输出组 (新)
|
|
|
void initAdvancedGroup(); // 初始化高级组 (新)
|
|
|
void initTimeSteppingGroup(); // 初始化时间步进组
|
|
|
void initNumericalSettingsGroup(); // 初始化数值设置组 (新)
|
|
|
/** @brief 初始化PEBI求解器设置组。 */
|
|
|
void initPebiSolverSettingsGroup();
|
|
|
/** @brief 根据求解器库更新加速参数控件状态。 */
|
|
|
void updatePebiSolverSettingEnabled();
|
|
|
/** @brief 将PEBI求解器设置保存到当前数据管理器。 */
|
|
|
void updatePebiSolverSettingsToData();
|
|
|
void setupConnections(); // 设置信号槽连接
|
|
|
void initButton(); // 初始化按钮
|
|
|
|
|
|
// 根据当前数据中心的数据更新时间步设置组件的值
|
|
|
void updateUiFromData();
|
|
|
// 根据UI更新模型数据,任何字段非法时不产生部分写入
|
|
|
bool updateDataFromUi(QString& sError);
|
|
|
// 收集并校验时间步字段,返回值均为求解器使用的小时基准值
|
|
|
bool collectTimeStepValues(double& dTimeGrowthExponent,
|
|
|
double& dDtMin,
|
|
|
double& dDtMax,
|
|
|
QString& sError);
|
|
|
// 将焦点定位到第一个非法时间步字段
|
|
|
void focusFirstInvalidTimeStepField();
|
|
|
/** @brief 按统一结果资格填充下拉框,条目数据保存 WellCode。 */
|
|
|
void fillResultWellCombo(const QString& sSelectedWellCode = QString());
|
|
|
// 刷新当前模型显示
|
|
|
void updateCurrentModelDisplay();
|
|
|
// 刷新当前井的时间变表皮状态
|
|
|
void updateTimeDependentSkinDisplay();
|
|
|
/** @brief 仅当 Map 存在其他有产量数值井时启用 Include Other Wells。 */
|
|
|
void updateIncludeOtherWellsAvailability();
|
|
|
|
|
|
private:
|
|
|
/** @brief 当前Dock所属数据管理器,不拥有所有权。 */
|
|
|
nmDataAnalyzeManager* m_pDataManager;
|
|
|
|
|
|
// 主选项组件
|
|
|
QGroupBox* m_pMainOptionsGroup; // 主选项分组框
|
|
|
QCheckBox* m_pIncludeOtherWellsCheck; // "包含其他井"复选框
|
|
|
QPushButton* m_pOptionsGearButton; // 其他井按钮
|
|
|
QCheckBox* m_pImposePiCheck; // "施加 Pi"复选框
|
|
|
QCheckBox* m_pShowAveragePressureCheck; // "显示平均压力"复选框 (新)
|
|
|
QPushButton* m_pResetDiagnosticButton; // "从诊断复位"按钮 (新)
|
|
|
QPushButton* m_pResetAnalyticalButton; // "从解析复位"按钮 (新)
|
|
|
|
|
|
// 模型与结果切换控件
|
|
|
QGroupBox* m_pModelAndResultGroup; ///< 当前模型与结果井控件分组。
|
|
|
QComboBox* m_pResultWellCombo; ///< 可展示结果的井列表,itemData 保存 WellCode。
|
|
|
bool m_bFillingResultWellCombo; ///< 程序填充结果井时屏蔽切换槽。
|
|
|
QComboBox* m_pCurrentModelCombo; ///< 当前单相数值模型显示与选择控件。
|
|
|
bool m_bFillingCurrentModelCombo; ///< 程序刷新模型时屏蔽切换槽。
|
|
|
|
|
|
// 输出组组件 (新)
|
|
|
QGroupBox* m_pOutputGroup; // 输出分组框
|
|
|
QCheckBox* m_pOutputResultFieldsCheck; // 输出结果文件复选框
|
|
|
QRadioButton* m_pOutputAutomaticRadio; // "自动"输出单选按钮
|
|
|
QRadioButton* m_pOutputManualRadio; // "手动"输出单选按钮
|
|
|
QCheckBox* m_pOutputWellDrainageCheck; // "输出井排量结果"复选框
|
|
|
QPushButton* m_pOutputManualIconButton; // "手动"输出旁边的图标按钮
|
|
|
|
|
|
// 高级组组件 (新)
|
|
|
QGroupBox* m_pAdvancedGroup; // 高级分组框
|
|
|
QCheckBox* m_pTimeDependentCheck; // "时间相关"复选框
|
|
|
QPushButton* m_pTimeDependentIconButton; // "时间相关"按钮
|
|
|
QCheckBox* m_pUseWellIntakeCheck; // "使用井筒进水"复选框 (从井筒模型组移入)
|
|
|
QCheckBox* m_pRedefineKrPcCheck; // "重新定义 KrPc 在水力压裂中"复选框
|
|
|
QPushButton* m_pRedefineKrPcIconButton; // "重新定义 KrPc"旁边的图标按钮
|
|
|
QCheckBox* m_pApplyUnconsolidationCheck; // "应用未固结在水力压裂中"复选框
|
|
|
QPushButton* m_pApplyUnconsolidationIconButton; // "应用未固结"旁边的图标按钮
|
|
|
QCheckBox* m_pUseDFNCheck; // "使用 DFN"复选框
|
|
|
|
|
|
// 时间步进组件
|
|
|
QGroupBox* m_pTimeSteppingGroup; // 时间步进分组框
|
|
|
nmParameterField* m_pTimeGrowthExponentField; ///< 时间增长指数字段。
|
|
|
nmParameterField* m_pDtMinField; ///< 最小时间步字段。
|
|
|
nmParameterField* m_pDtMaxField; ///< 最大时间步字段。
|
|
|
|
|
|
// 数值设置组件
|
|
|
QGroupBox* m_pNumericalSettingsGroup; // 数值设置分组框
|
|
|
QRadioButton* m_pUseAutomaticSettingsRadio; // "使用自动设置"单选按钮
|
|
|
QRadioButton* m_pUseCustomSettingsRadio; // "使用自定义设置"单选按钮
|
|
|
QPushButton* m_pCustomSettingsIconButton; // "自定义设置"旁边的图标按钮
|
|
|
|
|
|
/** @brief PEBI求解器设置分组框。 */
|
|
|
QGroupBox* m_pPebiSolverSettingsGroup;
|
|
|
/** @brief 求解器库下拉框。 */
|
|
|
QComboBox* m_pPebiSolverTypeCombo;
|
|
|
/** @brief OpenMP线程数下拉框。 */
|
|
|
QComboBox* m_pPebiOmpThreadsCombo;
|
|
|
/** @brief ILU复用步数输入框。 */
|
|
|
QSpinBox* m_pPebiIluReuseStepsSpin;
|
|
|
|
|
|
// 按钮
|
|
|
QPushButton* m_pGenerateButton;
|
|
|
QPushButton* m_pAutomaticfittingBtn;
|
|
|
QPushButton* m_pForecastBtn;
|
|
|
QPushButton* m_pSensitiveBtn;
|
|
|
QHBoxLayout* m_pGenerateLayout;
|
|
|
|
|
|
// 主布局
|
|
|
QVBoxLayout* m_pMainLayout;
|
|
|
|
|
|
// 图标路径
|
|
|
QString m_sIconDir;
|
|
|
|
|
|
static nmWxNumericalDesign* s_pCurrentInstance; ///< 当前活动成果窗口的设计面板,不拥有对象。
|
|
|
|
|
|
};
|
|
|
|
|
|
#endif // NMWXNUMERICALDESIGN_H
|