Commit fc74866c authored by Gus Grubba's avatar Gus Grubba

Some build fixes (not there yet)

parent 6b47e107
...@@ -1069,8 +1069,8 @@ contains (DEFINES, QGC_AIRMAP_ENABLED) { ...@@ -1069,8 +1069,8 @@ contains (DEFINES, QGC_AIRMAP_ENABLED) {
src/AirspaceManagement/AirspaceRestriction.h \ src/AirspaceManagement/AirspaceRestriction.h \
src/AirspaceManagement/AirspaceRestrictionProvider.h \ src/AirspaceManagement/AirspaceRestrictionProvider.h \
src/AirspaceManagement/AirspaceRulesetsProvider.h \ src/AirspaceManagement/AirspaceRulesetsProvider.h \
src/AirspaceManagement/AirspaceWeatherInfoProvider.h \
src/AirspaceManagement/AirspaceVehicleManager.h \ src/AirspaceManagement/AirspaceVehicleManager.h \
src/AirspaceManagement/AirspaceWeatherInfoProvider.h \
SOURCES += \ SOURCES += \
src/AirspaceManagement/AirspaceController.cc \ src/AirspaceManagement/AirspaceController.cc \
...@@ -1078,8 +1078,8 @@ contains (DEFINES, QGC_AIRMAP_ENABLED) { ...@@ -1078,8 +1078,8 @@ contains (DEFINES, QGC_AIRMAP_ENABLED) {
src/AirspaceManagement/AirspaceRestriction.cc \ src/AirspaceManagement/AirspaceRestriction.cc \
src/AirspaceManagement/AirspaceRestrictionProvider.cc \ src/AirspaceManagement/AirspaceRestrictionProvider.cc \
src/AirspaceManagement/AirspaceRulesetsProvider.cc \ src/AirspaceManagement/AirspaceRulesetsProvider.cc \
src/AirspaceManagement/AirspaceWeatherInfoProvider.cc \
src/AirspaceManagement/AirspaceVehicleManager.cc \ src/AirspaceManagement/AirspaceVehicleManager.cc \
src/AirspaceManagement/AirspaceWeatherInfoProvider.cc \
#-- This is the AirMap implementation of the above #-- This is the AirMap implementation of the above
RESOURCES += \ RESOURCES += \
...@@ -1089,31 +1089,28 @@ contains (DEFINES, QGC_AIRMAP_ENABLED) { ...@@ -1089,31 +1089,28 @@ contains (DEFINES, QGC_AIRMAP_ENABLED) {
src/Airmap src/Airmap
HEADERS += \ HEADERS += \
src/Airmap/AirMapFlightManager.h \
src/Airmap/AirMapManager.h \ src/Airmap/AirMapManager.h \
src/Airmap/AirspaceManagement.h \
src/Airmap/AirMapSettings.h \
src/Airmap/AirmapWeatherInformation.h \
src/Airmap/AirMapRestrictionManager.h \ src/Airmap/AirMapRestrictionManager.h \
src/Airmap/AirMapRulesetsManager.h \ src/Airmap/AirMapRulesetsManager.h \
src/Airmap/AirMapSettings.h \
src/Airmap/AirMapSharedState.h \ src/Airmap/AirMapSharedState.h \
src/Airmap/AirMapFlightManager.h \
src/Airmap/AirMapTelemetry.h \ src/Airmap/AirMapTelemetry.h \
src/Airmap/AirMapTrafficMonitor.h \ src/Airmap/AirMapTrafficMonitor.h \
src/Airmap/AirMapVehicleManager.h \ src/Airmap/AirMapVehicleManager.h \
src/Airmap/AirmapWeatherInformation.h \
SOURCES += \ SOURCES += \
src/Airmap/AirMapFlightManager.cc \
src/Airmap/AirMapManager.cc \ src/Airmap/AirMapManager.cc \
src/Airmap/AirspaceManagement.cc \
src/Airmap/AirspaceController.cc \
src/Airmap/AirMapSettings.cc \
src/Airmap/AirmapWeatherInformation.cc \
src/Airmap/AirMapRestrictionManager.cc \ src/Airmap/AirMapRestrictionManager.cc \
src/Airmap/AirMapRulesetsManager.cc \ src/Airmap/AirMapRulesetsManager.cc \
src/Airmap/AirMapSettings.cc \
src/Airmap/AirMapSharedState.cc \ src/Airmap/AirMapSharedState.cc \
src/Airmap/AirMapFlightManager.cc \
src/Airmap/AirMapTelemetry.cc \ src/Airmap/AirMapTelemetry.cc \
src/Airmap/AirMapTrafficMonitor.cc \ src/Airmap/AirMapTrafficMonitor.cc \
src/Airmap/AirMapVehicleManager.cc \ src/Airmap/AirMapVehicleManager.cc \
src/Airmap/AirmapWeatherInformation.cc \
} else { } else {
RESOURCES += \ RESOURCES += \
......
/****************************************************************************
*
* (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 "AirMapManager.h"
#include "AirMapFlightManager.h" #include "AirMapFlightManager.h"
AirMapFlightManager::AirMapFlightManager(AirMapSharedState& shared) AirMapFlightManager::AirMapFlightManager(AirMapSharedState& shared)
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
#include "AirMapTelemetry.h" #include "AirMapTelemetry.h"
#include "AirMapTrafficMonitor.h" #include "AirMapTrafficMonitor.h"
#include "Vehicle.h"
#include "QmlObjectListModel.h" #include "QmlObjectListModel.h"
#include "JsonHelper.h" #include "JsonHelper.h"
#include "SettingsManager.h" #include "SettingsManager.h"
......
...@@ -12,14 +12,13 @@ ...@@ -12,14 +12,13 @@
#include "QGCToolbox.h" #include "QGCToolbox.h"
#include "QGCLoggingCategory.h" #include "QGCLoggingCategory.h"
#include "AirspaceManagement.h" #include "AirspaceManagement.h"
#include "AirMapSharedState.h"
#include <airmap/qt/logger.h> #include <airmap/qt/logger.h>
#include <airmap/qt/types.h> #include <airmap/qt/types.h>
Q_DECLARE_LOGGING_CATEGORY(AirMapManagerLog) Q_DECLARE_LOGGING_CATEGORY(AirMapManagerLog)
class AirMapSharedState;
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
/** /**
* @class LifetimeChecker * @class LifetimeChecker
......
/****************************************************************************
*
* (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 "AirMapManager.h"
#include "AirMapRestrictionManager.h" #include "AirMapRestrictionManager.h"
AirMapRestrictionManager::AirMapRestrictionManager(AirMapSharedState& shared) AirMapRestrictionManager::AirMapRestrictionManager(AirMapSharedState& shared)
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#pragma once #pragma once
#include <QObject> #include <QObject>
#include "AirMapManager.h"
#include "AirspaceRestrictionProvider.h" #include "AirspaceRestrictionProvider.h"
/** /**
......
/****************************************************************************
*
* (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 "AirMapManager.h"
#include "AirMapRulesetsManager.h" #include "AirMapRulesetsManager.h"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
......
/****************************************************************************
*
* (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 "AirMapManager.h"
#include "AirMapSharedState.h" #include "AirMapSharedState.h"
void void
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
* *
****************************************************************************/ ****************************************************************************/
#include "AirMapManager.h"
#include "AirMapTelemetry.h" #include "AirMapTelemetry.h"
AirMapTelemetry::AirMapTelemetry(AirMapSharedState& shared) AirMapTelemetry::AirMapTelemetry(AirMapSharedState& shared)
......
/****************************************************************************
*
* (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 "AirMapManager.h"
#include "AirMapTrafficMonitor.h" #include "AirMapTrafficMonitor.h"
AirMapTrafficMonitor::~AirMapTrafficMonitor() AirMapTrafficMonitor::~AirMapTrafficMonitor()
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#pragma once #pragma once
#include <QObject> #include <QObject>
#include "AirMapManager.h"
/** /**
* @class AirMapTrafficMonitor * @class AirMapTrafficMonitor
...@@ -31,11 +32,11 @@ public: ...@@ -31,11 +32,11 @@ public:
void stop(); void stop();
signals: signals:
void error(const QString& what, const QString& airmapdMessage, const QString& airmapdDetails); void error (const QString& what, const QString& airmapdMessage, const QString& airmapdDetails);
void trafficUpdate(QString traffic_id, QString vehicle_id, QGeoCoordinate location, float heading); void trafficUpdate (QString traffic_id, QString vehicle_id, QGeoCoordinate location, float heading);
private: private:
void _update(airmap::Traffic::Update::Type type, const std::vector<airmap::Traffic::Update>& update); void _update (airmap::Traffic::Update::Type type, const std::vector<airmap::Traffic::Update>& update);
private: private:
QString _flightID; QString _flightID;
......
/****************************************************************************
*
* (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 "AirMapManager.h"
#include "AirMapVehicleManager.h" #include "AirMapVehicleManager.h"
#include "AirMapFlightManager.h" #include "AirMapFlightManager.h"
#include "AirMapTelemetry.h" #include "AirMapTelemetry.h"
#include "AirMapTrafficMonitor.h" #include "AirMapTrafficMonitor.h"
#include "Vehicle.h"
AirMapVehicleManager::AirMapVehicleManager(AirMapSharedState& shared, const Vehicle& vehicle, QGCToolbox& toolbox) AirMapVehicleManager::AirMapVehicleManager(AirMapSharedState& shared, const Vehicle& vehicle, QGCToolbox& toolbox)
: AirspaceVehicleManager(vehicle) : AirspaceVehicleManager(vehicle)
, _shared(shared) , _shared(shared)
......
/****************************************************************************
*
* (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 "AirMapManager.h"
#include "AirmapWeatherInformation.h" #include "AirmapWeatherInformation.h"
#define WEATHER_UPDATE_DISTANCE 50000 //-- 50km threshold for weather updates
#define WEATHER_UPDATE_TIME 30 * 60 * 60 * 1000 //-- 30 minutes threshold for weather updates
AirMapWeatherInformation::AirMapWeatherInformation(AirMapSharedState& shared, QObject *parent) AirMapWeatherInformation::AirMapWeatherInformation(AirMapSharedState& shared, QObject *parent)
: QObject(parent) : QObject(parent)
, _valid(false) , _valid(false)
......
...@@ -11,6 +11,9 @@ ...@@ -11,6 +11,9 @@
#include <QObject> #include <QObject>
#include <QGeoCoordinate> #include <QGeoCoordinate>
#include <QTime>
#include "AirMapManager.h"
#include "AirspaceWeatherInfoProvider.h" #include "AirspaceWeatherInfoProvider.h"
/** /**
......
...@@ -13,14 +13,10 @@ ...@@ -13,14 +13,10 @@
#include "QGCApplication.h" #include "QGCApplication.h"
#include "QGCQGeoCoordinate.h" #include "QGCQGeoCoordinate.h"
#define WEATHER_UPDATE_DISTANCE 50000 //-- 50km threshold for weather updates
#define WEATHER_UPDATE_TIME 30 * 60 * 60 * 1000 //-- 30 minutes threshold for weather updates
AirspaceController::AirspaceController(QObject* parent) AirspaceController::AirspaceController(QObject* parent)
: QObject(parent) : QObject(parent)
, _manager(qgcApp()->toolbox()->airspaceManager()) , _manager(qgcApp()->toolbox()->airspaceManager())
{ {
connect(_manager, &AirspaceManager::weatherUpdate, this, &AirspaceController::_weatherUpdate);
} }
void AirspaceController::setROI(QGeoCoordinate center, double radius) void AirspaceController::setROI(QGeoCoordinate center, double radius)
......
...@@ -10,8 +10,9 @@ ...@@ -10,8 +10,9 @@
#pragma once #pragma once
#include "AirspaceManagement.h" #include "AirspaceManagement.h"
#include "QGCMapPolygon.h"
#include "AirmapWeatherInformation.h" #include "AirmapWeatherInformation.h"
#include "QmlObjectListModel.h"
#include "QGCMapPolygon.h"
class AirspaceController : public QObject class AirspaceController : public QObject
{ {
......
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
#include "AirspaceManagement.h" #include "AirspaceManagement.h"
#include <Vehicle.h>
QGC_LOGGING_CATEGORY(AirspaceManagementLog, "AirspaceManagementLog") QGC_LOGGING_CATEGORY(AirspaceManagementLog, "AirspaceManagementLog")
...@@ -19,7 +18,9 @@ AirspaceManager::AirspaceManager(QGCApplication* app, QGCToolbox* toolbox) ...@@ -19,7 +18,9 @@ AirspaceManager::AirspaceManager(QGCApplication* app, QGCToolbox* toolbox)
_roiUpdateTimer.setInterval(2000); _roiUpdateTimer.setInterval(2000);
_roiUpdateTimer.setSingleShot(true); _roiUpdateTimer.setSingleShot(true);
connect(&_roiUpdateTimer, &QTimer::timeout, this, &AirspaceManager::_updateToROI); connect(&_roiUpdateTimer, &QTimer::timeout, this, &AirspaceManager::_updateToROI);
qmlRegisterUncreatableType<AirspaceAuthorization>("QGroundControl", 1, 0, "AirspaceAuthorization", "Reference only"); qmlRegisterUncreatableType<AirspaceAuthorization> ("QGroundControl", 1, 0, "AirspaceAuthorization", "Reference only");
qmlRegisterUncreatableType<AirspaceController> ("QGroundControl.Vehicle", 1, 0, "AirspaceController", "Reference only");
qmlRegisterUncreatableType<AirspaceWeatherInfoProvider> ("QGroundControl.Vehicle", 1, 0, "AirspaceWeatherInfoProvider","Reference only");
} }
AirspaceManager::~AirspaceManager() AirspaceManager::~AirspaceManager()
...@@ -89,26 +90,3 @@ void AirspaceManager::_rulessetsUpdated(bool) ...@@ -89,26 +90,3 @@ void AirspaceManager::_rulessetsUpdated(bool)
{ {
} }
AirspaceVehicleManager::AirspaceVehicleManager(const Vehicle& vehicle)
: _vehicle(vehicle)
{
connect(&_vehicle, &Vehicle::armedChanged, this, &AirspaceVehicleManager::_vehicleArmedChanged);
connect(&_vehicle, &Vehicle::mavlinkMessageReceived, this, &AirspaceVehicleManager::vehicleMavlinkMessageReceived);
}
void AirspaceVehicleManager::_vehicleArmedChanged(bool armed)
{
if (armed) {
startTelemetryStream();
_vehicleWasInMissionMode = _vehicle.flightMode() == _vehicle.missionFlightMode();
} else {
stopTelemetryStream();
// end the flight if we were in mission mode during arming or disarming
// TODO: needs to be improved. for instance if we do RTL and then want to continue the mission...
if (_vehicleWasInMissionMode || _vehicle.flightMode() == _vehicle.missionFlightMode()) {
endFlight();
}
}
}
...@@ -23,19 +23,26 @@ ...@@ -23,19 +23,26 @@
* each vehicle could have its own restrictions. * each vehicle could have its own restrictions.
*/ */
#include "AirspaceController.h"
#include "AirspaceRestrictionProvider.h"
#include "AirspaceRulesetsProvider.h"
#include "AirspaceVehicleManager.h"
#include "AirspaceWeatherInfoProvider.h"
#include "QGCToolbox.h" #include "QGCToolbox.h"
#include "MissionItem.h" #include "QGCLoggingCategory.h"
#include "QmlObjectListModel.h"
#include "Vehicle.h"
#include <QGeoCoordinate>
#include <QObject> #include <QObject>
#include <QString> #include <QString>
#include <QList> #include <QList>
#include <QTimer>
#include <QGCLoggingCategory.h>
Q_DECLARE_LOGGING_CATEGORY(AirspaceManagementLog) Q_DECLARE_LOGGING_CATEGORY(AirspaceManagementLog)
class AirMapWeatherInformation;
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
/** /**
* Contains the status of the Airspace authorization * Contains the status of the Airspace authorization
...@@ -49,15 +56,9 @@ public: ...@@ -49,15 +56,9 @@ public:
PermitAccepted, PermitAccepted,
PermitRejected, PermitRejected,
}; };
Q_ENUMS(PermitStatus); Q_ENUM(PermitStatus)
}; };
class AirspaceRestrictionProvider;
class AirspaceRulesetsProvider;
class AirspaceVehicleManager;
class AirspaceWeatherInfoProvider;
class Vehicle;
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
/** /**
* @class AirspaceManager * @class AirspaceManager
...@@ -104,16 +105,7 @@ public: ...@@ -104,16 +105,7 @@ public:
/** /**
* Name of the airspace management provider (used in the UI) * Name of the airspace management provider (used in the UI)
*/ */
virtual QString name () const = 0; virtual QString name () const = 0;
/**
* Request weather information update. When done, it will emit the weatherUpdate() signal.
* @param coordinate request update for this coordinate
*/
virtual void requestWeatherUpdate(const QGeoCoordinate& coordinate) = 0;
signals:
void weatherUpdate (bool success, QGeoCoordinate coordinate, WeatherInformation weather);
protected slots: protected slots:
virtual void _rulessetsUpdated (bool success); virtual void _rulessetsUpdated (bool success);
......
...@@ -11,85 +11,6 @@ ...@@ -11,85 +11,6 @@
#include "AirspaceManagement.h" #include "AirspaceManagement.h"
#include <Vehicle.h> #include <Vehicle.h>
QGC_LOGGING_CATEGORY(AirspaceManagementLog, "AirspaceManagementLog")
AirspaceManager::AirspaceManager(QGCApplication* app, QGCToolbox* toolbox)
: QGCTool(app, toolbox)
{
_roiUpdateTimer.setInterval(2000);
_roiUpdateTimer.setSingleShot(true);
connect(&_roiUpdateTimer, &QTimer::timeout, this, &AirspaceManager::_updateToROI);
qmlRegisterUncreatableType<AirspaceAuthorization>("QGroundControl", 1, 0, "AirspaceAuthorization", "Reference only");
}
AirspaceManager::~AirspaceManager()
{
if (_restrictionsProvider) {
delete _restrictionsProvider;
}
if(_rulesetsProvider) {
delete _rulesetsProvider;
}
_polygonRestrictions.clearAndDeleteContents();
_circleRestrictions.clearAndDeleteContents();
}
void AirspaceManager::setToolbox(QGCToolbox* toolbox)
{
QGCTool::setToolbox(toolbox);
// We should not call virtual methods in the constructor, so we instantiate the restriction provider here
_restrictionsProvider = instantiateRestrictionProvider();
if (_restrictionsProvider) {
connect(_restrictionsProvider, &AirspaceRestrictionProvider::requestDone, this,
&AirspaceManager::_restrictionsUpdated);
}
_rulesetsProvider = instantiateRulesetsProvider();
if (_rulesetsProvider) {
connect(_rulesetsProvider, &AirspaceRulesetsProvider::requestDone, this,
&AirspaceManager::_rulessetsUpdated);
}
}
void AirspaceManager::setROI(const QGeoCoordinate& center, double radiusMeters)
{
_roiCenter = center;
_roiRadius = radiusMeters;
_roiUpdateTimer.start();
}
void AirspaceManager::_updateToROI()
{
if (_restrictionsProvider) {
_restrictionsProvider->setROI(_roiCenter, _roiRadius);
}
//-- TODO: We may want to check the distance between this ROI and the last
// to see if we really need to update it.
if(_rulesetsProvider) {
_rulesetsProvider->setROI(_roiCenter);
}
}
void AirspaceManager::_restrictionsUpdated(bool success)
{
_polygonRestrictions.clearAndDeleteContents();
_circleRestrictions.clearAndDeleteContents();
if (success) {
for (const auto& circle : _restrictionsProvider->circles()) {
_circleRestrictions.append(circle);
}
for (const auto& polygon : _restrictionsProvider->polygons()) {
_polygonRestrictions.append(polygon);
}
} else {
// TODO: show error?
}
}
void AirspaceManager::_rulessetsUpdated(bool)
{
}
AirspaceVehicleManager::AirspaceVehicleManager(const Vehicle& vehicle) AirspaceVehicleManager::AirspaceVehicleManager(const Vehicle& vehicle)
: _vehicle(vehicle) : _vehicle(vehicle)
{ {
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#pragma once #pragma once
#include <QList> #include <QList>
#include "MissionItem.h"
class Vehicle; class Vehicle;
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
*/ */
#include <QObject> #include <QObject>
#include <QGeoCoordinate>
class AirspaceWeatherInfoProvider : public QObject class AirspaceWeatherInfoProvider : public QObject
{ {
......
...@@ -84,10 +84,6 @@ ...@@ -84,10 +84,6 @@
#include "CameraCalc.h" #include "CameraCalc.h"
#include "VisualMissionItem.h" #include "VisualMissionItem.h"
#include "EditPositionDialogController.h" #include "EditPositionDialogController.h"
#if defined(QGC_AIRMAP_ENABLED)
#include "AirspaceController.h"
#include "AirmapWeatherInformation.h"
#endif
#ifndef NO_SERIAL_LINK #ifndef NO_SERIAL_LINK
#include "SerialLink.h" #include "SerialLink.h"
#endif #endif
...@@ -384,10 +380,6 @@ void QGCApplication::_initCommon(void) ...@@ -384,10 +380,6 @@ void QGCApplication::_initCommon(void)
qmlRegisterUncreatableType<GeoFenceController> ("QGroundControl.Controllers", 1, 0, "GeoFenceController", "Reference only"); qmlRegisterUncreatableType<GeoFenceController> ("QGroundControl.Controllers", 1, 0, "GeoFenceController", "Reference only");
qmlRegisterUncreatableType<RallyPointController>("QGroundControl.Controllers", 1, 0, "RallyPointController", "Reference only"); qmlRegisterUncreatableType<RallyPointController>("QGroundControl.Controllers", 1, 0, "RallyPointController", "Reference only");
qmlRegisterUncreatableType<VisualMissionItem> ("QGroundControl.Controllers", 1, 0, "VisualMissionItem", "Reference only"); qmlRegisterUncreatableType<VisualMissionItem> ("QGroundControl.Controllers", 1, 0, "VisualMissionItem", "Reference only");
#if defined(QGC_AIRMAP_ENABLED)
qmlRegisterUncreatableType<AirspaceController> ("QGroundControl.Vehicle", 1, 0, "AirspaceController", "Reference only");
qmlRegisterUncreatableType<AirMapWeatherInformation> ("QGroundControl.Vehicle", 1, 0, "AirMapWeatherInformation", "Reference only");
#endif
qmlRegisterType<ParameterEditorController> ("QGroundControl.Controllers", 1, 0, "ParameterEditorController"); qmlRegisterType<ParameterEditorController> ("QGroundControl.Controllers", 1, 0, "ParameterEditorController");
qmlRegisterType<ESP8266ComponentController> ("QGroundControl.Controllers", 1, 0, "ESP8266ComponentController"); qmlRegisterType<ESP8266ComponentController> ("QGroundControl.Controllers", 1, 0, "ESP8266ComponentController");
......
...@@ -143,7 +143,7 @@ Vehicle::Vehicle(LinkInterface* link, ...@@ -143,7 +143,7 @@ Vehicle::Vehicle(LinkInterface* link,
, _parameterManager(NULL) , _parameterManager(NULL)
#if defined(QGC_AIRMAP_ENABLED) #if defined(QGC_AIRMAP_ENABLED)
, _airspaceController(NULL) , _airspaceController(NULL)
, _airspaceManagerPerVehicle(NULL) , _airspaceVehicleManager(NULL)
#endif #endif
, _armed(false) , _armed(false)
, _base_mode(0) , _base_mode(0)
...@@ -272,10 +272,10 @@ Vehicle::Vehicle(LinkInterface* link, ...@@ -272,10 +272,10 @@ Vehicle::Vehicle(LinkInterface* link,
_airspaceController = new AirspaceController(this); _airspaceController = new AirspaceController(this);
AirspaceManager* airspaceManager = _toolbox->airspaceManager(); AirspaceManager* airspaceManager = _toolbox->airspaceManager();
if (airspaceManager) { if (airspaceManager) {
_airspaceManagerPerVehicle = airspaceManager->instantiateVehicle(*this); _airspaceVehicleManager = airspaceManager->instantiateVehicle(*this);
if (_airspaceManagerPerVehicle) { if (_airspaceVehicleManager) {
connect(_airspaceManagerPerVehicle, &AirspaceVehicleManager::trafficUpdate, this, &Vehicle::_trafficUpdate); connect(_airspaceVehicleManager, &AirspaceVehicleManager::trafficUpdate, this, &Vehicle::_trafficUpdate);
connect(_airspaceManagerPerVehicle, &AirspaceVehicleManager::flightPermitStatusChanged, this, &Vehicle::flightPermitStatusChanged); connect(_airspaceVehicleManager, &AirspaceVehicleManager::flightPermitStatusChanged, this, &Vehicle::flightPermitStatusChanged);
} }
} }
#endif #endif
...@@ -341,7 +341,7 @@ Vehicle::Vehicle(MAV_AUTOPILOT firmwareType, ...@@ -341,7 +341,7 @@ Vehicle::Vehicle(MAV_AUTOPILOT firmwareType,
, _parameterManager(NULL) , _parameterManager(NULL)
#if defined(QGC_AIRMAP_ENABLED) #if defined(QGC_AIRMAP_ENABLED)
, _airspaceController(NULL) , _airspaceController(NULL)
, _airspaceManagerPerVehicle(NULL) , _airspaceVehicleManager(NULL)
#endif #endif
, _armed(false) , _armed(false)
, _base_mode(0) , _base_mode(0)
...@@ -477,8 +477,8 @@ Vehicle::~Vehicle() ...@@ -477,8 +477,8 @@ Vehicle::~Vehicle()
_mav = NULL; _mav = NULL;
#if defined(QGC_AIRMAP_ENABLED) #if defined(QGC_AIRMAP_ENABLED)
if (_airspaceManagerPerVehicle) { if (_airspaceVehicleManager) {
delete _airspaceManagerPerVehicle; delete _airspaceVehicleManager;
} }
#endif #endif
} }
......
...@@ -21,7 +21,8 @@ ...@@ -21,7 +21,8 @@
#include "UASMessageHandler.h" #include "UASMessageHandler.h"
#include "SettingsFact.h" #include "SettingsFact.h"
#if defined(QGC_AIRMAP_ENABLED) #if defined(QGC_AIRMAP_ENABLED)
#include <AirspaceManagement.h> #include "AirspaceManagement.h"
#include "AirspaceVehicleManager.h"
#endif #endif
class UAS; class UAS;
...@@ -769,9 +770,9 @@ public: ...@@ -769,9 +770,9 @@ public:
#if defined(QGC_AIRMAP_ENABLED) #if defined(QGC_AIRMAP_ENABLED)
AirspaceAuthorization::PermitStatus flightPermitStatus() const AirspaceAuthorization::PermitStatus flightPermitStatus() const
{ return _airspaceManagerPerVehicle ? _airspaceManagerPerVehicle->flightPermitStatus() : AirspaceAuthorization::PermitUnknown; } { return _airspaceVehicleManager ? _airspaceVehicleManager->flightPermitStatus() : AirspaceAuthorization::PermitUnknown; }
AirspaceVehicleManager* airspaceManager() const { return _airspaceManagerPerVehicle; } AirspaceVehicleManager* airspaceManager() const { return _airspaceVehicleManager; }
#endif #endif
signals: signals:
...@@ -1065,8 +1066,8 @@ private: ...@@ -1065,8 +1066,8 @@ private:
ParameterManager* _parameterManager; ParameterManager* _parameterManager;
#if defined(QGC_AIRMAP_ENABLED) #if defined(QGC_AIRMAP_ENABLED)
AirspaceController* _airspaceController; AirspaceController* _airspaceController;
AirspaceVehicleManager* _airspaceManagerPerVehicle; AirspaceVehicleManager* _airspaceVehicleManager;
#endif #endif
bool _armed; ///< true: vehicle is armed bool _armed; ///< true: vehicle is armed
......
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