-
Notifications
You must be signed in to change notification settings - Fork 0
/
CopterCtrl.hpp
55 lines (45 loc) · 1.11 KB
/
CopterCtrl.hpp
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
#ifndef COPTERCTRL_HPP
#define COPTERCTRL_HPP
#include <QTcpServer>
#include <QPointer>
#include <QSocketNotifier>
#include <QSettings>
#include <QVector3D>
#include "CopterMotor.hpp"
#if QT_VERSION >= 0x050000
#include <QApplication>
#else
#include <QtGui/QApplication>
#endif
QT_FORWARD_DECLARE_CLASS(Accelerometer)
class CopterCtrl : public QObject
{
Q_OBJECT
public:
CopterCtrl();
QSettings* getSettings() { return m_settings; }
public slots:
void tcpLog(const QString& message);
void emergencyStop();
protected slots:
void onConnection();
void onDisconnected();
void onNetworkRead();
void onAndroidConnection();
void onAndroidDisconnected();
void onAndroidNetworkRead();
void initMotors(const QString& motorControlPath);
void initSettings();
signals:
void settingsValueChanged(QString key, QVariant value);
protected:
CopterMotor* m_powerMotor;
CopterMotor* m_angleMotor;
CopterMotor* m_cameraMotor;
QSettings* m_settings;
QTcpServer m_tcpServer;
QPointer<QTcpSocket> m_tcpConnection;
QTcpServer m_androidServer;
QPointer<QTcpSocket> m_androidConnection;
};
#endif // COPTERCTRL_HPP