Commit 6e7c9f32 authored by Gus Grubba's avatar Gus Grubba

(Unsuccessful) attempt at a build with AirMap disabled (not present).

It builds clean but the resources still get messed up (loads true qml files instead of dummy ones, and it crashes...)
parent ba37ee4c
......@@ -1137,8 +1137,15 @@ contains (DEFINES, QGC_AIRMAP_ENABLED) {
src/Airmap/AirMapWeatherInfoManager.cc \
} else {
#-- Dummies
INCLUDEPATH += \
src/Airmap/dummy
RESOURCES += \
src/Airmap/dummy/airmap_dummy.qrc
HEADERS += \
src/Airmap/dummy/AirspaceManager.h
SOURCES += \
src/Airmap/dummy/AirspaceManager.cc
}
#-------------------------------------------------------------------------------------
......
/****************************************************************************
*
* (c) 2017 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 "AirspaceManager.h"
#include "QGCApplication.h"
AirspaceManager::AirspaceManager(QGCApplication* app, QGCToolbox* toolbox)
: QGCTool(app, toolbox)
{
qmlRegisterUncreatableType<AirspaceManager> ("QGroundControl.Airspace", 1, 0, "AirspaceManager", "Reference only");
}
AirspaceManager::~AirspaceManager()
{
}
void AirspaceManager::setToolbox(QGCToolbox* toolbox)
{
QGCTool::setToolbox(toolbox);
}
void AirspaceManager::setROI(const QGeoCoordinate& pointNW, const QGeoCoordinate& pointSE, bool planView)
{
Q_UNUSED(pointNW);
Q_UNUSED(pointSE);
Q_UNUSED(planView);
}
/****************************************************************************
*
* (c) 2017 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.
*
****************************************************************************/
#pragma once
/**
* @file AirspaceManager.h
* Dummy file for when airspace management is disabled
*/
#include "QGCToolbox.h"
#include <QGeoCoordinate>
//-----------------------------------------------------------------------------
/**
* @class AirspaceManager
* Base class for airspace management. There is one (global) instantiation of this
*/
class AirspaceManager : public QGCTool {
Q_OBJECT
public:
AirspaceManager(QGCApplication* app, QGCToolbox* toolbox);
virtual ~AirspaceManager();
Q_PROPERTY(QString providerName READ providerName CONSTANT)
Q_PROPERTY(QObject* weatherInfo READ weatherInfo CONSTANT)
Q_PROPERTY(QObject* advisories READ advisories CONSTANT)
Q_PROPERTY(QObject* ruleSets READ ruleSets CONSTANT)
Q_PROPERTY(QObject* airspaces READ airspaces CONSTANT)
Q_PROPERTY(QObject* flightPlan READ flightPlan CONSTANT)
Q_PROPERTY(bool airspaceVisible READ airspaceVisible CONSTANT)
Q_INVOKABLE void setROI (const QGeoCoordinate& pointNW, const QGeoCoordinate& pointSE, bool planView);
QObject* weatherInfo () { return &_dummy; }
QObject* advisories () { return &_dummy; }
QObject* ruleSets () { return &_dummy; }
QObject* airspaces () { return &_dummy; }
QObject* flightPlan () { return &_dummy; }
void setToolbox(QGCToolbox* toolbox) override;
virtual QString providerName () const { return QString("None"); }
virtual bool airspaceVisible () { return false; }
private:
QObject _dummy;
};
import QtQuick 2.3
Item {
}
import QtQuick 2.3
Item {
}
import QtQuick 2.3
Item {
}
import QtQuick 2.3
Item {
}
import QtQuick 2.3
Item {
}
......@@ -4,5 +4,10 @@
<file alias="QGroundControl/Airmap/AirspaceControl.qml">AirspaceControl.qml</file>
<file alias="QGroundControl/Airmap/AirspaceRegulation.qml">AirspaceRegulation.qml</file>
<file alias="QGroundControl/Airmap/AirspaceWeather.qml">AirspaceWeather.qml</file>
<file alias="QGroundControl/Airmap/ComplianceRules.qml">ComplianceRules.qml</file>
<file alias="QGroundControl/Airmap/FlightBrief.qml">FlightBrief.qml</file>
<file alias="QGroundControl/Airmap/FlightDetails.qml">FlightDetails.qml</file>
<file alias="QGroundControl/Airmap/FlightFeature.qml">FlightFeature.qml</file>
<file alias="QGroundControl/Airmap/RuleSelector.qml">RuleSelector.qml</file>
</qresource>
</RCC>
......@@ -32,6 +32,8 @@
#include "QGCApplication.h"
#if defined(QGC_AIRMAP_ENABLED)
#include "AirMapManager.h"
#else
#include "AirspaceManager.h"
#endif
#if defined(QGC_CUSTOM_BUILD)
......@@ -59,9 +61,7 @@ QGCToolbox::QGCToolbox(QGCApplication* app)
, _mavlinkLogManager (NULL)
, _corePlugin (NULL)
, _settingsManager (NULL)
#if defined(QGC_AIRMAP_ENABLED)
, _airspaceManager (NULL)
#endif
{
// SettingsManager must be first so settings are available to any subsequent tools
_settingsManager = new SettingsManager(app, this);
......@@ -91,6 +91,8 @@ QGCToolbox::QGCToolbox(QGCApplication* app)
//-- For now, we instantiate the one and only AirMap provider
#if defined(QGC_AIRMAP_ENABLED)
_airspaceManager = new AirMapManager (app, this);
#else
_airspaceManager = new AirspaceManager (app, this);
#endif
}
......@@ -118,9 +120,7 @@ void QGCToolbox::setChildToolboxes(void)
_qgcPositionManager->setToolbox(this);
_videoManager->setToolbox(this);
_mavlinkLogManager->setToolbox(this);
#if defined(QGC_AIRMAP_ENABLED)
_airspaceManager->setToolbox(this);
#endif
}
void QGCToolbox::_scanAndLoadPlugins(QGCApplication* app)
......
......@@ -32,9 +32,7 @@ class VideoManager;
class MAVLinkLogManager;
class QGCCorePlugin;
class SettingsManager;
#if defined(QGC_AIRMAP_ENABLED)
class AirspaceManager;
#endif
/// This is used to manage all of our top level services/tools
class QGCToolbox : public QObject {
......@@ -59,9 +57,7 @@ public:
MAVLinkLogManager* mavlinkLogManager(void) { return _mavlinkLogManager; }
QGCCorePlugin* corePlugin(void) { return _corePlugin; }
SettingsManager* settingsManager(void) { return _settingsManager; }
#if defined(QGC_AIRMAP_ENABLED)
AirspaceManager* airspaceManager(void) { return _airspaceManager; }
#endif
#ifndef __mobile__
GPSManager* gpsManager(void) { return _gpsManager; }
#endif
......@@ -91,9 +87,7 @@ private:
MAVLinkLogManager* _mavlinkLogManager;
QGCCorePlugin* _corePlugin;
SettingsManager* _settingsManager;
#if defined(QGC_AIRMAP_ENABLED)
AirspaceManager* _airspaceManager;
#endif
friend class QGCApplication;
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment