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.
133 lines
4.1 KiB
C++
133 lines
4.1 KiB
C++
#ifndef NMWXPROPERTYINTERPOLATIONDLG_H
|
|
#define NMWXPROPERTYINTERPOLATIONDLG_H
|
|
|
|
#include "iDlgBase.h"
|
|
#include "nmDataAnalyzeManager.h"
|
|
#include "nmSubWxs_global.h"
|
|
|
|
#include <QPointer>
|
|
#include <QStringList>
|
|
#include <QVector>
|
|
|
|
class QCheckBox;
|
|
class QComboBox;
|
|
class QDoubleSpinBox;
|
|
class QEvent;
|
|
class QLineEdit;
|
|
class QPointF;
|
|
class QPushButton;
|
|
class QTableWidget;
|
|
class QTableWidgetItem;
|
|
class QTimer;
|
|
class nmGuiPlot;
|
|
class nmObjPoint;
|
|
class nmWxPropertyInterpolationPreviewDlg;
|
|
|
|
class NM_SUB_WXS_EXPORT nmWxPropertyInterpolationDlg : public iDlgBase
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit nmWxPropertyInterpolationDlg(nmGuiPlot* plot,
|
|
nmDataAnalyzeManager* dataManager,
|
|
QWidget* parent = 0);
|
|
~nmWxPropertyInterpolationDlg();
|
|
|
|
protected:
|
|
bool eventFilter(QObject* watched, QEvent* event);
|
|
|
|
private slots:
|
|
void onDataSetChanged(int index);
|
|
void onAddDataSet();
|
|
void onDeleteDataSet();
|
|
void onDataSetNameChanged(const QString& name);
|
|
void onCurrentDataSetEdited();
|
|
void onMapPickToggled(bool checked);
|
|
void onMapClicked(const QPointF& position);
|
|
void onPointSelectionChanged();
|
|
void onPointItemChanged(QTableWidgetItem* item);
|
|
void onDeleteSelectedPoint();
|
|
void onClearPoints();
|
|
void onShowPointsToggled(bool checked);
|
|
void onShowLabelsToggled(bool checked);
|
|
void onPreview();
|
|
void refreshPreview();
|
|
|
|
private:
|
|
// 初始化界面及持久化数据组.
|
|
void initInterpolationUI();
|
|
void initializeDataSets();
|
|
nmPropertyInterpolationDataSet createDefaultDataSet();
|
|
QString nextDataSetName();
|
|
void loadDataSet(int index);
|
|
void clearCurrentDataSet();
|
|
void saveCurrentDataSet();
|
|
void syncDataSetsToManager(bool markModified);
|
|
void updateDataSetButtons();
|
|
|
|
// 管理测点表格和地图上的临时标记.
|
|
void appendPoint(const QPointF& valuePoint);
|
|
void appendPointRow(const nmPropertyInterpolationPointData& point,
|
|
const QString& markerName);
|
|
QString createMarker(const QPointF& valuePosition,
|
|
double value,
|
|
bool showPoints,
|
|
bool showLabels);
|
|
void createMarkersForAllDataSets();
|
|
void removeDataSetMarkers(int dataSetIndex);
|
|
void removeAllMarkers();
|
|
QString markerNameAt(int row) const;
|
|
nmObjPoint* markerByName(const QString& markerName) const;
|
|
nmObjPoint* markerAt(int row) const;
|
|
void removeMarkerByName(const QString& markerName);
|
|
void clearTableSelection();
|
|
void updatePointButtons();
|
|
void updateCurrentMarkerVisibility();
|
|
void schedulePreviewRefresh();
|
|
void updatePreviewWindow(bool activateWindow);
|
|
void showPreviewError(const QString& message, bool activateWindow);
|
|
|
|
private:
|
|
QPointer<nmGuiPlot> m_pPlot;
|
|
QPointer<nmDataAnalyzeManager> m_pDataManager;
|
|
|
|
// 多组插值数据.
|
|
QComboBox* m_pDataSetCombo;
|
|
QPushButton* m_pAddDataSetButton;
|
|
QPushButton* m_pDeleteDataSetButton;
|
|
QVector<nmPropertyInterpolationDataSet> m_vecDataSets;
|
|
// 与数据组、测点下标一一对应,仅保存地图临时标记的对象名称.
|
|
QVector<QStringList> m_vecMarkerNames;
|
|
int m_nCurrentDataSetIndex;
|
|
int m_nNextPointId;
|
|
// 加载界面数据时阻止控件信号反向修改当前数据组.
|
|
bool m_bUpdatingUi;
|
|
|
|
// 当前数据组的属性及名称.
|
|
QComboBox* m_pPropertyCombo;
|
|
QLineEdit* m_pNameEdit;
|
|
|
|
// 测点数据录入.
|
|
QDoubleSpinBox* m_pNewValueSpin;
|
|
QPushButton* m_pMapPickButton;
|
|
QTableWidget* m_pPointTable;
|
|
QPushButton* m_pDeletePointButton;
|
|
QPushButton* m_pClearPointsButton;
|
|
QCheckBox* m_pShowPointsCheck;
|
|
QCheckBox* m_pShowLabelsCheck;
|
|
|
|
// Kriging插值参数.
|
|
QDoubleSpinBox* m_pNuggetSpin;
|
|
QDoubleSpinBox* m_pSillSpin;
|
|
QDoubleSpinBox* m_pRangeSpin;
|
|
QComboBox* m_pModelCombo;
|
|
|
|
// 结果预览及应用.
|
|
QPushButton* m_pPreviewButton;
|
|
QPushButton* m_pApplyButton;
|
|
QPointer<nmWxPropertyInterpolationPreviewDlg> m_pPreviewDialog;
|
|
QTimer* m_pPreviewRefreshTimer;
|
|
};
|
|
|
|
#endif // NMWXPROPERTYINTERPOLATIONDLG_H
|