dRonin  adbada4
dRonin GCS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
gcscontrol.h
Go to the documentation of this file.
1 
11 /*
12  * This program is free software; you can redistribute it and/or modify
13  * it under the terms of the GNU General Public License as published by
14  * the Free Software Foundation; either version 3 of the License, or
15  * (at your option) any later version.
16  *
17  * This program is distributed in the hope that it will be useful, but
18  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
19  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
20  * for more details.
21  *
22  * You should have received a copy of the GNU General Public License along
23  * with this program; if not, see <http://www.gnu.org/licenses/>
24  */
25 
26 #ifndef GCSCONTROL_H
27 #define GCSCONTROL_H
28 
30 
31 #include "gcscontrol_global.h"
32 #include "manualcontrolsettings.h"
34 #include "uavtalkreceiver.h"
36 #include "QTimer"
38 
39 class GCSCONTROLSHARED_EXPORT GCSControl : public ExtensionSystem::IPlugin
40 {
41  Q_OBJECT
42  Q_PLUGIN_METADATA(IID "org.dronin.plugins.GCSControlPlugin")
43 public:
44  GCSControl();
45  ~GCSControl();
46  void extensionsInitialized();
47  bool initialize(const QStringList &arguments, QString *errorString);
48  void shutdown();
49 
50 #if defined(USE_SDL)
51  SDLGamepad *sdlGamepad;
52 #endif
53 public slots:
54  bool beginGCSControl();
55  bool endGCSControl();
56  bool setFlightMode(ManualControlSettings::FlightModePositionOptions flightMode);
57  bool setThrottle(float value);
58  bool setRoll(float value);
59  bool setPitch(float value);
60  bool setYaw(float value);
61  bool setArming(float value);
62  bool setChannel(quint8 channel, float value);
63 
64 private:
65  ManualControlSettings *manControlSettingsUAVO;
66  UAVTalkReceiver *m_gcsReceiver;
67  static bool firstInstance;
68  ManualControlSettings::DataFields dataBackup;
69  ManualControlSettings::Metadata metaBackup;
70  bool hasControl;
71  QTimer receiverActivity;
72 
74 
75  quint8 inverseMapping[ManualControlSettings::CHANNELGROUPS_NUMELEM];
76 
77 private slots:
78  void objectsUpdated(UAVObject *);
79  void receiverActivitySlot();
80 };
81 
82 #endif // GCSCONTROL_H
virtual void extensionsInitialized()=0
virtual bool initialize(const QStringList &arguments, QString *errorString)=0
Base class for all plugins.
Definition: iplugin.h:45
virtual void shutdown()
Definition: iplugin.h:55