FirmwarePluginManager.h 1.86 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 13 14 15 16 17 18 19 20

/// @file
///     @author Don Gagne <don@thegagnes.com>

#ifndef FirmwarePluginManager_H
#define FirmwarePluginManager_H

#include <QObject>

#include "FirmwarePlugin.h"
#include "QGCMAVLink.h"
21 22 23
#include "QGCToolbox.h"

class QGCApplication;
Don Gagne's avatar
Don Gagne committed
24 25 26
class ArduCopterFirmwarePlugin;
class ArduPlaneFirmwarePlugin;
class ArduRoverFirmwarePlugin;
27
class ArduSubFirmwarePlugin;
Don Gagne's avatar
Don Gagne committed
28
class PX4FirmwarePlugin;
Don Gagne's avatar
Don Gagne committed
29 30 31

/// FirmwarePluginManager is a singleton which is used to return the correct FirmwarePlugin for a MAV_AUTOPILOT type.

32
class FirmwarePluginManager : public QGCTool
Don Gagne's avatar
Don Gagne committed
33 34 35 36
{
    Q_OBJECT

public:
Don Gagne's avatar
Don Gagne committed
37 38
    FirmwarePluginManager(QGCApplication* app);
    ~FirmwarePluginManager();
39

40 41
    QList<MAV_AUTOPILOT> knownFirmwareTypes(void) const;

Don Gagne's avatar
Don Gagne committed
42 43
    /// Returns appropriate plugin for autopilot type.
    ///     @param autopilotType Type of autopilot to return plugin for.
44
    ///     @param vehicleType Vehicle type of autopilot to return plugin for.
Don Gagne's avatar
Don Gagne committed
45
    /// @return Singleton FirmwarePlugin instance for the specified MAV_AUTOPILOT.
46
    FirmwarePlugin* firmwarePluginForAutopilot(MAV_AUTOPILOT autopilotType, MAV_TYPE vehicleType);
Don Gagne's avatar
Don Gagne committed
47

48 49 50
    /// Clears settings from all firmware plugins.
    void clearSettings(void);

Don Gagne's avatar
Don Gagne committed
51 52 53 54
private:
    ArduCopterFirmwarePlugin*   _arduCopterFirmwarePlugin;
    ArduPlaneFirmwarePlugin*    _arduPlaneFirmwarePlugin;
    ArduRoverFirmwarePlugin*    _arduRoverFirmwarePlugin;
55
    ArduSubFirmwarePlugin*    _arduSubFirmwarePlugin;
56
    FirmwarePlugin*             _genericFirmwarePlugin;
Don Gagne's avatar
Don Gagne committed
57
    PX4FirmwarePlugin*          _px4FirmwarePlugin;
Don Gagne's avatar
Don Gagne committed
58 59 60
};

#endif