Browse Source
AirspaceManager is now exposed by QGroundControlQmlGlobal instead of Vehicle (available all the time)QGC4.4
20 changed files with 187 additions and 284 deletions
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 3.7 KiB |
@ -1,60 +0,0 @@ |
|||||||
/****************************************************************************
|
|
||||||
* |
|
||||||
* (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 "AirspaceController.h" |
|
||||||
#include "AirspaceManager.h" |
|
||||||
#include "AirspaceWeatherInfoProvider.h" |
|
||||||
#include "AirspaceAdvisoryProvider.h" |
|
||||||
|
|
||||||
#include "QGCApplication.h" |
|
||||||
#include "QGCQGeoCoordinate.h" |
|
||||||
#include "QmlObjectListModel.h" |
|
||||||
|
|
||||||
AirspaceController::AirspaceController(QObject* parent) |
|
||||||
: QObject(parent) |
|
||||||
, _manager(qgcApp()->toolbox()->airspaceManager()) |
|
||||||
, _airspaceVisible(false) |
|
||||||
{ |
|
||||||
} |
|
||||||
|
|
||||||
void |
|
||||||
AirspaceController::setROI(QGeoCoordinate center, double radius) |
|
||||||
{ |
|
||||||
_manager->setROI(center, radius); |
|
||||||
} |
|
||||||
|
|
||||||
QString |
|
||||||
AirspaceController::providerName() |
|
||||||
{ |
|
||||||
return _manager->name(); |
|
||||||
} |
|
||||||
|
|
||||||
AirspaceWeatherInfoProvider* |
|
||||||
AirspaceController::weatherInfo() |
|
||||||
{ |
|
||||||
return _manager->weatherInfo(); |
|
||||||
} |
|
||||||
|
|
||||||
AirspaceAdvisoryProvider* |
|
||||||
AirspaceController::advisories() |
|
||||||
{ |
|
||||||
return _manager->advisories(); |
|
||||||
} |
|
||||||
|
|
||||||
AirspaceRulesetsProvider* |
|
||||||
AirspaceController::ruleSets() |
|
||||||
{ |
|
||||||
return _manager->ruleSets(); |
|
||||||
} |
|
||||||
|
|
||||||
AirspaceRestrictionProvider* |
|
||||||
AirspaceController::airspaces() |
|
||||||
{ |
|
||||||
return _manager->airspaces(); |
|
||||||
} |
|
@ -1,53 +0,0 @@ |
|||||||
/****************************************************************************
|
|
||||||
* |
|
||||||
* (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. |
|
||||||
* |
|
||||||
****************************************************************************/ |
|
||||||
|
|
||||||
#pragma once |
|
||||||
|
|
||||||
#include <QObject> |
|
||||||
#include <QGeoCoordinate> |
|
||||||
|
|
||||||
class AirspaceManager; |
|
||||||
class QmlObjectListModel; |
|
||||||
class AirspaceWeatherInfoProvider; |
|
||||||
class AirspaceAdvisoryProvider; |
|
||||||
class AirspaceRulesetsProvider; |
|
||||||
class AirspaceRestrictionProvider; |
|
||||||
|
|
||||||
class AirspaceController : public QObject |
|
||||||
{ |
|
||||||
Q_OBJECT |
|
||||||
public: |
|
||||||
AirspaceController(QObject* parent = NULL); |
|
||||||
~AirspaceController() = default; |
|
||||||
|
|
||||||
Q_PROPERTY(QString providerName READ providerName CONSTANT) |
|
||||||
Q_PROPERTY(AirspaceWeatherInfoProvider* weatherInfo READ weatherInfo CONSTANT) |
|
||||||
Q_PROPERTY(AirspaceAdvisoryProvider* advisories READ advisories CONSTANT) |
|
||||||
Q_PROPERTY(AirspaceRulesetsProvider* ruleSets READ ruleSets CONSTANT) |
|
||||||
Q_PROPERTY(AirspaceRestrictionProvider* airspaces READ airspaces CONSTANT) |
|
||||||
Q_PROPERTY(bool airspaceVisible READ airspaceVisible WRITE setairspaceVisible NOTIFY airspaceVisibleChanged) |
|
||||||
|
|
||||||
Q_INVOKABLE void setROI (QGeoCoordinate center, double radius); |
|
||||||
|
|
||||||
QString providerName (); |
|
||||||
AirspaceWeatherInfoProvider* weatherInfo (); |
|
||||||
AirspaceAdvisoryProvider* advisories (); |
|
||||||
AirspaceRulesetsProvider* ruleSets (); |
|
||||||
AirspaceRestrictionProvider* airspaces (); |
|
||||||
bool airspaceVisible () { return _airspaceVisible; } |
|
||||||
|
|
||||||
void setairspaceVisible (bool set) { _airspaceVisible = set; emit airspaceVisibleChanged(); } |
|
||||||
|
|
||||||
signals: |
|
||||||
void airspaceVisibleChanged (); |
|
||||||
|
|
||||||
private: |
|
||||||
AirspaceManager* _manager; |
|
||||||
bool _airspaceVisible; |
|
||||||
}; |
|
Loading…
Reference in new issue