171 lines
4.4 KiB
C++
171 lines
4.4 KiB
C++
#ifndef GLOBALSETTING_H
|
|
#define GLOBALSETTING_H
|
|
|
|
#include <QWidget>
|
|
#include "QDebug"
|
|
#include "Config/Config.h"
|
|
#include "../../bin/include/rectlatlng.h"
|
|
#include <QHostAddress>
|
|
#include <QNetworkProxy>
|
|
|
|
|
|
namespace Ui {
|
|
class GlobalSetting;
|
|
}
|
|
|
|
class GlobalSetting : public QWidget
|
|
{
|
|
Q_OBJECT
|
|
|
|
typedef struct
|
|
{
|
|
QVariant d0;
|
|
QVariant kd;
|
|
QVariant len;
|
|
}_servo;
|
|
|
|
public:
|
|
explicit GlobalSetting(QWidget *parent = nullptr);
|
|
~GlobalSetting();
|
|
|
|
|
|
void getGCSID(void);
|
|
void getServo(void);
|
|
void getHeartBeat(void);
|
|
void getTTS(void);
|
|
void getExportInfo(void);
|
|
void getVirtualMargin(void);
|
|
void setVirtualMargin(void);
|
|
/**
|
|
* @brief 设置所有支持的地图源
|
|
* @param sources 地图源列表
|
|
*/
|
|
void setMapSource(QStringList const &sources);
|
|
/**
|
|
* @brief 设置默认的地图源
|
|
* @param mapName
|
|
*/
|
|
void setDefaultMapSource(QString const &mapName);
|
|
|
|
|
|
|
|
QMap<int, Config::_latlng> red;
|
|
QMap<int, Config::_latlng> orange;
|
|
QMap<int, Config::_latlng> drop1;
|
|
QMap<int, Config::_latlng> drop2;
|
|
|
|
public slots:
|
|
/**
|
|
* @brief 设置需要缓存的经纬度范围
|
|
* @param lng1 左上角经度
|
|
* @param lat1 左上角纬度
|
|
* @param lng2 右下角经度
|
|
* @param lat2 右下角纬度
|
|
*/
|
|
void setLngLatRectRange(double lng1, double lat1, double lng2, double lat2);
|
|
/**
|
|
* @brief 设置当前缓存地图级别进度条的值
|
|
* @param value 当前进度条的值
|
|
*/
|
|
void setProgressBarValue(int value);
|
|
/**
|
|
* @brief 更改当前正在缓存的地图级别
|
|
* @param zoom 当前正在缓存的地图级别
|
|
*/
|
|
void setMapSaveGrade(int zoom);
|
|
|
|
|
|
private slots:
|
|
|
|
void on_pushButton_setGCSID_clicked();
|
|
|
|
void on_pushButton_getServoOffset_clicked();
|
|
|
|
void on_pushButton_setServoOffset_clicked();
|
|
|
|
void on_pushButton_getHeartBeat_clicked();
|
|
|
|
void on_pushButton_setHeartBeat_clicked();
|
|
|
|
void on_pushButton_Beep_clicked();
|
|
|
|
void on_pushButton_TTS_clicked();
|
|
|
|
void on_pushButton_readVirtualMargin_clicked();
|
|
|
|
void on_pushButton_saveVirtualMargin_clicked();
|
|
|
|
void on_pushButton_InfoExport_clicked();
|
|
|
|
/**
|
|
* @brief 当用户需要更换地图源的时候,发出信号
|
|
* @param index是QComboBox当前项索引
|
|
*/
|
|
void on_comboMapSource_currentIndexChanged(int index);
|
|
/**
|
|
* @brief 发出转到base界面的信号,让用户框选范围
|
|
*/
|
|
void on_btnRectRange_clicked();
|
|
/**
|
|
* @brief 发出缓存地图的信号
|
|
*/
|
|
void on_pushButton_clicked();
|
|
/**
|
|
* @brief 登录代理
|
|
*/
|
|
void on_btnLogin_clicked();
|
|
|
|
signals:
|
|
/**
|
|
* @brief 切换代理的信号
|
|
* @param type 代理类型
|
|
* @param addr 地址
|
|
* @param port 端口
|
|
*/
|
|
void switchProxy(QNetworkProxy::ProxyType type, QHostAddress const &addr, int port);
|
|
/**
|
|
* @brief 保存地图的信号
|
|
* @param area是地图缓存的范围
|
|
* @param grades是一些缓存地图级别
|
|
*/
|
|
void mapSave(internals::RectLatLng const &area, QList<int> const &grades);
|
|
/**
|
|
* @brief 转到Base界面的信号
|
|
*/
|
|
void goToBase();
|
|
void showMessage(const QString &message,int TimeOut = 0);
|
|
|
|
void setGCSID(int id);
|
|
|
|
void setServo(QVariant ch1_d0,QVariant ch1_kd,QVariant ch1_len,
|
|
QVariant ch2_d0,QVariant ch2_kd,QVariant ch2_len,
|
|
QVariant ch3_d0,QVariant ch3_kd,QVariant ch3_len,
|
|
QVariant ch4_d0,QVariant ch4_kd,QVariant ch4_len,
|
|
QVariant ch5_d0,QVariant ch5_kd,QVariant ch5_len,
|
|
QVariant ch6_d0,QVariant ch6_kd,QVariant ch6_len,
|
|
QVariant ch7_d0,QVariant ch7_kd,QVariant ch7_len,
|
|
QVariant ch8_d0,QVariant ch8_kd,QVariant ch8_len);
|
|
|
|
|
|
void setHeartBeat(QVariant state,QVariant frq);
|
|
|
|
void setBeep(QVariant beep);
|
|
|
|
void setTTS(QVariant flag);
|
|
|
|
void setMargin(int type,QMap<int,Config::_latlng> latlng,QColor color);
|
|
|
|
void setExportInfo(QVariant value,QVariant id);
|
|
|
|
/**
|
|
* @brief 更换地图源的信号
|
|
* @param value是地图源类型
|
|
*/
|
|
void setMapTypes(QVariant value);
|
|
|
|
private:
|
|
Ui::GlobalSetting *ui;
|
|
};
|
|
|
|
#endif // GLOBALSETTING_H
|