|
QGroundControl
Ground Control Station for MAVLink Drones
|
#include <GeoFenceController.h>
Inheritance diagram for GeoFenceController:
Collaboration diagram for GeoFenceController:Signals | |
| void | breachReturnPointChanged (QGeoCoordinate breachReturnPoint) |
| void | editorQmlChanged (QString editorQml) |
| void | loadComplete (void) |
| void | paramCircularFenceChanged (void) |
Signals inherited from PlanElementController | |
| void | supportedChanged (bool supported) |
| void | containsItemsChanged () |
| void | syncInProgressChanged (bool syncInProgress) |
| void | dirtyChanged (bool dirty) |
| void | sendComplete (void) |
| void | removeAllComplete (void) |
Public Member Functions | |
| GeoFenceController (PlanMasterController *masterController, QObject *parent=nullptr) | |
| ~GeoFenceController () | |
| Q_INVOKABLE void | addInclusionPolygon (QGeoCoordinate topLeft, QGeoCoordinate bottomRight) |
| Q_INVOKABLE void | addInclusionCircle (QGeoCoordinate topLeft, QGeoCoordinate bottomRight) |
| Q_INVOKABLE void | deletePolygon (int index) |
| Q_INVOKABLE void | deleteCircle (int index) |
| Q_INVOKABLE void | clearAllInteractive (void) |
| Clears the interactive bit from all fence items. | |
| double | paramCircularFence (void) |
| Fact * | breachReturnAltitude (void) |
| bool | supported (void) const final |
| true: controller is waiting for the current load to complete | |
| void | start (bool flyView) final |
| Should be called immediately upon Component.onCompleted. | |
| void | save (QJsonObject &json) final |
| bool | load (const QJsonObject &json, QString &errorString) final |
| void | loadFromVehicle (void) final |
| void | sendToVehicle (void) final |
| void | removeAll (void) final |
| Removes all from controller only. | |
| void | removeAllFromVehicle (void) final |
| bool | syncInProgress (void) const final |
| bool | dirty (void) const final |
| void | setDirty (bool dirty) final |
| bool | containsItems (void) const final |
| bool | showPlanFromManagerVehicle (void) final |
| QmlObjectListModel * | polygons (void) |
| QmlObjectListModel * | circles (void) |
| QGeoCoordinate | breachReturnPoint (void) const |
| void | setBreachReturnPoint (const QGeoCoordinate &breachReturnPoint) |
| bool | isEmpty (void) const |
Public Member Functions inherited from PlanElementController | |
| PlanElementController (PlanMasterController *masterController, QObject *parent=nullptr) | |
| ~PlanElementController () | |
| true: unsaved/sent changes are present, false: no changes since last save/send | |
| PlanMasterController * | masterController (void) |
Additional Inherited Members | |
Protected Attributes inherited from PlanElementController | |
| PlanMasterController * | _masterController |
| bool | _flyView |
Definition at line 15 of file GeoFenceController.h.
| GeoFenceController::GeoFenceController | ( | PlanMasterController * | masterController, |
| QObject * | parent = nullptr |
||
| ) |
Definition at line 21 of file GeoFenceController.cc.
References breachReturnPointChanged(), PlanElementController::containsItemsChanged(), ObjectItemModelBase::countChanged(), FactMetaData::createMapFromJsonFile(), ObjectItemModelBase::dirtyChanged(), and Fact::rawValueChanged().
| GeoFenceController::~GeoFenceController | ( | ) |
Definition at line 44 of file GeoFenceController.cc.
| void GeoFenceController::addInclusionCircle | ( | QGeoCoordinate | topLeft, |
| QGeoCoordinate | bottomRight | ||
| ) |
Add a new inclusion circle to the fence
| topLeft | Top left coordinate or map viewport |
| bottomRight | Bottom right left coordinate or map viewport |
Definition at line 416 of file GeoFenceController.cc.
References QmlObjectListModel::append(), clearAllInteractive(), and QGCMapCircle::setInteractive().
| void GeoFenceController::addInclusionPolygon | ( | QGeoCoordinate | topLeft, |
| QGeoCoordinate | bottomRight | ||
| ) |
Add a new inclusion polygon to the fence
| topLeft | Top left coordinate or map viewport |
| bottomRight | Bottom right left coordinate or map viewport |
Definition at line 383 of file GeoFenceController.cc.
References QmlObjectListModel::append(), QGCMapPolygon::appendVertex(), clearAllInteractive(), and QGCMapPolygon::setInteractive().
|
inline |
Definition at line 57 of file GeoFenceController.h.
|
inline |
Definition at line 76 of file GeoFenceController.h.
Referenced by setBreachReturnPoint().
|
signal |
Referenced by GeoFenceController(), load(), and setBreachReturnPoint().
|
inline |
Definition at line 75 of file GeoFenceController.h.
| void GeoFenceController::clearAllInteractive | ( | void | ) |
Clears the interactive bit from all fence items.
Definition at line 457 of file GeoFenceController.cc.
References QmlObjectListModel::count(), and QmlObjectListModel::value().
Referenced by addInclusionCircle(), and addInclusionPolygon().
|
finalvirtual |
Implements PlanElementController.
Definition at line 352 of file GeoFenceController.cc.
References QmlObjectListModel::count().
Referenced by PlanMasterController::containsItems().
| void GeoFenceController::deleteCircle | ( | int | index | ) |
Deletes the specified circle from the circle list
| index | Index of circle to delete |
Definition at line 447 of file GeoFenceController.cc.
References QmlObjectListModel::count(), and QmlObjectListModel::removeAt().
| void GeoFenceController::deletePolygon | ( | int | index | ) |
Deletes the specified polygon from the polygon list
| index | Index of polygon to delete |
Definition at line 437 of file GeoFenceController.cc.
References QmlObjectListModel::count(), and QmlObjectListModel::removeAt().
|
finalvirtual |
Implements PlanElementController.
Definition at line 257 of file GeoFenceController.cc.
Referenced by setDirty().
|
signal |
| bool GeoFenceController::isEmpty | ( | void | ) | const |
Definition at line 571 of file GeoFenceController.cc.
References QmlObjectListModel::count().
Referenced by PlanMasterController::isEmpty().
|
finalvirtual |
Implements PlanElementController.
Definition at line 107 of file GeoFenceController.cc.
References QmlObjectListModel::append(), breachReturnPointChanged(), errorString, JsonParsing::jsonVersionKey, QGCFencePolygon::loadFromJson(), QGCFenceCircle::loadFromJson(), GeoJsonHelper::loadGeoCoordinate(), removeAll(), setDirty(), Fact::setRawValue(), and JsonParsing::validateKeys().
Referenced by PlanMasterController::loadFromFile().
|
signal |
|
finalvirtual |
Implements PlanElementController.
Definition at line 227 of file GeoFenceController.cc.
References PlanElementController::_masterController, PlanManager::loadFromVehicle(), PlanMasterController::offline(), and syncInProgress().
| double GeoFenceController::paramCircularFence | ( | void | ) |
Definition at line 475 of file GeoFenceController.cc.
References Vehicle::apmFirmware(), ParameterManager::defaultComponentId, ParameterManager::getParameter(), Vehicle::isOfflineEditingVehicle(), ParameterManager::parameterExists(), Vehicle::parameterManager(), Vehicle::px4Firmware(), and Fact::rawValue().
|
signal |
|
inline |
Definition at line 74 of file GeoFenceController.h.
|
finalvirtual |
Removes all from controller only.
Implements PlanElementController.
Definition at line 209 of file GeoFenceController.cc.
References QmlObjectListModel::clearAndDeleteContents(), and setBreachReturnPoint().
Referenced by load(), and PlanMasterController::removeAll().
|
finalvirtual |
Removes all from vehicle and controller Signals removeAllComplete when done
Implements PlanElementController.
Definition at line 216 of file GeoFenceController.cc.
References PlanElementController::_masterController, PlanMasterController::offline(), GeoFenceManager::removeAll(), and syncInProgress().
Referenced by PlanMasterController::removeAllFromVehicle().
|
finalvirtual |
Implements PlanElementController.
Definition at line 178 of file GeoFenceController.cc.
References QmlObjectListModel::count(), JsonParsing::jsonVersionKey, Fact::rawValue(), GeoJsonHelper::saveGeoCoordinate(), QGCFenceCircle::saveToJson(), QGCFencePolygon::saveToJson(), and QmlObjectListModel::value().
Referenced by PlanMasterController::saveToJson().
|
finalvirtual |
Sends the current plan element to the vehicle Signals sendComplete when done
Implements PlanElementController.
Definition at line 239 of file GeoFenceController.cc.
References PlanElementController::_masterController, PlanMasterController::offline(), GeoFenceManager::sendToVehicle(), setDirty(), and syncInProgress().
| void GeoFenceController::setBreachReturnPoint | ( | const QGeoCoordinate & | breachReturnPoint | ) |
Definition at line 65 of file GeoFenceController.cc.
References breachReturnPoint(), breachReturnPointChanged(), and setDirty().
Referenced by removeAll().
|
finalvirtual |
Implements PlanElementController.
Definition at line 263 of file GeoFenceController.cc.
References QmlObjectListModel::count(), dirty(), PlanElementController::dirtyChanged(), QGCMapCircle::setDirty(), QGCMapPolygon::setDirty(), and QmlObjectListModel::value().
Referenced by load(), PlanMasterController::removeAll(), sendToVehicle(), and setBreachReturnPoint().
|
finalvirtual |
Implements PlanElementController.
Definition at line 357 of file GeoFenceController.cc.
References PlanElementController::_flyView, PlanElementController::_masterController, Vehicle::initialPlanRequestComplete(), PlanMasterController::offline(), and syncInProgress().
|
finalvirtual |
Should be called immediately upon Component.onCompleted.
Reimplemented from PlanElementController.
Definition at line 49 of file GeoFenceController.cc.
References PlanElementController::_masterController, PlanMasterController::managerVehicle(), PlanMasterController::managerVehicleChanged(), and PlanElementController::start().
Referenced by PlanMasterController::start(), and PlanMasterController::startStaticActiveVehicle().
|
finalvirtual |
true: controller is waiting for the current load to complete
Implements PlanElementController.
Definition at line 467 of file GeoFenceController.cc.
References Vehicle::capabilityBits().
Referenced by PlanMasterController::removeAllFromVehicle().
|
finalvirtual |
Implements PlanElementController.
Definition at line 252 of file GeoFenceController.cc.
References PlanManager::inProgress().
Referenced by loadFromVehicle(), removeAllFromVehicle(), sendToVehicle(), showPlanFromManagerVehicle(), and PlanMasterController::syncInProgress().