APMAutoPilotPlugin.h 3.02 KB
Newer Older
1 2 3 4 5 6 7 8 9
/****************************************************************************
 *
 *   (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
 *
 * QGroundControl is licensed according to the terms in the file
 * COPYING.md in the root of the source code directory.
 *
 ****************************************************************************/

Don Gagne's avatar
Don Gagne committed
10

11 12
#ifndef APMAutoPilotPlugin_H
#define APMAutoPilotPlugin_H
Don Gagne's avatar
Don Gagne committed
13

14
#include "AutoPilotPlugin.h"
15
#include "Vehicle.h"
16 17 18 19 20 21 22 23

class APMAirframeComponent;
class APMAirframeLoader;
class APMFlightModesComponent;
class APMRadioComponent;
class APMTuningComponent;
class APMSafetyComponent;
class APMSensorsComponent;
Don Gagne's avatar
Don Gagne committed
24
class APMPowerComponent;
Don Gagne's avatar
Don Gagne committed
25
class MotorComponent;
Don Gagne's avatar
Don Gagne committed
26
class APMCameraComponent;
27
class APMLightsComponent;
28
class ESP8266Component;
Don Gagne's avatar
Don Gagne committed
29

30 31
/// This is the APM specific implementation of the AutoPilot class.
class APMAutoPilotPlugin : public AutoPilotPlugin
Don Gagne's avatar
Don Gagne committed
32 33
{
    Q_OBJECT
34

Don Gagne's avatar
Don Gagne committed
35
public:
36 37 38 39
    APMAutoPilotPlugin(Vehicle* vehicle, QObject* parent);
    ~APMAutoPilotPlugin();

    // Overrides from AutoPilotPlugin
40
    const QVariantList& vehicleComponents(void) final;
41

Tomaz Canabrava's avatar
Tomaz Canabrava committed
42 43
    APMAirframeComponent*       airframeComponent   (void) const { return _airframeComponent; }
    APMCameraComponent*         cameraComponent     (void) const { return _cameraComponent; }
44
    APMLightsComponent*         lightsComponent     (void) const { return _lightsComponent; }
Tomaz Canabrava's avatar
Tomaz Canabrava committed
45 46
    APMFlightModesComponent*    flightModesComponent(void) const { return _flightModesComponent; }
    APMPowerComponent*          powerComponent      (void) const { return _powerComponent; }
Don Gagne's avatar
Don Gagne committed
47 48
#if 0
    // Temporarily removed, waiting for new command implementation
Don Gagne's avatar
Don Gagne committed
49
    MotorComponent*             motorComponent      (void) const { return _motorComponent; }
Don Gagne's avatar
Don Gagne committed
50
#endif
Tomaz Canabrava's avatar
Tomaz Canabrava committed
51 52 53 54
    APMRadioComponent*          radioComponent      (void) const { return _radioComponent; }
    APMSafetyComponent*         safetyComponent     (void) const { return _safetyComponent; }
    APMSensorsComponent*        sensorsComponent    (void) const { return _sensorsComponent; }
    APMTuningComponent*         tuningComponent     (void) const { return _tuningComponent; }
55
    ESP8266Component*           esp8266Component    (void) const { return _esp8266Component; }
Don Gagne's avatar
Don Gagne committed
56

57
private:
58 59
    bool                    _incorrectParameterVersion; ///< true: parameter version incorrect, setup not allowed
    QVariantList            _components;
Don Gagne's avatar
Don Gagne committed
60 61

    APMAirframeComponent*       _airframeComponent;
Don Gagne's avatar
Don Gagne committed
62
    APMCameraComponent*         _cameraComponent;
63
    APMLightsComponent*         _lightsComponent;
Don Gagne's avatar
Don Gagne committed
64
    APMFlightModesComponent*    _flightModesComponent;
Don Gagne's avatar
Don Gagne committed
65
    APMPowerComponent*          _powerComponent;
Don Gagne's avatar
Don Gagne committed
66 67
#if 0
    // Temporarily removed, waiting for new command implementation
Don Gagne's avatar
Don Gagne committed
68
    MotorComponent*             _motorComponent;
Don Gagne's avatar
Don Gagne committed
69
#endif
Don Gagne's avatar
Don Gagne committed
70
    APMRadioComponent*          _radioComponent;
Don Gagne's avatar
Don Gagne committed
71
    APMSafetyComponent*         _safetyComponent;
Don Gagne's avatar
Don Gagne committed
72
    APMSensorsComponent*        _sensorsComponent;
Don Gagne's avatar
Don Gagne committed
73
    APMTuningComponent*         _tuningComponent;
Don Gagne's avatar
Don Gagne committed
74
    APMAirframeLoader*          _airframeFacts;
75
    ESP8266Component*           _esp8266Component;
Don Gagne's avatar
Don Gagne committed
76 77
};

78
#endif