You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
149 lines
5.2 KiB
C++
149 lines
5.2 KiB
C++
#pragma once
|
|
|
|
#include "iDlgBase.h"
|
|
#include "nmSubWxs_global.h"
|
|
#include "nmReservoirParameterCatalog.h"
|
|
#include "nmReservoirParameterField.h"
|
|
|
|
class nmIReservoirPropertiesDataSource;
|
|
class nmReservoirPropertiesSession;
|
|
class nmReservoirParameterPage;
|
|
class QButtonGroup;
|
|
class QDialogButtonBox;
|
|
class QFrame;
|
|
class QHBoxLayout;
|
|
class QLabel;
|
|
class QStackedWidget;
|
|
class QToolButton;
|
|
|
|
/**
|
|
* @brief 数值试井储层特性参数编辑器。
|
|
* @note 对话框是唯一可见面板,负责原型式导航、单位服务、整体校验和统一提交。
|
|
*/
|
|
class NM_SUB_WXS_EXPORT nmWxReservoirPropertiesEditor :
|
|
public iDlgBase,
|
|
public nmIReservoirParameterUnitService
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
/**
|
|
* @brief 构造储层特性参数编辑器。
|
|
* @param pDataSource 参数数据源,不转移所有权。
|
|
* @param pParent 父窗口。
|
|
*/
|
|
nmWxReservoirPropertiesEditor(
|
|
nmIReservoirPropertiesDataSource* pDataSource,
|
|
QWidget* pParent = nullptr);
|
|
|
|
/** @brief 析构编辑器。 */
|
|
virtual ~nmWxReservoirPropertiesEditor();
|
|
|
|
/**
|
|
* @brief 初始化编辑会话和全部页面。
|
|
* @param sError 输出初始化错误。
|
|
* @return 初始化成功返回true。
|
|
*/
|
|
bool initialize(QString& sError);
|
|
|
|
/** @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;
|
|
|
|
public slots:
|
|
/** @brief 校验并一次性提交工作副本。 */
|
|
virtual void accept();
|
|
|
|
/** @brief 丢弃工作副本并关闭窗口。 */
|
|
virtual void reject();
|
|
|
|
private slots:
|
|
/** @brief 切换顶部参数分类。 */
|
|
void slotCategoryButtonClicked(int nCategory);
|
|
|
|
/** @brief 根据各页面状态更新确定按钮。 */
|
|
void slotPageValidityChanged(bool bValid);
|
|
|
|
/** @brief 进入当前界面的上下文帮助模式。 */
|
|
void slotHelp();
|
|
|
|
private:
|
|
/** @brief 创建编辑器的原型式固定布局。 */
|
|
void createUi();
|
|
|
|
/** @brief 创建顶部分组导航。 */
|
|
QWidget* createCategoryBar();
|
|
|
|
/**
|
|
* @brief 创建一个带底部分组标题的ribbon区域。
|
|
* @param sCaption 分组标题。
|
|
* @param pParent 父控件。
|
|
* @param pCommandLayout 输出的命令按钮布局,不转移所有权。
|
|
* @return 创建完成的分组控件。
|
|
*/
|
|
QWidget* createRibbonGroup(const QString& sCaption,
|
|
QWidget* pParent,
|
|
QHBoxLayout*& pCommandLayout);
|
|
|
|
/**
|
|
* @brief 创建框架风格的导航分组竖向分隔线。
|
|
* @param pParent 分隔线所属的顶部导航面板。
|
|
* @return 创建完成的Qt原生分隔线。
|
|
*/
|
|
QFrame* createRibbonSeparator(QWidget* pParent);
|
|
|
|
/**
|
|
* @brief 创建一个参数分类按钮。
|
|
* @param eCategory 分类枚举。
|
|
* @param sText 按钮文字。
|
|
* @param sIconName 框架图标名称。
|
|
* @param pParent 所属ribbon分组。
|
|
* @return 创建完成的工具按钮。
|
|
*/
|
|
QToolButton* createCategoryButton(
|
|
nmReservoirPropertiesCategory eCategory,
|
|
const QString& sText,
|
|
const QString& sIconName,
|
|
QWidget* pParent);
|
|
|
|
/** @brief 创建帮助命令按钮。 */
|
|
QToolButton* createHelpButton(QWidget* pParent);
|
|
|
|
/** @brief 创建六个共享参数页面。 */
|
|
void createPages();
|
|
|
|
/** @brief 根据各分类的实际对象数量更新顶部按钮启用状态。 */
|
|
void updateCategoryButtonStates();
|
|
|
|
/** @brief 校验所有页面并更新确定按钮。 */
|
|
bool validateAllPages();
|
|
|
|
nmIReservoirPropertiesDataSource* m_pDataSource; ///< 参数数据源,不拥有所有权。
|
|
nmReservoirPropertiesSession* m_pSession; ///< 对话框独占编辑会话。
|
|
QButtonGroup* m_pCategoryButtonGroup; ///< 顶部分类按钮及稳定页面ID映射。
|
|
QStackedWidget* m_pStackedWidget; ///< 无边框分类页面堆栈。
|
|
QDialogButtonBox* m_pButtonBox; ///< 确定和取消按钮区。
|
|
QToolButton* m_pFooterHelpButton; ///< 底部帮助命令。
|
|
QLabel* m_pStatusLabel; ///< 校验或提交错误提示。
|
|
nmReservoirParameterPage* m_pPages[NM_RESERVOIR_PAGE_COUNT]; ///< 六个参数页。
|
|
int m_nCurrentCategory; ///< 当前显示分类。
|
|
bool m_bInitialized; ///< 编辑器是否初始化完成。
|
|
};
|