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/nmWxMeasureDlg.h

76 lines
2.7 KiB
C++

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#ifndef NMWXMEASUREDLG_H
#define NMWXMEASUREDLG_H
#include "iDlgBase.h"
#include "nmSubWxs_global.h"
#include <QPointer>
class QLineEdit;
class QPushButton;
class nmDataAnalyzeManager;
class nmDataMeasure;
/**
* @brief 测量工具浮动对话框,显示测量长度,并支持将端点拟合到最近的井。
* @note 长度使用可复制的只读输入框,显示单位与换算由框架单位绑定器管理。
* 切换单位只改变显示,测量数据始终保留米制长度;关闭窗口时通知绘图区结束测量。
* 初始尺寸随字体和主题计算,控件采用推荐高度,窗口纵向拉伸时内容保持紧凑。
* 输入列与单位列沿用储层参数常规字段的 8:5 横向伸展比例。
*/
class NM_SUB_WXS_EXPORT nmWxMeasureDlg : public iDlgBase
{
Q_OBJECT
public:
/** @brief 绑定父级 nmGuiPlot 所属的分析数据;parent 负责管理对话框生命周期。 */
explicit nmWxMeasureDlg(QWidget* parent = nullptr);
signals:
/** @brief 对话框结束时通知所属绘图区移除测量工具和线段。 */
void needDeleteMeasureObj();
public slots:
/** @brief 将测量起点拟合到最近的井,并重新计算米制长度。 */
void onFitStartClicked();
/** @brief 将测量终点拟合到最近的井,并重新计算米制长度。 */
void onFitEndClicked();
/** @brief 从测量模型刷新只读长度,保留用户当前选择的显示单位。 */
void updateDisplay();
/** @brief 响应底部关闭按钮,结束对话框。 */
void onCloseClicked();
/** @brief 开始新一次测量时,恢复两个端点的拟合操作。 */
void resetButtons();
protected:
/** @brief 响应标题栏关闭,通知绘图区清理后交给基类处理关闭事件。 */
void closeEvent(QCloseEvent* event) override;
private:
/** @brief 创建统一的长度字段、端点操作区和底部按钮区。 */
void initUI() override;
/** @brief 共用的端点拟合逻辑;bFitStart 为 true 时处理起点,否则处理终点。 */
void fitToNearestWell(bool bFitStart);
private:
// 借用父级 Map 的分析管理器及测量数据,不负责释放;对象删除后自动置空。
// 拟合始终从同一分析读取井,避免切换分析后将其他分析的井坐标写入本次测量。
QPointer<nmDataAnalyzeManager> m_pDataManager;
QPointer<nmDataMeasure> m_pData;
// 长度及拟合按钮均由 Qt 父子对象机制释放,不使用旧的业务单位控件。
QLineEdit* m_pLengthEdit;
QPushButton* m_pFitStartButton;
QPushButton* m_pFitEndButton;
// 框架单位对是否绑定成功;失败时不显示未经换算的长度。
bool m_bUnitBound;
};
#endif // NMWXMEASUREDLG_H