-
Notifications
You must be signed in to change notification settings - Fork 2
/
mainwindow.h
66 lines (48 loc) · 1.31 KB
/
mainwindow.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
/**
* 主界面,显示已连接的roberts及其对应的status。
**/
//#define M_PI (3.14159265358979323846)
#include <QMainWindow>
#include<QTimer>
#include <QElapsedTimer>
#include <QGridLayout>
#include "TCP/CommunicationServer.h"
#include "RobertWidget.h"
#include "StatusWidget.h"
#include <common/mavlink.h>
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
static MainWindow* _create();
~MainWindow();
MainWindow* instance(void);
void closeEvent(QCloseEvent* event);
signals:
/// 在_robertSelected()槽里发送控制消息
void sendMessage(int robertId,mavlink_message_t message);
private slots:
void _robertSelected();
public slots:
void _linkConnected(int robertId);
void _linkDisconnected(int robertId);
void _receiveBytes(int robertId, mavlink_message_t message);
protected:
private:
CommunicationServer* _tcpServer;
/// 当前选中的robert
RobertWidget* _currentRobert;
Ui::MainWindow *ui;
QGridLayout* layout;
/// _nullWgt的Id默认为0
StatusWidget* _nullWgt;
/// key: RobertWidget, value: StatusWidget
QMap<RobertWidget*,StatusWidget*> _mapRobert2Status;
};
#endif // MAINWINDOW_H