FirmwarePluginManager.h 1.4 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

/// 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:
Don Gagne's avatar
Don Gagne committed
32 33
    FirmwarePluginManager(QGCApplication* app);
    ~FirmwarePluginManager();
34

35
    QList<MAV_AUTOPILOT> knownFirmwareTypes(void);
36

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

private:
44 45
    FirmwarePlugin*         _genericFirmwarePlugin;
    QList<MAV_AUTOPILOT>    _knownFirmwareTypes;
Don Gagne's avatar
Don Gagne committed
46 47 48
};

#endif