QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
RallyPoint.h
Go to the documentation of this file.
1#pragma once
2
3#include <QtCore/QObject>
4#include <QtPositioning/QGeoCoordinate>
5
6#include "Fact.h"
7
10
11class RallyPoint : public QObject
12{
13 Q_OBJECT
14
15public:
16 RallyPoint(const QGeoCoordinate& coordinate, QObject* parent = nullptr);
17 RallyPoint(const RallyPoint& other, QObject* parent = nullptr);
18
20
21 const RallyPoint& operator=(const RallyPoint& other);
22
23 Q_PROPERTY(QGeoCoordinate coordinate READ coordinate WRITE setCoordinate NOTIFY coordinateChanged)
24 Q_PROPERTY(bool dirty READ dirty WRITE setDirty NOTIFY dirtyChanged)
25 Q_PROPERTY(QVariantList textFieldFacts MEMBER _textFieldFacts CONSTANT)
26
27 QGeoCoordinate coordinate(void) const;
28 void setCoordinate(const QGeoCoordinate& coordinate);
29
30 bool dirty(void) const { return _dirty; }
31 void setDirty(bool dirty);
32
33 static double getDefaultFactAltitude();
34
35signals:
36 void coordinateChanged (const QGeoCoordinate& coordinate);
37 void dirtyChanged (bool dirty);
38
39private slots:
40 void _sendCoordinateChanged(void);
41
42private:
43 void _factSetup(void);
44 static void _cacheFactMetadata();
45
46 bool _dirty;
47 Fact _longitudeFact;
48 Fact _latitudeFact;
49 Fact _altitudeFact;
50
51 QVariantList _textFieldFacts;
52
53 static QMap<QString, FactMetaData*> _metaDataMap;
54
55 static constexpr const char* _longitudeFactName = "Longitude";
56 static constexpr const char* _latitudeFactName = "Latitude";
57 static constexpr const char* _altitudeFactName = "RelativeAltitude";
58};
A Fact is used to hold a single value within the system.
Definition Fact.h:17
This class is used to encapsulate the QGeoCoordinate associated with a Rally Point into a QObject suc...
Definition RallyPoint.h:12
QGeoCoordinate coordinate(void) const
Definition RallyPoint.cc:98
void setCoordinate(const QGeoCoordinate &coordinate)
Definition RallyPoint.cc:70
static double getDefaultFactAltitude()
Definition RallyPoint.cc:89
const RallyPoint & operator=(const RallyPoint &other)
Definition RallyPoint.cc:31
void dirtyChanged(bool dirty)
bool dirty(void) const
Definition RallyPoint.h:30
void coordinateChanged(const QGeoCoordinate &coordinate)
void setDirty(bool dirty)
Definition RallyPoint.cc:81