uncrustification
[librepilot.git] / ground / openpilotgcs / src / plugins / setupwizard / vehicleconfigurationsource.h
blob1f4ecd027435b461914a33d4034b0f878c98a661
1 /**
2 ******************************************************************************
4 * @file vehicleconfigurationsource.h
5 * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012.
6 * @addtogroup
7 * @{
8 * @addtogroup VehicleConfigurationSource
9 * @{
10 * @brief
11 *****************************************************************************/
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.
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.
23 * You should have received a copy of the GNU General Public License along
24 * with this program; if not, write to the Free Software Foundation, Inc.,
25 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28 #ifndef VEHICLECONFIGURATIONSOURCE_H
29 #define VEHICLECONFIGURATIONSOURCE_H
31 #include <QString>
32 #include <QJsonObject>
33 #include "actuatorsettings.h"
35 struct accelGyroBias {
36 float m_accelerometerXBias;
37 float m_accelerometerYBias;
38 float m_accelerometerZBias;
40 float m_gyroXBias;
41 float m_gyroYBias;
42 float m_gyroZBias;
45 struct actuatorChannelSettings {
46 quint16 channelMin;
47 quint16 channelNeutral;
48 quint16 channelMax;
50 // Default values
51 actuatorChannelSettings() : channelMin(1000), channelNeutral(1000), channelMax(1900) {}
55 class VehicleConfigurationSource {
56 public:
57 VehicleConfigurationSource();
59 enum CONTROLLER_TYPE { CONTROLLER_UNKNOWN, CONTROLLER_CC, CONTROLLER_CC3D, CONTROLLER_REVO, CONTROLLER_NANO, CONTROLLER_OPLINK, CONTROLLER_DISCOVERYF4 };
60 enum VEHICLE_TYPE { VEHICLE_UNKNOWN, VEHICLE_MULTI, VEHICLE_FIXEDWING, VEHICLE_HELI, VEHICLE_SURFACE };
61 enum VEHICLE_SUB_TYPE { MULTI_ROTOR_UNKNOWN, MULTI_ROTOR_TRI_Y, MULTI_ROTOR_QUAD_X, MULTI_ROTOR_QUAD_PLUS, MULTI_ROTOR_QUAD_H,
62 MULTI_ROTOR_HEXA, MULTI_ROTOR_HEXA_H, MULTI_ROTOR_HEXA_X, MULTI_ROTOR_HEXA_COAX_Y, MULTI_ROTOR_OCTO,
63 MULTI_ROTOR_OCTO_X, MULTI_ROTOR_OCTO_V, MULTI_ROTOR_OCTO_COAX_X, MULTI_ROTOR_OCTO_COAX_PLUS,
64 FIXED_WING_DUAL_AILERON, FIXED_WING_AILERON, FIXED_WING_ELEVON, FIXED_WING_VTAIL, HELI_CCPM };
65 enum ESC_TYPE { ESC_RAPID, ESC_STANDARD, ESC_UNKNOWN };
66 enum SERVO_TYPE { SERVO_ANALOG, SERVO_DIGITAL, SERVO_UNKNOWN };
67 enum INPUT_TYPE { INPUT_PWM, INPUT_PPM, INPUT_SBUS, INPUT_DSMX10, INPUT_DSMX11, INPUT_DSM2, INPUT_UNKNOWN };
68 enum AIRSPEED_TYPE { AIRSPEED_ESTIMATE, AIRSPEED_EAGLETREE, AIRSPEED_MS4525, AIRSPEED_DISABLED };
69 enum GPS_TYPE { GPS_PLATINUM, GPS_UBX, GPS_NMEA, GPS_DISABLED };
70 enum RADIO_SETTING { RADIO_TELEMETRY, RADIO_DISABLED };
72 virtual VehicleConfigurationSource::CONTROLLER_TYPE getControllerType() const = 0;
73 virtual VehicleConfigurationSource::VEHICLE_TYPE getVehicleType() const = 0;
74 virtual VehicleConfigurationSource::VEHICLE_SUB_TYPE getVehicleSubType() const = 0;
75 virtual VehicleConfigurationSource::INPUT_TYPE getInputType() const = 0;
76 virtual VehicleConfigurationSource::ESC_TYPE getEscType() const = 0;
77 virtual VehicleConfigurationSource::SERVO_TYPE getServoType() const = 0;
78 virtual VehicleConfigurationSource::AIRSPEED_TYPE getAirspeedType() const = 0;
79 virtual VehicleConfigurationSource::GPS_TYPE getGpsType() const = 0;
80 virtual VehicleConfigurationSource::RADIO_SETTING getRadioSetting() const = 0;
81 virtual QJsonObject *getVehicleTemplate() const = 0;
83 virtual bool isCalibrationPerformed() const = 0;
84 virtual accelGyroBias getCalibrationBias() const = 0;
86 virtual bool isMotorCalibrationPerformed() const = 0;
87 virtual QList<actuatorChannelSettings> getActuatorSettings() const = 0;
89 virtual bool isRestartNeeded() const = 0;
91 virtual QString getSummaryText() = 0;
94 #endif // VEHICLECONFIGURATIONSOURCE_H