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.
72 lines
2.1 KiB
C
72 lines
2.1 KiB
C
|
3 weeks ago
|
#ifndef NMWXGEOREFDLG_H
|
||
|
|
#define NMWXGEOREFDLG_H
|
||
|
|
|
||
|
|
#include <QDialog>
|
||
|
|
#include <QLineEdit>
|
||
|
|
#include <QComboBox>
|
||
|
|
#include <QPushButton>
|
||
|
|
#include <QMessageBox>
|
||
|
|
|
||
|
|
#include "nmSubWxs_global.h"
|
||
|
|
#include "nmDataGeoRef.h"
|
||
|
|
|
||
|
|
class NM_SUB_WXS_EXPORT nmWxGeoRefDlg : public QDialog
|
||
|
|
{
|
||
|
|
Q_OBJECT
|
||
|
|
|
||
|
|
public:
|
||
|
|
explicit nmWxGeoRefDlg(QWidget* parent = 0);
|
||
|
|
void loadDataToUI(); // 从数据加载到界面
|
||
|
|
void saveDataUI(); // 从界面保存到数据
|
||
|
|
|
||
|
|
// 坐标转换辅助函数
|
||
|
|
void updateFromLatLon(); // 根据经纬度更新UTM坐标
|
||
|
|
void updateFromUTM(); // 根据UTM坐标更新经纬度
|
||
|
|
void latLonToUTM(double lat, double lon, int& zone, char& band, double& easting, double& northing);
|
||
|
|
bool utmToLatLon(int zone, char band, double easting, double northing, double& lat, double& lon);
|
||
|
|
int getUTMZoneFromLongitude(double longitude);
|
||
|
|
char getUTMBandFromLatitude(double latitude);
|
||
|
|
double calculateNorthing(double latitude, double longitude, int zone);
|
||
|
|
void restoreLastValidValues();
|
||
|
|
|
||
|
|
// 输入验证函数
|
||
|
|
bool isValidLatitude(double lat);
|
||
|
|
bool isValidLongitude(double lon);
|
||
|
|
bool isValidEasting(double easting);
|
||
|
|
bool isValidNorthing(double northing);
|
||
|
|
|
||
|
|
private slots:
|
||
|
|
void onUtmZoneChanged(int index);
|
||
|
|
void onLongitudeChanged(); // 经度改变槽函数
|
||
|
|
void onLatitudeChanged(); // 纬度改变槽函数
|
||
|
|
void onEastingChanged(); // 东向坐标改变槽函数
|
||
|
|
void onNorthingChanged(); // 北向坐标改变槽函数
|
||
|
|
void okAccept();
|
||
|
|
void cancelReject();
|
||
|
|
|
||
|
|
private:
|
||
|
|
void initUI();
|
||
|
|
|
||
|
|
QLineEdit* m_pLongitudeEdit;
|
||
|
|
QLineEdit* m_pLatitudeEdit;
|
||
|
|
|
||
|
|
QComboBox* m_pUtmZoneCombo;
|
||
|
|
QLineEdit* m_pEastingEdit;
|
||
|
|
QLineEdit* m_pNorthingEdit;
|
||
|
|
|
||
|
|
QPushButton* m_pOkButton;
|
||
|
|
QPushButton* m_pCancelButton;
|
||
|
|
|
||
|
|
QString m_lastLongitude;
|
||
|
|
QString m_lastLatitude;
|
||
|
|
QString m_lastEasting;
|
||
|
|
QString m_lastNorthing;
|
||
|
|
|
||
|
|
// 防止递归更新的标志
|
||
|
|
bool m_bUpdating;
|
||
|
|
|
||
|
|
nmDataGeoRef m_geoRefData;
|
||
|
|
};
|
||
|
|
|
||
|
|
#endif // NMWXGEOREFDLG_H
|