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 <QtCore/QLoggingCategory>
6
7#include "QGCFencePolygon.h"
8#include "QGCFenceCircle.h"
9#include "PlanManager.h"
10
11class Vehicle;
13
15
16
19{
21
22public:
23 GeoFenceManager(Vehicle* vehicle);
25
26 bool supported(void) const;
27
29 void sendToVehicle(const QGeoCoordinate& breachReturn,
30 QmlObjectListModel& polygons,
31 QmlObjectListModel& circles);
32
34 void removeAll(void);
35
38 bool polygonEnabled(void) const { return true; }
39
40 const QList<QGCFencePolygon>& polygons(void) { return _polygons; }
41 const QList<QGCFenceCircle>& circles(void) { return _circles; }
42 const QGeoCoordinate& breachReturnPoint(void) const { return _breachReturnPoint; }
43
54
56 void loadComplete (void);
57 void inProgressChanged (bool inProgress);
58 void error (int errorCode, const QString& errorMsg);
60 void sendComplete (bool error);
61
62private slots:
63 void _sendComplete (bool error);
64 void _planManagerLoadComplete (bool removeAllRequested);
65
66private:
67 void _sendError(ErrorCode_t errorCode, const QString& errorMsg);
68
69 QList<QGCFencePolygon> _polygons;
70 QList<QGCFenceCircle> _circles;
71 QGeoCoordinate _breachReturnPoint;
72 bool _firstParamLoadComplete = false;
73 QList<QGCFencePolygon> _sendPolygons;
74 QList<QGCFenceCircle> _sendCircles;
75};
Q_DECLARE_LOGGING_CATEGORY(AndroidSerialLog)
Error error
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)
void removeAllComplete(bool error)
void sendComplete(bool error)
bool polygonEnabled(void) const
const QList< QGCFenceCircle > & circles(void)
QModelIndex index(int row, int column=0, const QModelIndex &parent=QModelIndex()) const override