QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
RallyPointController.h
Go to the documentation of this file.
1#pragma once
2
3#include <QtPositioning/QGeoCoordinate>
4#include <QtQmlIntegration/QtQmlIntegration>
5
8
11class Vehicle;
12
14{
15 Q_OBJECT
16 QML_ELEMENT
17 QML_UNCREATABLE("")
18public:
19 explicit RallyPointController(PlanMasterController* masterController, QObject* parent = nullptr);
21
22 Q_PROPERTY(QmlObjectListModel* points READ points CONSTANT)
23 Q_PROPERTY(QString editorQml READ editorQml CONSTANT)
25
26 Q_INVOKABLE void addPoint (QGeoCoordinate point);
27 Q_INVOKABLE void removePoint (QObject* rallyPoint);
28
29 void start (bool flyView) final;
30 bool supported (void) const final;
31 void save (QJsonObject& json) final;
32 bool load (const QJsonObject& json, QString& errorString) final;
33 void loadFromVehicle (void) final;
34 void sendToVehicle (void) final;
35 void removeAll (void) final;
36 void removeAllFromVehicle (void) final;
37 bool syncInProgress (void) const final;
38 bool dirty (void) const final { return _dirty; }
39 void setDirty (bool dirty) final;
40 bool containsItems (void) const final;
41 bool showPlanFromManagerVehicle (void) final;
42
43 QmlObjectListModel* points (void) { return &_points; }
44 QString editorQml (void) const;
45 QObject* currentRallyPoint (void) const { return _currentRallyPoint; }
46
47 void setCurrentRallyPoint (QObject* rallyPoint);
48 bool isEmpty (void) const;
49
50signals:
51 void currentRallyPointChanged(QObject* rallyPoint);
52 void loadComplete(void);
53
54private slots:
55 void _managerLoadComplete (void);
56 void _managerSendComplete (bool error);
57 void _managerRemoveAllComplete (bool error);
58 void _setFirstPointCurrent (void);
59 void _managerVehicleChanged (Vehicle* managerVehicle);
60
61private:
62 Vehicle* _managerVehicle = nullptr;
63 RallyPointManager* _rallyPointManager = nullptr;
64 bool _dirty = false;
65 QmlObjectListModel _points;
66 QObject* _currentRallyPoint = nullptr;
67 bool _itemsRequested = false;
68
69 static constexpr int _jsonCurrentVersion = 2;
70 static constexpr const char* _jsonFileTypeValue = "RallyPoints";
71 static constexpr const char* _jsonPointsKey = "points";
72};
QString errorString
Error error
This is the base class for firmware specific geofence managers.
This is the abstract base clas for Plan Element controllers.
PlanMasterController * masterController(void)
Master controller for mission, fence, rally.
bool containsItems(void) const final
void save(QJsonObject &json) final
QObject * currentRallyPoint(void) const
void loadComplete(void)
Q_INVOKABLE void addPoint(QGeoCoordinate point)
bool supported(void) const final
true: controller is waiting for the current load to complete
void setDirty(bool dirty) final
QString editorQml(void) const
bool showPlanFromManagerVehicle(void) final
bool syncInProgress(void) const final
void setCurrentRallyPoint(QObject *rallyPoint)
bool dirty(void) const final
void start(bool flyView) final
Should be called immediately upon Component.onCompleted.
void removeAllFromVehicle(void) final
bool load(const QJsonObject &json, QString &errorString) final
Q_INVOKABLE void removePoint(QObject *rallyPoint)
void removeAll(void) final
Removes all from controller only.
void currentRallyPointChanged(QObject *rallyPoint)
void loadFromVehicle(void) final
QmlObjectListModel * points(void)
This is the base class for firmware specific rally point managers. A rally point manager is responsib...