178 lines
3.2 KiB
C++
178 lines
3.2 KiB
C++
#ifndef MAINWINDOW_H
|
|
#define MAINWINDOW_H
|
|
|
|
#include <QMainWindow>
|
|
#include "QApplication"
|
|
|
|
|
|
#include "Config/Config.h"
|
|
|
|
#include "Cockpit.h"
|
|
|
|
|
|
#include "mavlinknode.h"
|
|
|
|
#include "QThread"
|
|
|
|
#include "opmapwidget.h"
|
|
#include "Cockpit.h"
|
|
#include "dlink.h"
|
|
#include "skin.h"
|
|
|
|
#include "StatusUI/StatusUI.h"
|
|
#include "InspectUI/InspectUI.h"
|
|
#include "ToolsUI/ToolsUI.h"
|
|
#include "HealthUI/HealthUI.h"
|
|
#include "pureprojection.h"
|
|
|
|
//sub widget
|
|
#include "About/About.h"
|
|
#include "Help/Help.h"
|
|
#include "Setting/Setting.h"
|
|
|
|
#include "QTextToSpeech"
|
|
|
|
|
|
//cmd ui
|
|
#include "QQuickWidget"
|
|
#include "QQuickView"
|
|
|
|
#include "CommandUI/CommandUI.h"
|
|
|
|
|
|
//mission ui
|
|
#include "MissionUI/propertyui.h"
|
|
|
|
//menubar ui
|
|
#include "MenuBarUI/MenuBarUI.h"
|
|
|
|
|
|
|
|
//selfcheck
|
|
#include "CheckUI/CheckUI.h"
|
|
|
|
|
|
QT_BEGIN_MOC_NAMESPACE
|
|
|
|
//#pragma execution_character_set("utf-8")
|
|
|
|
|
|
class MainWindow : public QMainWindow
|
|
{
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
MainWindow(QWidget *parent = nullptr);
|
|
~MainWindow();
|
|
|
|
|
|
|
|
public slots:
|
|
void showMessage(const QString &message,int TimeOut = 0);
|
|
|
|
void setCommunicationLostState(bool flag);
|
|
|
|
void beep(int sysid);
|
|
|
|
|
|
void setServoOffset(QVariant la,QVariant ra,
|
|
QVariant le,QVariant re,
|
|
QVariant ru);
|
|
|
|
protected slots:
|
|
|
|
bool event(QEvent *event);
|
|
|
|
void closeEvent(QCloseEvent *event);
|
|
void resizeEvent(QResizeEvent *event);
|
|
void mousePressEvent(QMouseEvent* event);
|
|
void keyPressEvent(QKeyEvent *event);
|
|
//void mouseMoveEvent();
|
|
|
|
private slots:
|
|
void onTabIndexChanged(const int &index);
|
|
|
|
|
|
void updateUI();
|
|
|
|
void TotalDistance(double value);
|
|
|
|
|
|
void Timer_1s_out(void);
|
|
|
|
|
|
void updateDlink(float rssi,uint64_t bitrate);
|
|
|
|
|
|
void update_servo_output_raw(mavlink_servo_output_raw_t servo);
|
|
|
|
|
|
protected slots:
|
|
|
|
|
|
|
|
protected:
|
|
|
|
int MainIndex = 0;
|
|
|
|
Config *config = nullptr;
|
|
|
|
StatusUI *statusui = nullptr;
|
|
HealthUI *healthui = nullptr;
|
|
MenuBarUI *menuBarUI = nullptr;
|
|
CommandUI *commandUI = nullptr;
|
|
Cockpit *copk = nullptr;
|
|
CheckUI *checkUI = nullptr;
|
|
propertyui *missionUI = nullptr;
|
|
|
|
mapcontrol::OPMapWidget *map = nullptr;
|
|
|
|
DLink *dlink = nullptr;
|
|
|
|
ToolsUI *toolsui = nullptr;
|
|
|
|
Setting *setting = nullptr;
|
|
|
|
|
|
QQuickWidget *quick = nullptr;
|
|
|
|
QTimer *updateTimer = nullptr;
|
|
|
|
QTextToSpeech *tts = nullptr;
|
|
|
|
|
|
bool isCommunicationLost = true;
|
|
|
|
|
|
internals::PointLatLng StartPoint;
|
|
|
|
QTimer *Timer_1s = nullptr;
|
|
|
|
QDateTime *FlightTime = nullptr;
|
|
QDateTime *StartupTime = nullptr;
|
|
|
|
bool isEngineStartUp = false;
|
|
|
|
|
|
float m_la = 0;
|
|
float m_ra = 0;
|
|
float m_le = 0;
|
|
float m_re = 0;
|
|
float m_ru = 0;
|
|
|
|
|
|
QMap<int,uint16_t> servos;
|
|
|
|
QMap<uint16_t,double> table_lail = {{1218,20},{1505,0},{2032,-30}};
|
|
QMap<uint16_t,double> table_rail = {{1145,-30},{1502,0},{1764,20}};
|
|
QMap<uint16_t,double> table_ele = {{1154,25.3},{1499,0},{1845,-25.7}};
|
|
QMap<uint16_t,double> table_tail = {{1353,-5.2},{1459,-3},{1598,0},{1768,2.5},{1936,4}};
|
|
QMap<uint16_t,double> table_rud = {{1277,23},{1499,0},{1728,-27}};
|
|
|
|
|
|
};
|
|
|
|
#endif // MAINWINDOW_H
|