|
|
|
|
#ifndef NMWXPERFORATIONCLOSING_H
|
|
|
|
|
#define NMWXPERFORATIONCLOSING_H
|
|
|
|
|
|
|
|
|
|
#include <limits>
|
|
|
|
|
#include "iDlgBase.h"
|
|
|
|
|
#include <QPushButton>
|
|
|
|
|
#include <QCheckBox>
|
|
|
|
|
#include <QComboBox>
|
|
|
|
|
#include <QTreeWidget>
|
|
|
|
|
#include <QLabel>
|
|
|
|
|
#include <QDateTime>
|
|
|
|
|
|
|
|
|
|
#include "nmDataPerforation.h"
|
|
|
|
|
#include "nmDataWellBase.h"
|
|
|
|
|
|
|
|
|
|
class nmWxPerforationClosing : public iDlgBase
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
nmWxPerforationClosing(nmDataWellBase* pWellData, QWidget *parent = nullptr);
|
|
|
|
|
~nmWxPerforationClosing();
|
|
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
|
void onAddClicked();
|
|
|
|
|
void onRemoveClicked();
|
|
|
|
|
void onShowDatesToggled(bool checked);
|
|
|
|
|
void onTimeUnitChanged(const QString &unit);
|
|
|
|
|
void onAllComboChanged(const QString &text);
|
|
|
|
|
void onOkClicked();
|
|
|
|
|
void onCancelClicked();
|
|
|
|
|
void onItemChanged(QTreeWidgetItem* item, int column);
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
void initUI();
|
|
|
|
|
QString formatNumber(double value);
|
|
|
|
|
void refreshDisplay();
|
|
|
|
|
void processDateEdit(QTreeWidgetItem* item);
|
|
|
|
|
void processValueEdit(QTreeWidgetItem* item);
|
|
|
|
|
|
|
|
|
|
void saveDataToModel(); // 保存界面数据到模型
|
|
|
|
|
void loadDataFromModel(); // 从模型加载数据到界面
|
|
|
|
|
|
|
|
|
|
double convertTime(double value, const QString& fromUnit, const QString& toUnit) const;
|
|
|
|
|
double toSecondsQuantized(double value, const QString& unit) const;
|
|
|
|
|
double fromSeconds(double sec, const QString& unit) const;
|
|
|
|
|
double roundToSecondDouble(double sec) const;
|
|
|
|
|
|
|
|
|
|
void showAllPerforationItems();
|
|
|
|
|
void showSpecificPerforationItem(int perforationIndex);
|
|
|
|
|
int findPerforationIndexByName(const QString& name);
|
|
|
|
|
|
|
|
|
|
// UI控件
|
|
|
|
|
QPushButton* m_pAddBtn;
|
|
|
|
|
QPushButton* m_pRemoveBtn;
|
|
|
|
|
QCheckBox* m_pShowDatesCheckBox;
|
|
|
|
|
QComboBox* m_pTimeUnitComboBox;
|
|
|
|
|
QLabel* m_pTimeUnitLabel;
|
|
|
|
|
QTreeWidget* m_pTreeWidget;
|
|
|
|
|
QComboBox* m_pAllComboBox;
|
|
|
|
|
QPushButton* m_pOkBtn;
|
|
|
|
|
QPushButton* m_pCancelBtn;
|
|
|
|
|
|
|
|
|
|
// 数据成员
|
|
|
|
|
QTreeWidgetItem* m_pPerforationRoot;
|
|
|
|
|
QTreeWidgetItem* m_pCurrentPerforationItem;
|
|
|
|
|
int m_perforationCounter;
|
|
|
|
|
int m_timeEntryCounter;
|
|
|
|
|
QString m_currentTimeUnit;
|
|
|
|
|
QList<double> m_baseTimeValues;
|
|
|
|
|
QDateTime m_baseTime;
|
|
|
|
|
bool m_showDatesMode;
|
|
|
|
|
bool m_hasBaseTime;
|
|
|
|
|
|
|
|
|
|
nmDataPerforation m_perforationData;
|
|
|
|
|
nmDataWellBase* m_currentWell;
|
|
|
|
|
int m_currentPerforationIndex;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif // NMWXPERFORATIONCLOSING_H
|