FirmwarePluginManager.h 1.7 KB
Newer Older
1 2
/****************************************************************************
 *
Gus Grubba's avatar
Gus Grubba committed
3
 * (c) 2009-2020 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
4 5 6 7 8 9
 *
 * 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

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

27
class FirmwarePluginManager : public QGCTool
Don Gagne's avatar
Don Gagne committed
28 29 30 31
{
    Q_OBJECT

public:
32
    FirmwarePluginManager(QGCApplication* app, QGCToolbox* toolbox);
Don Gagne's avatar
Don Gagne committed
33
    ~FirmwarePluginManager();
34

35 36 37 38 39
    /// Returns list of firmwares which are supported by the system
    QList<MAV_AUTOPILOT> supportedFirmwareTypes(void);

    /// Returns the list of supported vehicle types for the specified firmware
    QList<MAV_TYPE> supportedVehicleTypes(MAV_AUTOPILOT firmwareType);
40

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

private:
48 49
    FirmwarePluginFactory* _findPluginFactory(MAV_AUTOPILOT firmwareType);

50
    FirmwarePlugin*         _genericFirmwarePlugin;
51
    QList<MAV_AUTOPILOT>    _supportedFirmwareTypes;
Don Gagne's avatar
Don Gagne committed
52 53 54
};

#endif