forked from cyberintruder/DGIPyDrOneQt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dgipydrone.h
154 lines (102 loc) · 3.37 KB
/
dgipydrone.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
#ifndef DGIPYDRONE_H
#define DGIPYDRONE_H
#include "analyzenetwork.h"
#include "remotecontroller.h"
#include "profileeditor.h"
#include "joystickrect.h"
#include "xinputGamepad.h"
#include <QMainWindow>
#include <QtNetwork/QTcpSocket>
#include <QScrollBar>
#include <QtSensors/QAccelerometer>
#include <QtSensors/QGyroscope>
#include <QGraphicsScene>
#include <QGraphicsItem>
#include <QGraphicsView>
#include <QProcess>
#include <QFileDialog>
namespace Ui {
class DGIpydrOne;
}
class DGIpydrOne : public QMainWindow
{
Q_OBJECT
public:
explicit DGIpydrOne(QWidget *parent = 0);
~DGIpydrOne();
private slots:
void on_throttleSlider_valueChanged(int);
void on_buttonConnect_clicked();
void on_buttonCancelConnect_clicked();
void on_buttonSendCommand_clicked();
void statutConnection(QString);
void updateConsole(QString, QString);
void updateConnectionTime(int);
void updateInformationsInterface(QString, int);
void on_buttonSaveProfile_clicked();
void on_checkLED_stateChanged();
void on_leftRightCalibrate_valueChanged(int value);
void on_frontBackCalibrate_valueChanged(int value);
void on_checkCollision_stateChanged();
void on_manualMode_clicked();
void on_automaticMode_clicked();
void on_buttonCalibrateDrone_clicked();
void on_buttonLessCompass_clicked();
void on_buttonMoreCompass_clicked();
void on_buttonStartSession_clicked();
void on_buttonPing_clicked();
void on_buttonStopPing_clicked();
void on_listIp_doubleClicked(const QModelIndex &index);
void on_axisSensibilitySlider_valueChanged(int value);
void on_rotationSensibilitySlider_valueChanged(int value);
void on_maximalPowerSlider_valueChanged(int value);
void on_maximalAngleSlider_valueChanged(int value);
void on_buttonFastConnect_clicked();
void on_profileName_textChanged(const QString &arg1);
void on_buttonLoadProfileFile_clicked();
void on_calibrateMotor1Slider_valueChanged(int value);
void on_calibrateMotor2Slider_valueChanged(int value);
void on_calibrateMotor3Slider_valueChanged(int value);
void on_calibrateMotor4Slider_valueChanged(int value);
void on_buttonResetCalibration_clicked();
private:
Ui::DGIpydrOne *ui;
void drawDroneInformations();
AnalyzeNetwork *network;
bool firstTimeConnection;
int vLeftSonar,
vRightSonar,
vFrontSonar,
vBackSonar,
vUpSonar,
vDownSonar,
vDegrees,
vVerticalSpeed,
vHorizontalSpeed,
vPressure;
QcGaugeWidget *mCompassGauge;
QcNeedleItem *mCompassNeedle, *mCompassNeedle2;
QcGaugeWidget * mAttitudeGauge;
QcNeedleItem * mAttitudeNeedle;
QcAttitudeMeter *mAttMeter;
remoteController *controller;
QGraphicsScene *sceneJoystick;
joystickRect *joystick;
QGraphicsScene *sceneSonar;
QGraphicsItem *leftSonar;
QGraphicsItem *rightSonar;
QGraphicsItem *frontSonar;
QGraphicsItem *backSonar;
QGraphicsItem *upSonar;
QGraphicsItem *downSonar;
XInput input;
QTimer tmr;
bool useJoystick;
bool calibrateJoystick;
bool pressedButtons[12] = {false, false, false, false, false, false, false, false, false, false, false, false};
float calibrateMotor1, calibrateMotor2, calibrateMotor3, calibrateMotor4;
public slots:
void readJoystickState();
void connectedDevices(QString);
};
#endif // DGIPYDRONE_H