dRonin  adbada4
dRonin GCS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
gcscontrolgadgetwidget.h
Go to the documentation of this file.
1 
12 /*
13  * This program is free software; you can redistribute it and/or modify
14  * it under the terms of the GNU General Public License as published by
15  * the Free Software Foundation; either version 3 of the License, or
16  * (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful, but
19  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
20  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  * for more details.
22  *
23  * You should have received a copy of the GNU General Public License along
24  * with this program; if not, see <http://www.gnu.org/licenses/>
25  */
26 
27 #ifndef GCSControlGADGETWIDGET_H_
28 #define GCSControlGADGETWIDGET_H_
29 
30 #include "manualcontrolsettings.h"
31 #include "manualcontrolcommand.h"
32 #include <QMap>
33 #include <QLabel>
34 
35 class Ui_GCSControl;
36 
37 class GCSControlGadgetWidget : public QLabel
38 {
39  Q_OBJECT
40 
41 public:
42  GCSControlGadgetWidget(QWidget *parent = nullptr);
43 
44  void allowGcsControl(bool allow);
45  void setGCSControl(bool newState);
46  bool getGCSControl(void);
47 
48 signals:
50  void sticksChanged(double leftX, double leftY, double rightX, double rightY,
51  double arming);
52  void controlEnabled(bool);
53  void flightModeChangedLocally(ManualControlSettings::FlightModePositionOptions);
54 public slots:
56  void updateSticks(double leftX, double leftY, double rightX, double rightY);
57 
58  // signals from children widgets indicating a local change
59  void leftStickClicked(double X, double Y);
60  void rightStickClicked(double X, double Y);
61 
62 protected slots:
63  void toggleControl(bool checked);
64  void toggleArming(bool checked);
65  void selectFlightMode(int state);
66  void flightModeChanged(quint8 mode);
67  void armedChanged(quint8 armed);
68 
69 private:
70  Ui_GCSControl *m_gcscontrol;
71  double leftX, leftY, rightX, rightY, arming;
72  QMap<QString, ManualControlSettings::FlightModePositionOptions> flightModesMap;
73 };
74 
75 #endif /* GCSControlGADGETWIDGET_H_ */
void setGCSControl(bool newState)
void updateSticks(double leftX, double leftY, double rightX, double rightY)
Signals from parent gadget indicating change from the remote system.
void allowGcsControl(bool allow)
Allow the GCS to take over control of UAV.
GCSControlGadgetWidget(QWidget *parent=nullptr)
void leftStickClicked(double X, double Y)
void sticksChanged(double leftX, double leftY, double rightX, double rightY, double arming)
Emitted whenever the UI is clicked on to indicate the new stick positions.
void rightStickClicked(double X, double Y)
void toggleControl(bool checked)
Called when the gcs control is toggled.
void flightModeChangedLocally(ManualControlSettings::FlightModePositionOptions)
void toggleArming(bool checked)
Called when the gcs control is toggled.
void selectFlightMode(int state)
Called when the flight mode drop down is changed and sets the ManualControlCommand->FlightMode accord...