Newer
Older
/****************************************************************************
*
* (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.
*
****************************************************************************/
#include "FactSystem.h"
#include "FirmwarePluginManager.h"
Beat Küng
committed
#ifndef __mobile__
Beat Küng
committed
#include "GPSManager.h"
#include "HomePositionManager.h"
#include "JoystickManager.h"
#include "LinkManager.h"
#include "MAVLinkProtocol.h"
#include "MissionCommandTree.h"
#include "QGCCorePlugin.h"
#include "QGCOptions.h"
#if defined(QGC_CUSTOM_BUILD)
#include CUSTOMHEADER
#endif
QGCToolbox::QGCToolbox(QGCApplication* app)
: _audioOutput(NULL)
, _factSystem(NULL)
, _firmwarePluginManager(NULL)
, _missionCommandTree(NULL)
, _corePlugin(NULL)
//-- Scan and load plugins
_scanAndLoadPlugins(app);
_audioOutput = new GAudioOutput(app);
_factSystem = new FactSystem(app);
_firmwarePluginManager = new FirmwarePluginManager(app);
_flightMapSettings = new FlightMapSettings(app);
Beat Küng
committed
#ifndef __mobile__
Beat Küng
committed
_gpsManager = new GPSManager(app);
_homePositionManager = new HomePositionManager(app);
_imageProvider = new QGCImageProvider(app);
_joystickManager = new JoystickManager(app);
_linkManager = new LinkManager(app);
_mavlinkProtocol = new MAVLinkProtocol(app);
_missionCommandTree = new MissionCommandTree(app);
_multiVehicleManager = new MultiVehicleManager(app);
_mapEngineManager = new QGCMapEngineManager(app);
_uasMessageHandler = new UASMessageHandler(app);
_qgcPositionManager = new QGCPositionManager(app);
void QGCToolbox::setChildToolboxes(void)
{
_corePlugin->setToolbox(this);
_audioOutput->setToolbox(this);
_factSystem->setToolbox(this);
_firmwarePluginManager->setToolbox(this);
Beat Küng
committed
#ifndef __mobile__
Beat Küng
committed
_gpsManager->setToolbox(this);
_homePositionManager->setToolbox(this);
_imageProvider->setToolbox(this);
_joystickManager->setToolbox(this);
_linkManager->setToolbox(this);
_mavlinkProtocol->setToolbox(this);
_missionCommandTree->setToolbox(this);
}
QGCToolbox::~QGCToolbox()
{
delete _audioOutput;
delete _factSystem;
delete _firmwarePluginManager;
delete _flightMapSettings;
delete _homePositionManager;
delete _joystickManager;
delete _linkManager;
delete _mavlinkProtocol;
delete _missionCommandTree;
delete _corePlugin;
}
void QGCToolbox::_scanAndLoadPlugins(QGCApplication* app)
{
//-- Create custom plugin (Static)
_corePlugin = (QGCCorePlugin*) new CUSTOMCLASS(app);
if(_corePlugin) {
return;
}
#endif
//-- No plugins found, use default instance
_corePlugin = new QGCCorePlugin(app);