Skip to content

Commit

Permalink
Convert MAVLinkLogManager to Singleton
Browse files Browse the repository at this point in the history
  • Loading branch information
HTRamsey committed Nov 11, 2024
1 parent ac083a3 commit 94d7a78
Show file tree
Hide file tree
Showing 6 changed files with 765 additions and 761 deletions.
3 changes: 0 additions & 3 deletions src/QGCToolbox.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#include "MAVLinkProtocol.h"
#include "MultiVehicleManager.h"
#include "VideoManager.h"
#include "MAVLinkLogManager.h"
#include "QGCCorePlugin.h"
#include "SettingsManager.h"
#include "QGCApplication.h"
Expand Down Expand Up @@ -41,7 +40,6 @@ QGCToolbox::QGCToolbox(QGCApplication* app)
_multiVehicleManager = new MultiVehicleManager (app, this);
_videoManager = new VideoManager (app, this);

_mavlinkLogManager = new MAVLinkLogManager (app, this);
#ifndef QGC_AIRLINK_DISABLED
_airlinkManager = new AirLinkManager (app, this);
#endif
Expand All @@ -60,7 +58,6 @@ void QGCToolbox::setChildToolboxes(void)
_mavlinkProtocol->setToolbox(this);
_multiVehicleManager->setToolbox(this);
_videoManager->setToolbox(this);
_mavlinkLogManager->setToolbox(this);
#ifndef QGC_AIRLINK_DISABLED
_airlinkManager->setToolbox(this);
#endif
Expand Down
3 changes: 0 additions & 3 deletions src/QGCToolbox.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ class MAVLinkProtocol;
class MultiVehicleManager;
class QGCApplication;
class VideoManager;
class MAVLinkLogManager;
class QGCCorePlugin;
class SettingsManager;
#ifndef QGC_AIRLINK_DISABLED
Expand All @@ -39,7 +38,6 @@ class QGCToolbox : public QObject {
MAVLinkProtocol* mavlinkProtocol () { return _mavlinkProtocol; }
MultiVehicleManager* multiVehicleManager () { return _multiVehicleManager; }
VideoManager* videoManager () { return _videoManager; }
MAVLinkLogManager* mavlinkLogManager () { return _mavlinkLogManager; }
QGCCorePlugin* corePlugin () { return _corePlugin; }
SettingsManager* settingsManager () { return _settingsManager; }
#ifndef QGC_AIRLINK_DISABLED
Expand All @@ -57,7 +55,6 @@ class QGCToolbox : public QObject {
MAVLinkProtocol* _mavlinkProtocol = nullptr;
MultiVehicleManager* _multiVehicleManager = nullptr;
VideoManager* _videoManager = nullptr;
MAVLinkLogManager* _mavlinkLogManager = nullptr;
QGCCorePlugin* _corePlugin = nullptr;
SettingsManager* _settingsManager = nullptr;
#ifndef QGC_AIRLINK_DISABLED
Expand Down
3 changes: 2 additions & 1 deletion src/QmlControls/QGroundControlQmlGlobal.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "QGCMapEngineManager.h"
#include "ADSBVehicleManager.h"
#include "MissionCommandTree.h"
#include "MAVLinkLogManager.h"
#ifndef NO_SERIAL_LINK
#include "GPSManager.h"
#include "GPSRtk.h"
Expand All @@ -39,6 +40,7 @@ QGroundControlQmlGlobal::QGroundControlQmlGlobal(QGCApplication* app, QGCToolbox
, _adsbVehicleManager(ADSBVehicleManager::instance())
, _qgcPositionManager(QGCPositionManager::instance())
, _missionCommandTree(MissionCommandTree::instance())
, _mavlinkLogManager(MAVLinkLogManager::instance())
{
// We clear the parent on this object since we run into shutdown problems caused by hybrid qml app. Instead we let it leak on shutdown.
// setParent(nullptr);
Expand Down Expand Up @@ -82,7 +84,6 @@ void QGroundControlQmlGlobal::setToolbox(QGCToolbox* toolbox)
_linkManager = toolbox->linkManager();
_multiVehicleManager = toolbox->multiVehicleManager();
_videoManager = toolbox->videoManager();
_mavlinkLogManager = toolbox->mavlinkLogManager();
_corePlugin = toolbox->corePlugin();
_settingsManager = toolbox->settingsManager();
#ifndef NO_SERIAL_LINK
Expand Down
2 changes: 1 addition & 1 deletion src/QmlControls/QGroundControlQmlGlobal.h
Original file line number Diff line number Diff line change
Expand Up @@ -261,12 +261,12 @@ class QGroundControlQmlGlobal : public QGCTool
ADSBVehicleManager* _adsbVehicleManager = nullptr;
QGCPositionManager* _qgcPositionManager = nullptr;
MissionCommandTree* _missionCommandTree = nullptr;
MAVLinkLogManager* _mavlinkLogManager = nullptr;

double _flightMapInitialZoom = 17.0;
LinkManager* _linkManager = nullptr;
MultiVehicleManager* _multiVehicleManager = nullptr;
VideoManager* _videoManager = nullptr;
MAVLinkLogManager* _mavlinkLogManager = nullptr;
QGCCorePlugin* _corePlugin = nullptr;
SettingsManager* _settingsManager = nullptr;
#ifndef NO_SERIAL_LINK
Expand Down
Loading

0 comments on commit 94d7a78

Please sign in to comment.