Files
gcs-nf/App/Setting/Index0/Global/GlobalSetting.h
T

171 lines
4.4 KiB
C++
Raw Normal View History

2022-09-09 15:55:16 +08:00
#ifndef GLOBALSETTING_H
2020-11-21 18:19:28 +08:00
#define GLOBALSETTING_H
#include <QWidget>
#include "QDebug"
#include "Config/Config.h"
2022-09-15 09:07:38 +08:00
#include "../../bin/include/rectlatlng.h"
#include <QHostAddress>
#include <QNetworkProxy>
2020-11-21 18:19:28 +08:00
namespace Ui {
class GlobalSetting;
}
class GlobalSetting : public QWidget
{
Q_OBJECT
2021-06-27 18:25:22 +08:00
typedef struct
{
QVariant d0;
QVariant kd;
QVariant len;
}_servo;
2020-11-21 18:19:28 +08:00
public:
explicit GlobalSetting(QWidget *parent = nullptr);
~GlobalSetting();
void getGCSID(void);
2020-12-08 22:21:52 +08:00
void getServo(void);
2020-12-10 18:47:49 +08:00
void getHeartBeat(void);
2021-06-27 18:25:22 +08:00
void getTTS(void);
2022-02-13 14:06:45 +08:00
void getExportInfo(void);
2022-02-10 23:02:29 +08:00
void getVirtualMargin(void);
void setVirtualMargin(void);
2022-09-15 09:07:38 +08:00
/**
* @brief 设置所有支持的地图源
* @param sources 地图源列表
*/
void setMapSource(QStringList const &sources);
/**
* @brief 设置默认的地图源
* @param mapName
*/
void setDefaultMapSource(QString const &mapName);
2022-02-10 23:02:29 +08:00
2022-02-13 14:06:45 +08:00
2022-02-25 15:51:18 +08:00
QMap<int, Config::_latlng> red;
QMap<int, Config::_latlng> orange;
QMap<int, Config::_latlng> drop1;
QMap<int, Config::_latlng> drop2;
2022-02-10 23:02:29 +08:00
2022-09-15 09:07:38 +08:00
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);
2022-02-10 23:02:29 +08:00
2020-11-21 18:19:28 +08:00
private slots:
2022-09-15 09:07:38 +08:00
2020-11-21 18:19:28 +08:00
void on_pushButton_setGCSID_clicked();
2020-12-08 22:21:52 +08:00
void on_pushButton_getServoOffset_clicked();
void on_pushButton_setServoOffset_clicked();
2020-12-10 18:47:49 +08:00
void on_pushButton_getHeartBeat_clicked();
void on_pushButton_setHeartBeat_clicked();
void on_pushButton_Beep_clicked();
2021-05-13 09:17:59 +08:00
void on_pushButton_TTS_clicked();
2022-02-10 23:02:29 +08:00
void on_pushButton_readVirtualMargin_clicked();
void on_pushButton_saveVirtualMargin_clicked();
2022-02-13 14:06:45 +08:00
void on_pushButton_InfoExport_clicked();
2022-09-15 09:07:38 +08:00
/**
* @brief 当用户需要更换地图源的时候,发出信号
* @param index是QComboBox当前项索引
*/
2022-09-09 15:55:16 +08:00
void on_comboMapSource_currentIndexChanged(int index);
2022-09-15 09:07:38 +08:00
/**
* @brief 发出转到base界面的信号,让用户框选范围
*/
2022-09-09 15:55:16 +08:00
void on_btnRectRange_clicked();
2022-09-15 09:07:38 +08:00
/**
* @brief 发出缓存地图的信号
*/
void on_pushButton_clicked();
/**
* @brief 登录代理
*/
void on_btnLogin_clicked();
2022-09-09 15:55:16 +08:00
2020-11-21 18:19:28 +08:00
signals:
2022-09-15 09:07:38 +08:00
/**
* @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();
2020-12-08 22:21:52 +08:00
void showMessage(const QString &message,int TimeOut = 0);
2020-11-21 18:19:28 +08:00
void setGCSID(int id);
2021-06-27 18:25:22 +08:00
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);
2020-12-08 22:21:52 +08:00
2020-12-10 18:47:49 +08:00
void setHeartBeat(QVariant state,QVariant frq);
void setBeep(QVariant beep);
2020-11-21 18:19:28 +08:00
2021-05-13 09:17:59 +08:00
void setTTS(QVariant flag);
2022-02-25 15:51:18 +08:00
void setMargin(int type,QMap<int,Config::_latlng> latlng,QColor color);
2022-02-11 14:10:16 +08:00
2022-02-25 15:51:18 +08:00
void setExportInfo(QVariant value,QVariant id);
2022-02-13 14:06:45 +08:00
2022-09-15 09:07:38 +08:00
/**
* @brief 更换地图源的信号
* @param value是地图源类型
*/
void setMapTypes(QVariant value);
2022-09-09 15:55:16 +08:00
2020-11-21 18:19:28 +08:00
private:
Ui::GlobalSetting *ui;
};
#endif // GLOBALSETTING_H