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.
nmWTAI-Platform/Include/nmNum/nmSubWxs/nmWxWellboreStorageCalculat...

58 lines
2.4 KiB
C++

#ifndef NMWXWELLBORESTORAGECALCULATORTUBINGDATA_H
#define NMWXWELLBORESTORAGECALCULATORTUBINGDATA_H
#include "nmSubWxs_global.h"
#include "iDlgBase.h"
#include <QVariantList>
class nmWellboreStorageTable;
class QComboBox;
class QPushButton;
// 油管规格只读查询窗口;仅返回选中规格的米制内径,不直接修改主计算器或井参数。
class NM_SUB_WXS_EXPORT nmWxWellboreStorageCalculatorTubingData : public iDlgBase
{
Q_OBJECT
public:
// 创建规格表和框架长度单位列表,初始不选中规格。
explicit nmWxWellboreStorageCalculatorTubingData(QWidget* pParent = nullptr);
// 释放规格表,所有控件由 Qt 父对象管理。
~nmWxWellboreStorageCalculatorTubingData();
// 返回选中规格的原始米制内径;无真实选中数据行时返回 -1。
double getSelectedTubingID() const;
// 按传入的米制内径选中匹配规格;无匹配项时保持未选中。
void setSelectedTubingID(double dId);
public slots:
// 仅允许确认有效规格,单位行和空白区域不能产生回填值。
void accept();
private slots:
// 从原规格数据换算外径/内径显示,失败时恢复旧单位。
void onUnitChanged();
// 根据真实选中数据行更新确定按钮。
void updateAcceptState();
// 双击数据行确认;双击单位行不能关闭窗口。
void onRowDoubleClicked(int nRow, int nColumn);
private:
// 创建主题表格、框架单位选择及标准确定/取消底栏。
void initUI();
// 连接单位、选择及双击事件。
void initConnections();
// 加载现有油管规格,保留数据顺序及原始数值。
void setupTableData();
// 预检整列换算后批量更新显示,不改变规格基准数据或当前选择。
bool displayColumn(int nColumn, const QString& sUnit);
nmWellboreStorageTable* m_pTableWidget; // 第 0 行为单位,规格从第 1 行开始。
QPushButton* m_pOkButton; // 有效选中规格后启用。
QComboBox* m_pOdUnitCombo; // 油管外径显示单位。
QComboBox* m_pIdUnitCombo; // 油管内径显示单位。
QString m_sOdUnit; // 上次成功显示的外径单位。
QString m_sIdUnit; // 上次成功显示的内径单位。
QList<QVariantList> m_listTubingData; // 原规格数据:米制外径、原重量列、米制内径。
};
#endif // NMWXWELLBORESTORAGECALCULATORTUBINGDATA_H