QGCToolbox.h 4.39 KB
Newer Older
1
/*=====================================================================
dogmaphobic's avatar
dogmaphobic committed
2

3
 QGroundControl Open Source Ground Control Station
dogmaphobic's avatar
dogmaphobic committed
4

5
 (c) 2009 - 2015 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
dogmaphobic's avatar
dogmaphobic committed
6

7
 This file is part of the QGROUNDCONTROL project
dogmaphobic's avatar
dogmaphobic committed
8

9 10 11 12
 QGROUNDCONTROL is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation, either version 3 of the License, or
 (at your option) any later version.
dogmaphobic's avatar
dogmaphobic committed
13

14 15 16 17
 QGROUNDCONTROL is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
dogmaphobic's avatar
dogmaphobic committed
18

19 20
 You should have received a copy of the GNU General Public License
 along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
dogmaphobic's avatar
dogmaphobic committed
21

22 23 24 25 26 27 28
 ======================================================================*/

#ifndef QGCToolbox_h
#define QGCToolbox_h

#include <QObject>

Don Gagne's avatar
Don Gagne committed
29 30 31 32 33
class AutoPilotPluginManager;
class FactSystem;
class FirmwarePluginManager;
class FlightMapSettings;
class GAudioOutput;
34
class GPSManager;
Don Gagne's avatar
Don Gagne committed
35 36
class HomePositionManager;
class JoystickManager;
Jimmy Johnson's avatar
Jimmy Johnson committed
37
class FollowMe;
38 39
class LinkManager;
class MAVLinkProtocol;
Don Gagne's avatar
Don Gagne committed
40
class MissionCommands;
41
class MultiVehicleManager;
dogmaphobic's avatar
dogmaphobic committed
42
class QGCMapEngineManager;
Don Gagne's avatar
Don Gagne committed
43
class QGCApplication;
dogmaphobic's avatar
dogmaphobic committed
44
class QGCImageProvider;
Don Gagne's avatar
Don Gagne committed
45
class UASMessageHandler;
Jimmy Johnson's avatar
Jimmy Johnson committed
46
class QGCPositionManager;
47 48 49 50 51 52 53 54

/// This is used to manage all of our top level services/tools
class QGCToolbox {

public:
    QGCToolbox(QGCApplication* app);
    ~QGCToolbox();

Don Gagne's avatar
Don Gagne committed
55 56 57 58 59 60
    AutoPilotPluginManager*     autopilotPluginManager(void)    { return _autopilotPluginManager; }
    FirmwarePluginManager*      firmwarePluginManager(void)     { return _firmwarePluginManager; }
    FlightMapSettings*          flightMapSettings(void)         { return _flightMapSettings; }
    GAudioOutput*               audioOutput(void)               { return _audioOutput; }
    HomePositionManager*        homePositionManager(void)       { return _homePositionManager; }
    JoystickManager*            joystickManager(void)           { return _joystickManager; }
dogmaphobic's avatar
dogmaphobic committed
61 62
    LinkManager*                linkManager(void)               { return _linkManager; }
    MAVLinkProtocol*            mavlinkProtocol(void)           { return _mavlinkProtocol; }
Don Gagne's avatar
Don Gagne committed
63
    MissionCommands*            missionCommands(void)           { return _missionCommands; }
dogmaphobic's avatar
dogmaphobic committed
64
    MultiVehicleManager*        multiVehicleManager(void)       { return _multiVehicleManager; }
dogmaphobic's avatar
dogmaphobic committed
65
    QGCMapEngineManager*        mapEngineManager(void)          { return _mapEngineManager; }
dogmaphobic's avatar
dogmaphobic committed
66
    QGCImageProvider*           imageProvider()                 { return _imageProvider; }
Don Gagne's avatar
Don Gagne committed
67
    UASMessageHandler*          uasMessageHandler(void)         { return _uasMessageHandler; }
Jimmy Johnson's avatar
Jimmy Johnson committed
68
    FollowMe*                   followMe(void)                  { return _followMe; }
Jimmy Johnson's avatar
Jimmy Johnson committed
69
    QGCPositionManager*         qgcPositionManager(void)        { return _qgcPositionManager; }
Don Gagne's avatar
Don Gagne committed
70 71 72
#ifndef __mobile__
    GPSManager*                 gpsManager(void)                { return _gpsManager; }
#endif
73 74

private:
Don Gagne's avatar
Don Gagne committed
75
    GAudioOutput*               _audioOutput;
dogmaphobic's avatar
dogmaphobic committed
76
    AutoPilotPluginManager*     _autopilotPluginManager;
Don Gagne's avatar
Don Gagne committed
77 78
    FactSystem*                 _factSystem;
    FirmwarePluginManager*      _firmwarePluginManager;
dogmaphobic's avatar
dogmaphobic committed
79
    FlightMapSettings*          _flightMapSettings;
Don Gagne's avatar
Don Gagne committed
80
#ifndef __mobile__
81
    GPSManager*                 _gpsManager;
Don Gagne's avatar
Don Gagne committed
82
#endif
dogmaphobic's avatar
dogmaphobic committed
83
    HomePositionManager*        _homePositionManager;
Don Gagne's avatar
Don Gagne committed
84
    QGCImageProvider*           _imageProvider;
dogmaphobic's avatar
dogmaphobic committed
85
    JoystickManager*            _joystickManager;
Don Gagne's avatar
Don Gagne committed
86 87 88 89
    LinkManager*                _linkManager;
    MAVLinkProtocol*            _mavlinkProtocol;
    MissionCommands*            _missionCommands;
    MultiVehicleManager*        _multiVehicleManager;
dogmaphobic's avatar
dogmaphobic committed
90
    QGCMapEngineManager*         _mapEngineManager;
dogmaphobic's avatar
dogmaphobic committed
91
    UASMessageHandler*          _uasMessageHandler;
Jimmy Johnson's avatar
Jimmy Johnson committed
92
    FollowMe*                   _followMe;
Jimmy Johnson's avatar
Jimmy Johnson committed
93
    QGCPositionManager*         _qgcPositionManager;
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113
};

/// This is the base class for all tools
class QGCTool : public QObject {
    Q_OBJECT

public:
    // All tools are parented to QGCAppliation and go through a two phase creation. First all tools are newed,
    // and then setToolbox is called on all tools. The prevents creating an circular dependencies at constructor
    // time.
    QGCTool(QGCApplication* app);

    virtual void setToolbox(QGCToolbox* toolbox);

protected:
    QGCApplication* _app;
    QGCToolbox*     _toolbox;
};

#endif