QGCToolbox.cc 4.17 KB
Newer Older
1 2 3 4 5 6 7 8
 /****************************************************************************
 *
 *   (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.
 *
 ****************************************************************************/
9 10


Don Gagne's avatar
Don Gagne committed
11 12 13
#include "AutoPilotPluginManager.h"
#include "FactSystem.h"
#include "FirmwarePluginManager.h"
14
#include "FlightMapSettings.h"
Don Gagne's avatar
Don Gagne committed
15
#include "GAudioOutput.h"
16
#ifndef __mobile__
17
#include "GPSManager.h"
Don Gagne's avatar
Don Gagne committed
18
#endif
19 20
#include "HomePositionManager.h"
#include "JoystickManager.h"
Don Gagne's avatar
Don Gagne committed
21 22
#include "LinkManager.h"
#include "MAVLinkProtocol.h"
23
#include "MissionCommandTree.h"
Don Gagne's avatar
Don Gagne committed
24
#include "MultiVehicleManager.h"
dogmaphobic's avatar
dogmaphobic committed
25
#include "QGCImageProvider.h"
Don Gagne's avatar
Don Gagne committed
26
#include "UASMessageHandler.h"
dogmaphobic's avatar
dogmaphobic committed
27
#include "QGCMapEngineManager.h"
Jimmy Johnson's avatar
Jimmy Johnson committed
28
#include "FollowMe.h"
Jimmy Johnson's avatar
Jimmy Johnson committed
29
#include "PositionManager.h"
30
#include "VideoManager.h"
Gus Grubba's avatar
Gus Grubba committed
31
#include "MAVLinkLogManager.h"
32 33

QGCToolbox::QGCToolbox(QGCApplication* app)
Don Gagne's avatar
Don Gagne committed
34
    : _audioOutput(NULL)
35
    , _autopilotPluginManager(NULL)
Don Gagne's avatar
Don Gagne committed
36 37
    , _factSystem(NULL)
    , _firmwarePluginManager(NULL)
38
    , _flightMapSettings(NULL)
Don Gagne's avatar
Don Gagne committed
39
#ifndef __mobile__
Don Gagne's avatar
Don Gagne committed
40 41
    , _gpsManager(NULL)
#endif
42
    , _homePositionManager(NULL)
Don Gagne's avatar
Don Gagne committed
43
    , _imageProvider(NULL)
44
    , _joystickManager(NULL)
Don Gagne's avatar
Don Gagne committed
45 46
    , _linkManager(NULL)
    , _mavlinkProtocol(NULL)
47
    , _missionCommandTree(NULL)
Don Gagne's avatar
Don Gagne committed
48
    , _multiVehicleManager(NULL)
dogmaphobic's avatar
dogmaphobic committed
49
    , _mapEngineManager(NULL)
50
    , _uasMessageHandler(NULL)
Jimmy Johnson's avatar
Jimmy Johnson committed
51
    , _followMe(NULL)
Jimmy Johnson's avatar
Jimmy Johnson committed
52
    , _qgcPositionManager(NULL)
53
    , _videoManager(NULL)
Gus Grubba's avatar
Gus Grubba committed
54
    , _mavlinkLogManager(NULL)
55
{
Don Gagne's avatar
Don Gagne committed
56
    _audioOutput =              new GAudioOutput(app);
57
    _autopilotPluginManager =   new AutoPilotPluginManager(app);
Don Gagne's avatar
Don Gagne committed
58 59
    _factSystem =               new FactSystem(app);
    _firmwarePluginManager =    new FirmwarePluginManager(app);
60
    _flightMapSettings =        new FlightMapSettings(app);
61
#ifndef __mobile__
62
    _gpsManager =               new GPSManager(app);
Don Gagne's avatar
Don Gagne committed
63
#endif
64
    _homePositionManager =      new HomePositionManager(app);
Don Gagne's avatar
Don Gagne committed
65 66
    _imageProvider =            new QGCImageProvider(app);
    _joystickManager =          new JoystickManager(app);
67 68
    _linkManager =              new LinkManager(app);
    _mavlinkProtocol =          new MAVLinkProtocol(app);
69
    _missionCommandTree =       new MissionCommandTree(app);
Don Gagne's avatar
Don Gagne committed
70
    _multiVehicleManager =      new MultiVehicleManager(app);
Jimmy Johnson's avatar
Jimmy Johnson committed
71
    _mapEngineManager =         new QGCMapEngineManager(app);
72
    _uasMessageHandler =        new UASMessageHandler(app);
Jimmy Johnson's avatar
Jimmy Johnson committed
73
    _qgcPositionManager =       new QGCPositionManager(app);
Jimmy Johnson's avatar
Jimmy Johnson committed
74
    _followMe =                 new FollowMe(app);
75
    _videoManager =             new VideoManager(app);
Gus Grubba's avatar
Gus Grubba committed
76
    _mavlinkLogManager =        new MAVLinkLogManager(app);
77
}
78

79 80
void QGCToolbox::setChildToolboxes(void)
{
Don Gagne's avatar
Don Gagne committed
81
    _audioOutput->setToolbox(this);
82
    _autopilotPluginManager->setToolbox(this);
Don Gagne's avatar
Don Gagne committed
83 84
    _factSystem->setToolbox(this);
    _firmwarePluginManager->setToolbox(this);
85
    _flightMapSettings->setToolbox(this);
86
#ifndef __mobile__
87
    _gpsManager->setToolbox(this);
Don Gagne's avatar
Don Gagne committed
88
#endif
89
    _homePositionManager->setToolbox(this);
Don Gagne's avatar
Don Gagne committed
90 91
    _imageProvider->setToolbox(this);
    _joystickManager->setToolbox(this);
92 93
    _linkManager->setToolbox(this);
    _mavlinkProtocol->setToolbox(this);
94
    _missionCommandTree->setToolbox(this);
Don Gagne's avatar
Don Gagne committed
95
    _multiVehicleManager->setToolbox(this);
dogmaphobic's avatar
dogmaphobic committed
96
    _mapEngineManager->setToolbox(this);
97
    _uasMessageHandler->setToolbox(this);
Jimmy Johnson's avatar
Jimmy Johnson committed
98
    _followMe->setToolbox(this);
Jimmy Johnson's avatar
Jimmy Johnson committed
99
    _qgcPositionManager->setToolbox(this);
100
    _videoManager->setToolbox(this);
Gus Grubba's avatar
Gus Grubba committed
101
    _mavlinkLogManager->setToolbox(this);
102 103 104 105
}

QGCToolbox::~QGCToolbox()
{
106
    delete _videoManager;
Gus Grubba's avatar
Gus Grubba committed
107
    delete _mavlinkLogManager;
Don Gagne's avatar
Don Gagne committed
108
    delete _audioOutput;
109
    delete _autopilotPluginManager;
Don Gagne's avatar
Don Gagne committed
110 111
    delete _factSystem;
    delete _firmwarePluginManager;
112 113 114
    delete _flightMapSettings;
    delete _homePositionManager;
    delete _joystickManager;
Don Gagne's avatar
Don Gagne committed
115 116
    delete _linkManager;
    delete _mavlinkProtocol;
117
    delete _missionCommandTree;
dogmaphobic's avatar
dogmaphobic committed
118
    delete _mapEngineManager;
Don Gagne's avatar
Don Gagne committed
119
    delete _multiVehicleManager;
120
    delete _uasMessageHandler;
Jimmy Johnson's avatar
Jimmy Johnson committed
121
    delete _followMe;
Jimmy Johnson's avatar
Jimmy Johnson committed
122
    delete _qgcPositionManager;
123 124 125 126 127 128 129 130 131 132 133 134 135 136
}

QGCTool::QGCTool(QGCApplication* app)
    : QObject((QObject*)app)
    , _app(app)
    , _toolbox(NULL)
{

}

void QGCTool::setToolbox(QGCToolbox* toolbox)
{
    _toolbox = toolbox;
}