QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
GeoFenceManager.h
Go to the documentation of this file.
1#pragma once
2
3#include <QtCore/QObject>
4#include <QtPositioning/QGeoCoordinate>
5#include "QGCFencePolygon.h"
6#include "QGCFenceCircle.h"
7#include "PlanManager.h"
8
9class Vehicle;
11
15
17{
18 Q_OBJECT
19
20public:
21 GeoFenceManager(Vehicle* vehicle);
23
24 bool supported(void) const;
25
27 void sendToVehicle(const QGeoCoordinate& breachReturn,
30
32 void removeAll(void);
33
36 bool polygonEnabled(void) const { return true; }
37
38 const QList<QGCFencePolygon>& polygons(void) { return _polygons; }
39 const QList<QGCFenceCircle>& circles(void) { return _circles; }
40 const QGeoCoordinate& breachReturnPoint(void) const { return _breachReturnPoint; }
41
52
53signals:
54 void loadComplete (void);
56 void error (int errorCode, const QString& errorMsg);
58 void sendComplete (bool error);
59
60private slots:
61 void _sendComplete (bool error);
62 void _planManagerLoadComplete (bool removeAllRequested);
63
64private:
65 void _sendError(ErrorCode_t errorCode, const QString& errorMsg);
66
67 QList<QGCFencePolygon> _polygons;
68 QList<QGCFenceCircle> _circles;
69 QGeoCoordinate _breachReturnPoint;
70 bool _firstParamLoadComplete = false;
71 QList<QGCFencePolygon> _sendPolygons;
72 QList<QGCFenceCircle> _sendCircles;
73};
Error error
This is the base class for firmware specific geofence managers.
void removeAll(void)
Signals removeAllComplete when done.
void sendToVehicle(const QGeoCoordinate &breachReturn, QmlObjectListModel &polygons, QmlObjectListModel &circles)
Signals sendComplete when done.
void error(int errorCode, const QString &errorMsg)
void inProgressChanged(bool inProgress)
const QGeoCoordinate & breachReturnPoint(void) const
const QList< QGCFencePolygon > & polygons(void)
ErrorCode_t
Error codes returned in error signal.
@ BadPolygonItemFormat
Error re-creating polygons from mission items.
@ UnsupportedCommand
Usupported command in mission type.
@ PolygonTooManyPoints
Too many points for valid fence polygon.
@ PolygonTooFewPoints
Too few points for valid fence polygon.
@ IncompletePolygonLoad
Incomplete polygon loaded.
void loadComplete(void)
bool supported(void) const
void removeAllComplete(bool error)
void sendComplete(bool error)
bool polygonEnabled(void) const
const QList< QGCFenceCircle > & circles(void)
The PlanManager class is the base class for the Mission, GeoFence and Rally Point managers....
Definition PlanManager.h:14
bool inProgress(void) const