FirmwarePluginManager.h 1.72 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 27
class ArduCopterFirmwarePlugin;
class ArduPlaneFirmwarePlugin;
class ArduRoverFirmwarePlugin;
class PX4FirmwarePlugin;
Don Gagne's avatar
Don Gagne committed
28 29 30

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

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

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

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

45 46 47
    /// Clears settings from all firmware plugins.
    void clearSettings(void);

Don Gagne's avatar
Don Gagne committed
48 49 50 51
private:
    ArduCopterFirmwarePlugin*   _arduCopterFirmwarePlugin;
    ArduPlaneFirmwarePlugin*    _arduPlaneFirmwarePlugin;
    ArduRoverFirmwarePlugin*    _arduRoverFirmwarePlugin;
52
    FirmwarePlugin*             _genericFirmwarePlugin;
Don Gagne's avatar
Don Gagne committed
53
    PX4FirmwarePlugin*          _px4FirmwarePlugin;
Don Gagne's avatar
Don Gagne committed
54 55 56
};

#endif