APMAutoPilotPlugin.h 2.69 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 APMCameraComponent;
26
class ESP8266Component;
Don Gagne's avatar
Don Gagne committed
27

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

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

    // Overrides from AutoPilotPlugin
38
    const QVariantList& vehicleComponents(void) final;
39

Tomaz Canabrava's avatar
Tomaz Canabrava committed
40 41 42 43 44 45 46 47
    APMAirframeComponent*       airframeComponent   (void) const { return _airframeComponent; }
    APMCameraComponent*         cameraComponent     (void) const { return _cameraComponent; }
    APMFlightModesComponent*    flightModesComponent(void) const { return _flightModesComponent; }
    APMPowerComponent*          powerComponent      (void) const { return _powerComponent; }
    APMRadioComponent*          radioComponent      (void) const { return _radioComponent; }
    APMSafetyComponent*         safetyComponent     (void) const { return _safetyComponent; }
    APMSensorsComponent*        sensorsComponent    (void) const { return _sensorsComponent; }
    APMTuningComponent*         tuningComponent     (void) const { return _tuningComponent; }
48
    ESP8266Component*           esp8266Component    (void) const { return _esp8266Component; }
Don Gagne's avatar
Don Gagne committed
49

50 51 52 53 54
public slots:
    // FIXME: This is public until we restructure AutoPilotPlugin/FirmwarePlugin/Vehicle
    void _parametersReadyPreChecks(bool missingParameters);

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

    APMAirframeComponent*       _airframeComponent;
Don Gagne's avatar
Don Gagne committed
59
    APMCameraComponent*         _cameraComponent;
Don Gagne's avatar
Don Gagne committed
60
    APMFlightModesComponent*    _flightModesComponent;
Don Gagne's avatar
Don Gagne committed
61
    APMPowerComponent*          _powerComponent;
Don Gagne's avatar
Don Gagne committed
62
    APMRadioComponent*          _radioComponent;
Don Gagne's avatar
Don Gagne committed
63
    APMSafetyComponent*         _safetyComponent;
Don Gagne's avatar
Don Gagne committed
64
    APMSensorsComponent*        _sensorsComponent;
Don Gagne's avatar
Don Gagne committed
65
    APMTuningComponent*         _tuningComponent;
Don Gagne's avatar
Don Gagne committed
66
    APMAirframeLoader*          _airframeFacts;
67
    ESP8266Component*           _esp8266Component;
Don Gagne's avatar
Don Gagne committed
68 69
};

70
#endif