QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
TransformPositionController.h
Go to the documentation of this file.
1#pragma once
2
3#include <QtCore/QMap>
4#include <QtCore/QObject>
5#include <QtCore/QString>
6#include <QtPositioning/QGeoCoordinate>
7#include <QtQmlIntegration/QtQmlIntegration>
8
9class Fact;
10class FactMetaData;
11
12class TransformPositionController : public QObject
13{
14 Q_OBJECT
15 QML_ELEMENT
16 Q_MOC_INCLUDE("Fact.h")
17 Q_PROPERTY(QGeoCoordinate coordinate READ coordinate WRITE setCoordinate NOTIFY coordinateChanged)
18 Q_PROPERTY(Fact *latitude READ latitude CONSTANT)
19 Q_PROPERTY(Fact *longitude READ longitude CONSTANT)
20 Q_PROPERTY(Fact *zone READ zone CONSTANT)
21 Q_PROPERTY(Fact *hemisphere READ hemisphere CONSTANT)
22 Q_PROPERTY(Fact *easting READ easting CONSTANT)
23 Q_PROPERTY(Fact *northing READ northing CONSTANT)
24 Q_PROPERTY(Fact *mgrs READ mgrs CONSTANT)
25 Q_PROPERTY(Fact *offsetEast READ offsetEast CONSTANT)
26 Q_PROPERTY(Fact *offsetNorth READ offsetNorth CONSTANT)
27 Q_PROPERTY(Fact *offsetUp READ offsetUp CONSTANT)
28 Q_PROPERTY(Fact *rotateDegreesCW READ rotateDegreesCW CONSTANT)
29
30public:
31 explicit TransformPositionController(QObject *parent = nullptr);
33
34 Q_INVOKABLE void initValues();
35 Q_INVOKABLE void setFromGeo();
36 Q_INVOKABLE void setFromUTM();
37 Q_INVOKABLE void setFromMGRS();
38 Q_INVOKABLE void setFromVehicle();
39
40 void setCoordinate(QGeoCoordinate coordinate);
41 QGeoCoordinate coordinate() const { return _coordinate; }
42
43 Fact *latitude() { return _latitudeFact; }
44 Fact *longitude() { return _longitudeFact; }
45 Fact *zone() { return _zoneFact; }
46 Fact *hemisphere() { return _hemisphereFact; }
47 Fact *easting() { return _eastingFact; }
48 Fact *northing() { return _northingFact; }
49 Fact *mgrs() { return _mgrsFact; }
50 Fact *offsetEast() { return _offsetEastFact; }
51 Fact *offsetNorth() { return _offsetNorthFact; }
52 Fact *offsetUp() { return _offsetUpFact; }
53 Fact *rotateDegreesCW() { return _rotateDegreesCWFact; }
54
55signals:
56 void coordinateChanged(QGeoCoordinate coordinate);
57
58private:
59 QGeoCoordinate _coordinate;
60
61 Fact *_latitudeFact = nullptr;
62 Fact *_longitudeFact = nullptr;
63 Fact *_zoneFact = nullptr;
64 Fact *_hemisphereFact = nullptr;
65 Fact *_eastingFact = nullptr;
66 Fact *_northingFact = nullptr;
67 Fact *_mgrsFact = nullptr;
68 Fact *_offsetEastFact = nullptr;
69 Fact *_offsetNorthFact = nullptr;
70 Fact *_offsetUpFact = nullptr;
71 Fact *_rotateDegreesCWFact = nullptr;
72
73 static QMap<QString, FactMetaData*> _metaDataMap;
74
75 static constexpr const char *_latitudeFactName = "Latitude";
76 static constexpr const char *_longitudeFactName = "Longitude";
77 static constexpr const char *_zoneFactName = "Zone";
78 static constexpr const char *_hemisphereFactName = "Hemisphere";
79 static constexpr const char *_eastingFactName = "Easting";
80 static constexpr const char *_northingFactName = "Northing";
81 static constexpr const char *_mgrsFactName = "MGRS";
82 static constexpr const char *_offsetEastFactName = "OffsetEast";
83 static constexpr const char *_offsetNorthFactName = "OffsetNorth";
84 static constexpr const char *_offsetUpFactName = "OffsetUp";
85 static constexpr const char *_rotateDegreesCWFactName = "RotateDegreesCW";
86};
A Fact is used to hold a single value within the system.
Definition Fact.h:16
void coordinateChanged(QGeoCoordinate coordinate)