From fc74866c84073dd5f407b2ec7b6fcb85fdac0660 Mon Sep 17 00:00:00 2001 From: Gus Grubba Date: Thu, 25 Jan 2018 02:05:17 -0500 Subject: [PATCH] Some build fixes (not there yet) --- qgroundcontrol.pro | 19 ++--- src/Airmap/AirMapFlightManager.cc | 10 +++ src/Airmap/AirMapManager.cc | 1 - src/Airmap/AirMapManager.h | 3 +- src/Airmap/AirMapRestrictionManager.cc | 10 +++ src/Airmap/AirMapRestrictionManager.h | 1 + src/Airmap/AirMapRulesetsManager.cc | 10 +++ src/Airmap/AirMapSharedState.cc | 10 +++ src/Airmap/AirMapTelemetry.cc | 1 + src/Airmap/AirMapTrafficMonitor.cc | 10 +++ src/Airmap/AirMapTrafficMonitor.h | 7 +- src/Airmap/AirMapVehicleManager.cc | 11 +++ src/Airmap/AirmapWeatherInformation.cc | 13 +++ src/Airmap/AirmapWeatherInformation.h | 3 + src/AirspaceManagement/AirspaceController.cc | 4 - src/AirspaceManagement/AirspaceController.h | 3 +- src/AirspaceManagement/AirspaceManagement.cc | 28 +------ src/AirspaceManagement/AirspaceManagement.h | 34 +++----- .../AirspaceVehicleManager.cc | 79 ------------------- .../AirspaceVehicleManager.h | 1 + .../AirspaceWeatherInfoProvider.h | 1 + src/QGCApplication.cc | 8 -- src/Vehicle/Vehicle.cc | 16 ++-- src/Vehicle/Vehicle.h | 11 +-- 24 files changed, 126 insertions(+), 168 deletions(-) diff --git a/qgroundcontrol.pro b/qgroundcontrol.pro index 9be3123f4..9c9a8a25d 100644 --- a/qgroundcontrol.pro +++ b/qgroundcontrol.pro @@ -1069,8 +1069,8 @@ contains (DEFINES, QGC_AIRMAP_ENABLED) { src/AirspaceManagement/AirspaceRestriction.h \ src/AirspaceManagement/AirspaceRestrictionProvider.h \ src/AirspaceManagement/AirspaceRulesetsProvider.h \ - src/AirspaceManagement/AirspaceWeatherInfoProvider.h \ src/AirspaceManagement/AirspaceVehicleManager.h \ + src/AirspaceManagement/AirspaceWeatherInfoProvider.h \ SOURCES += \ src/AirspaceManagement/AirspaceController.cc \ @@ -1078,8 +1078,8 @@ contains (DEFINES, QGC_AIRMAP_ENABLED) { src/AirspaceManagement/AirspaceRestriction.cc \ src/AirspaceManagement/AirspaceRestrictionProvider.cc \ src/AirspaceManagement/AirspaceRulesetsProvider.cc \ - src/AirspaceManagement/AirspaceWeatherInfoProvider.cc \ src/AirspaceManagement/AirspaceVehicleManager.cc \ + src/AirspaceManagement/AirspaceWeatherInfoProvider.cc \ #-- This is the AirMap implementation of the above RESOURCES += \ @@ -1089,31 +1089,28 @@ contains (DEFINES, QGC_AIRMAP_ENABLED) { src/Airmap HEADERS += \ + src/Airmap/AirMapFlightManager.h \ src/Airmap/AirMapManager.h \ - src/Airmap/AirspaceManagement.h \ - src/Airmap/AirMapSettings.h \ - src/Airmap/AirmapWeatherInformation.h \ src/Airmap/AirMapRestrictionManager.h \ src/Airmap/AirMapRulesetsManager.h \ + src/Airmap/AirMapSettings.h \ src/Airmap/AirMapSharedState.h \ - src/Airmap/AirMapFlightManager.h \ src/Airmap/AirMapTelemetry.h \ src/Airmap/AirMapTrafficMonitor.h \ src/Airmap/AirMapVehicleManager.h \ + src/Airmap/AirmapWeatherInformation.h \ SOURCES += \ + src/Airmap/AirMapFlightManager.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/AirMapRulesetsManager.cc \ + src/Airmap/AirMapSettings.cc \ src/Airmap/AirMapSharedState.cc \ - src/Airmap/AirMapFlightManager.cc \ src/Airmap/AirMapTelemetry.cc \ src/Airmap/AirMapTrafficMonitor.cc \ src/Airmap/AirMapVehicleManager.cc \ + src/Airmap/AirmapWeatherInformation.cc \ } else { RESOURCES += \ diff --git a/src/Airmap/AirMapFlightManager.cc b/src/Airmap/AirMapFlightManager.cc index de150c4ef..5846535b3 100644 --- a/src/Airmap/AirMapFlightManager.cc +++ b/src/Airmap/AirMapFlightManager.cc @@ -1,3 +1,13 @@ +/**************************************************************************** + * + * (c) 2009-2016 QGROUNDCONTROL PROJECT + * + * 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" AirMapFlightManager::AirMapFlightManager(AirMapSharedState& shared) diff --git a/src/Airmap/AirMapManager.cc b/src/Airmap/AirMapManager.cc index 8aad039d5..3c5d0edc7 100644 --- a/src/Airmap/AirMapManager.cc +++ b/src/Airmap/AirMapManager.cc @@ -16,7 +16,6 @@ #include "AirMapTelemetry.h" #include "AirMapTrafficMonitor.h" -#include "Vehicle.h" #include "QmlObjectListModel.h" #include "JsonHelper.h" #include "SettingsManager.h" diff --git a/src/Airmap/AirMapManager.h b/src/Airmap/AirMapManager.h index 91400fb05..287914a6e 100644 --- a/src/Airmap/AirMapManager.h +++ b/src/Airmap/AirMapManager.h @@ -12,14 +12,13 @@ #include "QGCToolbox.h" #include "QGCLoggingCategory.h" #include "AirspaceManagement.h" +#include "AirMapSharedState.h" #include #include Q_DECLARE_LOGGING_CATEGORY(AirMapManagerLog) -class AirMapSharedState; - //----------------------------------------------------------------------------- /** * @class LifetimeChecker diff --git a/src/Airmap/AirMapRestrictionManager.cc b/src/Airmap/AirMapRestrictionManager.cc index d62f0c107..f3c007a57 100644 --- a/src/Airmap/AirMapRestrictionManager.cc +++ b/src/Airmap/AirMapRestrictionManager.cc @@ -1,3 +1,13 @@ +/**************************************************************************** + * + * (c) 2009-2016 QGROUNDCONTROL PROJECT + * + * 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" AirMapRestrictionManager::AirMapRestrictionManager(AirMapSharedState& shared) diff --git a/src/Airmap/AirMapRestrictionManager.h b/src/Airmap/AirMapRestrictionManager.h index 02f4324cb..0c96b3130 100644 --- a/src/Airmap/AirMapRestrictionManager.h +++ b/src/Airmap/AirMapRestrictionManager.h @@ -10,6 +10,7 @@ #pragma once #include +#include "AirMapManager.h" #include "AirspaceRestrictionProvider.h" /** diff --git a/src/Airmap/AirMapRulesetsManager.cc b/src/Airmap/AirMapRulesetsManager.cc index 90fe39d7d..6f67a0c35 100644 --- a/src/Airmap/AirMapRulesetsManager.cc +++ b/src/Airmap/AirMapRulesetsManager.cc @@ -1,3 +1,13 @@ +/**************************************************************************** + * + * (c) 2009-2016 QGROUNDCONTROL PROJECT + * + * 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" //----------------------------------------------------------------------------- diff --git a/src/Airmap/AirMapSharedState.cc b/src/Airmap/AirMapSharedState.cc index 03addb65b..f10cd924a 100644 --- a/src/Airmap/AirMapSharedState.cc +++ b/src/Airmap/AirMapSharedState.cc @@ -1,3 +1,13 @@ +/**************************************************************************** + * + * (c) 2009-2016 QGROUNDCONTROL PROJECT + * + * 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" void diff --git a/src/Airmap/AirMapTelemetry.cc b/src/Airmap/AirMapTelemetry.cc index aa0047ebf..7c15027b3 100644 --- a/src/Airmap/AirMapTelemetry.cc +++ b/src/Airmap/AirMapTelemetry.cc @@ -7,6 +7,7 @@ * ****************************************************************************/ +#include "AirMapManager.h" #include "AirMapTelemetry.h" AirMapTelemetry::AirMapTelemetry(AirMapSharedState& shared) diff --git a/src/Airmap/AirMapTrafficMonitor.cc b/src/Airmap/AirMapTrafficMonitor.cc index e5bd9d2fe..e990d383f 100644 --- a/src/Airmap/AirMapTrafficMonitor.cc +++ b/src/Airmap/AirMapTrafficMonitor.cc @@ -1,3 +1,13 @@ +/**************************************************************************** + * + * (c) 2009-2016 QGROUNDCONTROL PROJECT + * + * 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" AirMapTrafficMonitor::~AirMapTrafficMonitor() diff --git a/src/Airmap/AirMapTrafficMonitor.h b/src/Airmap/AirMapTrafficMonitor.h index a4bba5ee2..c2e29d4ef 100644 --- a/src/Airmap/AirMapTrafficMonitor.h +++ b/src/Airmap/AirMapTrafficMonitor.h @@ -10,6 +10,7 @@ #pragma once #include +#include "AirMapManager.h" /** * @class AirMapTrafficMonitor @@ -31,11 +32,11 @@ public: void stop(); signals: - void error(const QString& what, const QString& airmapdMessage, const QString& airmapdDetails); - void trafficUpdate(QString traffic_id, QString vehicle_id, QGeoCoordinate location, float heading); + void error (const QString& what, const QString& airmapdMessage, const QString& airmapdDetails); + void trafficUpdate (QString traffic_id, QString vehicle_id, QGeoCoordinate location, float heading); private: - void _update(airmap::Traffic::Update::Type type, const std::vector& update); + void _update (airmap::Traffic::Update::Type type, const std::vector& update); private: QString _flightID; diff --git a/src/Airmap/AirMapVehicleManager.cc b/src/Airmap/AirMapVehicleManager.cc index 1798a5578..44deb7b71 100644 --- a/src/Airmap/AirMapVehicleManager.cc +++ b/src/Airmap/AirMapVehicleManager.cc @@ -1,9 +1,20 @@ +/**************************************************************************** + * + * (c) 2009-2016 QGROUNDCONTROL PROJECT + * + * 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 "AirMapFlightManager.h" #include "AirMapTelemetry.h" #include "AirMapTrafficMonitor.h" +#include "Vehicle.h" + AirMapVehicleManager::AirMapVehicleManager(AirMapSharedState& shared, const Vehicle& vehicle, QGCToolbox& toolbox) : AirspaceVehicleManager(vehicle) , _shared(shared) diff --git a/src/Airmap/AirmapWeatherInformation.cc b/src/Airmap/AirmapWeatherInformation.cc index d6ece709a..bcc7aef5b 100644 --- a/src/Airmap/AirmapWeatherInformation.cc +++ b/src/Airmap/AirmapWeatherInformation.cc @@ -1,5 +1,18 @@ +/**************************************************************************** + * + * (c) 2009-2016 QGROUNDCONTROL PROJECT + * + * 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" +#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) : QObject(parent) , _valid(false) diff --git a/src/Airmap/AirmapWeatherInformation.h b/src/Airmap/AirmapWeatherInformation.h index 966dc748e..0973de7f7 100644 --- a/src/Airmap/AirmapWeatherInformation.h +++ b/src/Airmap/AirmapWeatherInformation.h @@ -11,6 +11,9 @@ #include #include +#include + +#include "AirMapManager.h" #include "AirspaceWeatherInfoProvider.h" /** diff --git a/src/AirspaceManagement/AirspaceController.cc b/src/AirspaceManagement/AirspaceController.cc index 5e302d33f..d30ca3c55 100644 --- a/src/AirspaceManagement/AirspaceController.cc +++ b/src/AirspaceManagement/AirspaceController.cc @@ -13,14 +13,10 @@ #include "QGCApplication.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) : QObject(parent) , _manager(qgcApp()->toolbox()->airspaceManager()) { - connect(_manager, &AirspaceManager::weatherUpdate, this, &AirspaceController::_weatherUpdate); } void AirspaceController::setROI(QGeoCoordinate center, double radius) diff --git a/src/AirspaceManagement/AirspaceController.h b/src/AirspaceManagement/AirspaceController.h index d645010cf..0baf3582f 100644 --- a/src/AirspaceManagement/AirspaceController.h +++ b/src/AirspaceManagement/AirspaceController.h @@ -10,8 +10,9 @@ #pragma once #include "AirspaceManagement.h" -#include "QGCMapPolygon.h" #include "AirmapWeatherInformation.h" +#include "QmlObjectListModel.h" +#include "QGCMapPolygon.h" class AirspaceController : public QObject { diff --git a/src/AirspaceManagement/AirspaceManagement.cc b/src/AirspaceManagement/AirspaceManagement.cc index b79b559fa..cdb66627a 100644 --- a/src/AirspaceManagement/AirspaceManagement.cc +++ b/src/AirspaceManagement/AirspaceManagement.cc @@ -9,7 +9,6 @@ #include "AirspaceManagement.h" -#include QGC_LOGGING_CATEGORY(AirspaceManagementLog, "AirspaceManagementLog") @@ -19,7 +18,9 @@ AirspaceManager::AirspaceManager(QGCApplication* app, QGCToolbox* toolbox) _roiUpdateTimer.setInterval(2000); _roiUpdateTimer.setSingleShot(true); connect(&_roiUpdateTimer, &QTimer::timeout, this, &AirspaceManager::_updateToROI); - qmlRegisterUncreatableType("QGroundControl", 1, 0, "AirspaceAuthorization", "Reference only"); + qmlRegisterUncreatableType ("QGroundControl", 1, 0, "AirspaceAuthorization", "Reference only"); + qmlRegisterUncreatableType ("QGroundControl.Vehicle", 1, 0, "AirspaceController", "Reference only"); + qmlRegisterUncreatableType ("QGroundControl.Vehicle", 1, 0, "AirspaceWeatherInfoProvider","Reference only"); } AirspaceManager::~AirspaceManager() @@ -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(); - } - } -} - diff --git a/src/AirspaceManagement/AirspaceManagement.h b/src/AirspaceManagement/AirspaceManagement.h index 880331505..01407c148 100644 --- a/src/AirspaceManagement/AirspaceManagement.h +++ b/src/AirspaceManagement/AirspaceManagement.h @@ -23,19 +23,26 @@ * 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 "MissionItem.h" +#include "QGCLoggingCategory.h" +#include "QmlObjectListModel.h" +#include "Vehicle.h" +#include #include #include #include +#include -#include Q_DECLARE_LOGGING_CATEGORY(AirspaceManagementLog) -class AirMapWeatherInformation; - //----------------------------------------------------------------------------- /** * Contains the status of the Airspace authorization @@ -49,15 +56,9 @@ public: PermitAccepted, PermitRejected, }; - Q_ENUMS(PermitStatus); + Q_ENUM(PermitStatus) }; -class AirspaceRestrictionProvider; -class AirspaceRulesetsProvider; -class AirspaceVehicleManager; -class AirspaceWeatherInfoProvider; -class Vehicle; - //----------------------------------------------------------------------------- /** * @class AirspaceManager @@ -104,16 +105,7 @@ public: /** * Name of the airspace management provider (used in the UI) */ - 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); + virtual QString name () const = 0; protected slots: virtual void _rulessetsUpdated (bool success); diff --git a/src/AirspaceManagement/AirspaceVehicleManager.cc b/src/AirspaceManagement/AirspaceVehicleManager.cc index 9c91e2d13..cdd5ae4e8 100644 --- a/src/AirspaceManagement/AirspaceVehicleManager.cc +++ b/src/AirspaceManagement/AirspaceVehicleManager.cc @@ -11,85 +11,6 @@ #include "AirspaceManagement.h" #include -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("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) : _vehicle(vehicle) { diff --git a/src/AirspaceManagement/AirspaceVehicleManager.h b/src/AirspaceManagement/AirspaceVehicleManager.h index b7f39bb15..36a5799f5 100644 --- a/src/AirspaceManagement/AirspaceVehicleManager.h +++ b/src/AirspaceManagement/AirspaceVehicleManager.h @@ -10,6 +10,7 @@ #pragma once #include +#include "MissionItem.h" class Vehicle; diff --git a/src/AirspaceManagement/AirspaceWeatherInfoProvider.h b/src/AirspaceManagement/AirspaceWeatherInfoProvider.h index ac9c6c0f7..a8f99bf0a 100644 --- a/src/AirspaceManagement/AirspaceWeatherInfoProvider.h +++ b/src/AirspaceManagement/AirspaceWeatherInfoProvider.h @@ -15,6 +15,7 @@ */ #include +#include class AirspaceWeatherInfoProvider : public QObject { diff --git a/src/QGCApplication.cc b/src/QGCApplication.cc index 9d55677d0..9dbfcd0fe 100644 --- a/src/QGCApplication.cc +++ b/src/QGCApplication.cc @@ -84,10 +84,6 @@ #include "CameraCalc.h" #include "VisualMissionItem.h" #include "EditPositionDialogController.h" -#if defined(QGC_AIRMAP_ENABLED) -#include "AirspaceController.h" -#include "AirmapWeatherInformation.h" -#endif #ifndef NO_SERIAL_LINK #include "SerialLink.h" #endif @@ -384,10 +380,6 @@ void QGCApplication::_initCommon(void) qmlRegisterUncreatableType ("QGroundControl.Controllers", 1, 0, "GeoFenceController", "Reference only"); qmlRegisterUncreatableType("QGroundControl.Controllers", 1, 0, "RallyPointController", "Reference only"); qmlRegisterUncreatableType ("QGroundControl.Controllers", 1, 0, "VisualMissionItem", "Reference only"); -#if defined(QGC_AIRMAP_ENABLED) - qmlRegisterUncreatableType ("QGroundControl.Vehicle", 1, 0, "AirspaceController", "Reference only"); - qmlRegisterUncreatableType ("QGroundControl.Vehicle", 1, 0, "AirMapWeatherInformation", "Reference only"); -#endif qmlRegisterType ("QGroundControl.Controllers", 1, 0, "ParameterEditorController"); qmlRegisterType ("QGroundControl.Controllers", 1, 0, "ESP8266ComponentController"); diff --git a/src/Vehicle/Vehicle.cc b/src/Vehicle/Vehicle.cc index 1b9e8a0c1..d4ab591a9 100644 --- a/src/Vehicle/Vehicle.cc +++ b/src/Vehicle/Vehicle.cc @@ -143,7 +143,7 @@ Vehicle::Vehicle(LinkInterface* link, , _parameterManager(NULL) #if defined(QGC_AIRMAP_ENABLED) , _airspaceController(NULL) - , _airspaceManagerPerVehicle(NULL) + , _airspaceVehicleManager(NULL) #endif , _armed(false) , _base_mode(0) @@ -272,10 +272,10 @@ Vehicle::Vehicle(LinkInterface* link, _airspaceController = new AirspaceController(this); AirspaceManager* airspaceManager = _toolbox->airspaceManager(); if (airspaceManager) { - _airspaceManagerPerVehicle = airspaceManager->instantiateVehicle(*this); - if (_airspaceManagerPerVehicle) { - connect(_airspaceManagerPerVehicle, &AirspaceVehicleManager::trafficUpdate, this, &Vehicle::_trafficUpdate); - connect(_airspaceManagerPerVehicle, &AirspaceVehicleManager::flightPermitStatusChanged, this, &Vehicle::flightPermitStatusChanged); + _airspaceVehicleManager = airspaceManager->instantiateVehicle(*this); + if (_airspaceVehicleManager) { + connect(_airspaceVehicleManager, &AirspaceVehicleManager::trafficUpdate, this, &Vehicle::_trafficUpdate); + connect(_airspaceVehicleManager, &AirspaceVehicleManager::flightPermitStatusChanged, this, &Vehicle::flightPermitStatusChanged); } } #endif @@ -341,7 +341,7 @@ Vehicle::Vehicle(MAV_AUTOPILOT firmwareType, , _parameterManager(NULL) #if defined(QGC_AIRMAP_ENABLED) , _airspaceController(NULL) - , _airspaceManagerPerVehicle(NULL) + , _airspaceVehicleManager(NULL) #endif , _armed(false) , _base_mode(0) @@ -477,8 +477,8 @@ Vehicle::~Vehicle() _mav = NULL; #if defined(QGC_AIRMAP_ENABLED) - if (_airspaceManagerPerVehicle) { - delete _airspaceManagerPerVehicle; + if (_airspaceVehicleManager) { + delete _airspaceVehicleManager; } #endif } diff --git a/src/Vehicle/Vehicle.h b/src/Vehicle/Vehicle.h index 4becf692d..7a43e7c79 100644 --- a/src/Vehicle/Vehicle.h +++ b/src/Vehicle/Vehicle.h @@ -21,7 +21,8 @@ #include "UASMessageHandler.h" #include "SettingsFact.h" #if defined(QGC_AIRMAP_ENABLED) -#include +#include "AirspaceManagement.h" +#include "AirspaceVehicleManager.h" #endif class UAS; @@ -769,9 +770,9 @@ public: #if defined(QGC_AIRMAP_ENABLED) 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 signals: @@ -1065,8 +1066,8 @@ private: ParameterManager* _parameterManager; #if defined(QGC_AIRMAP_ENABLED) - AirspaceController* _airspaceController; - AirspaceVehicleManager* _airspaceManagerPerVehicle; + AirspaceController* _airspaceController; + AirspaceVehicleManager* _airspaceVehicleManager; #endif bool _armed; ///< true: vehicle is armed -- 2.22.0