dRonin  adbada4
dRonin GCS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
configmultirotorwidget.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 #ifndef CONFIGMULTIROTORWIDGET_H
27 #define CONFIGMULTIROTORWIDGET_H
28 
29 #include "ui_airframe.h"
32 
35 #include "uavobjects/uavobject.h"
37 #include <QWidget>
38 #include <QList>
39 #include <QItemDelegate>
40 
41 class Ui_Widget;
42 
44 {
45  Q_OBJECT
46 
47 public:
48  ConfigMultiRotorWidget(Ui_AircraftWidget *aircraft = nullptr, QWidget *parent = nullptr);
50 
52 
53 private:
54  Ui_AircraftWidget *m_aircraft;
55 
56  QWidget *uiowner;
57  QGraphicsSvgItem *quad;
58 
59  bool setupQuad(bool pLayout);
60  bool setupHexa(bool pLayout);
61  bool setupOcto();
62  bool setupMultiRotorMixer(double mixerFactors[8][3]);
63  void setupMotors(QList<QString> motorList, SystemSettings::AirframeTypeOptions vehicle);
64  void setupQuadMotor(int channel, double roll, double pitch, double yaw);
65 
66  float invertMotors;
67 
68  virtual void ResetActuators(GUIConfigDataUnion *configData);
69  static QStringList getChannelDescriptions();
70  static const QString CHANNELBOXNAME;
71  static const QString CHANNELLABELNAME;
72  void setYawMixLevel(int);
73 
74  void drawAirframe(SystemSettings::AirframeTypeOptions multiRotorType);
75 
76 private slots:
77  virtual void setupUI(SystemSettings::AirframeTypeOptions airframeType);
78  void refreshAirframeWidgetsValues(SystemSettings::AirframeTypeOptions frameType);
79  virtual SystemSettings::AirframeTypeOptions updateConfigObjectsFromWidgets();
80  virtual bool throwConfigError(int numMotors);
81 
82 protected:
83 signals:
84  void configurationChanged();
85 };
86 
87 #endif // CONFIGMULTIROTORWIDGET_H
ConfigMultiRotorWidget(Ui_AircraftWidget *aircraft=nullptr, QWidget *parent=nullptr)
static QStringList getChannelDescriptions()