|
Enroute Flight Navigation
A navigation app for VFR pilots
|
Central Position Provider. More...
#include <PositionProvider.h>
Public Member Functions | |
| PositionProvider (QObject *parent=nullptr) | |
| Standard constructor. | |
| ~PositionProvider () override | |
| Standard destructor. | |
| QGeoCoordinate | approximateLastValidCoordinate () const |
| Getter function for the property with the same name. | |
| QBindable< QGeoCoordinate > | bindableApproximateLastValidCoordinate () const |
| Getter function for the property with the same name. | |
| QString | icon () const |
| Getter function for the property with the same name. | |
| QBindable< QString > | bindableIcon () const |
| Getter function for the property with the same name. | |
| QBindable< QGeoCoordinate > | bindableLastValidCoordinate () |
| Getter function for the property with the same name. | |
| QBindable< Units::Angle > | bindableLastValidTT () |
| Getter function for the property with the same name. | |
| QGeoCoordinate | mapCenter () const |
| Getter function for the property with the same name. | |
| QBindable< QGeoCoordinate > | bindableMapCenter () |
| Getter function for the property with the same name. | |
| void | setMapCenter (const QGeoCoordinate &newMapCenter) |
| Setter function for the property with the same name. | |
| Positioning::PositionInfo | positionInfo () const |
| Getter method for property with the same name. | |
| QBindable< Positioning::PositionInfo > | bindablePositionInfo () const |
| Getter method for property with the same name. | |
| Units::Distance | pressureAltitude () const |
| Getter method for property with the same name. | |
| QBindable< Units::Distance > | bindablePressureAltitude () const |
| Getter method for property with the same name. | |
| bool | pressureAltitudeImplausible () const |
| Getter method for property with the same name. | |
| QBindable< bool > | bindablePressureAltitudeImplausible () const |
| Getter method for property with the same name. | |
| bool | receivingPositionInfo () const |
| Getter method for property with the same name. | |
| QBindable< bool > | bindableReceivingPositionInfo () |
| Getter method for property with the same name. | |
| QString | statusString () const |
| Getter method for property with the same name. | |
| QBindable< QString > | bindableStatusString () const |
| Getter method for property with the same name. | |
| Q_INVOKABLE void | startUpdates () |
| startUpdates | |
| Q_INVOKABLE void | setBackgroundUpdates (const QString &caller, bool enable) |
| Request or release background location updates (iOS only). | |
Static Public Member Functions | |
| static QGeoCoordinate | lastValidCoordinate () |
| Getter function for the property with the same name. | |
| static Units::Angle | lastValidTT () |
| Getter function for the property with the same name. | |
Static Public Attributes | |
| static constexpr Units::Distance | pressureAltitudeImplausibleThreshold = Units::Distance::fromFT(5000.0) |
| Threshold for the pressure altitude plausibility check. | |
Properties | |
| QGeoCoordinate | approximateLastValidCoordinate |
| Approximate last valid coordinate. | |
| QString | icon |
| Ownship icon. | |
| QGeoCoordinate | lastValidCoordinate |
| Last valid coordinate reading. | |
| QGeoCoordinate | mapCenter |
| Map center coordinate. | |
| Units::Angle | lastValidTT |
| Last valid true track. | |
| Positioning::PositionInfo | positionInfo |
| Position information. | |
| Units::Distance | pressureAltitude |
| Pressure altitude. | |
| bool | pressureAltitudeImplausible |
| Indicator that pressure altitude and geometric altitude are inconsistent. | |
| bool | receivingPositionInfo |
| Indicator that position information is being received. | |
| QString | statusString |
| Source status. | |
Central Position Provider.
This class collects position data from the various sources (satellite, network, traffic receiver, …) chooses the best available source and exposes the data to QML and other parts of the program.
There exists one static instance of this class, which can be accessed via the method globalInstance(). No other instance of this class should be used.
Data from the standard operating system data source (typically: satnav or wifi) is only provided after startUpdates() has been called.
The methods in this class are reentrant, but not thread safe.
Definition at line 50 of file PositionProvider.h.
|
explicit |
Standard constructor.
| parent | The standard QObject parent pointer |
|
inlinenodiscard |
Getter function for the property with the same name.
Definition at line 187 of file PositionProvider.h.
|
inlinenodiscard |
Getter function for the property with the same name.
Definition at line 193 of file PositionProvider.h.
|
inlinenodiscard |
Getter function for the property with the same name.
Definition at line 205 of file PositionProvider.h.
|
inlinenodiscard |
Getter function for the property with the same name.
Definition at line 217 of file PositionProvider.h.
|
inlinenodiscard |
Getter function for the property with the same name.
Definition at line 229 of file PositionProvider.h.
|
inlinenodiscard |
Getter function for the property with the same name.
Definition at line 241 of file PositionProvider.h.
|
inlinenodiscard |
Getter method for property with the same name.
Definition at line 259 of file PositionProvider.h.
|
inlinenodiscard |
Getter method for property with the same name.
Definition at line 271 of file PositionProvider.h.
|
inlinenodiscard |
Getter method for property with the same name.
Definition at line 283 of file PositionProvider.h.
|
inlinenodiscard |
Getter method for property with the same name.
Definition at line 295 of file PositionProvider.h.
|
inlinenodiscard |
Getter method for property with the same name.
Definition at line 307 of file PositionProvider.h.
|
inlinenodiscard |
Getter function for the property with the same name.
Definition at line 199 of file PositionProvider.h.
|
staticnodiscard |
Getter function for the property with the same name.
|
staticnodiscard |
Getter function for the property with the same name.
|
inlinenodiscard |
Getter function for the property with the same name.
Definition at line 235 of file PositionProvider.h.
|
inlinenodiscard |
Getter method for property with the same name.
Definition at line 253 of file PositionProvider.h.
|
inlinenodiscard |
Getter method for property with the same name.
Definition at line 265 of file PositionProvider.h.
|
inlinenodiscard |
Getter method for property with the same name.
Definition at line 277 of file PositionProvider.h.
|
inlinenodiscard |
Getter method for property with the same name.
Definition at line 289 of file PositionProvider.h.
| Q_INVOKABLE void Positioning::PositionProvider::setBackgroundUpdates | ( | const QString & | caller, |
| bool | enable ) |
Request or release background location updates (iOS only).
Multiple components can independently request background location. Background GPS activates when at least one caller is registered, and deactivates when all callers have released it. On non-iOS platforms this is a no-op.
| caller | Unique identifier of the requesting component, e.g. "flightlog" |
| enable | true = request background updates, false = release them |
|
inline |
Setter function for the property with the same name.
| newMapCenter | New map center coordinate |
Definition at line 247 of file PositionProvider.h.
|
inline |
startUpdates
Requests permissions if necessary and starts to provide data from the standard operating system data source (typically SatNav or WiFi) if permissions were granted.
Definition at line 333 of file PositionProvider.h.
|
inlinenodiscard |
Getter method for property with the same name.
Definition at line 301 of file PositionProvider.h.
|
staticconstexpr |
Threshold for the pressure altitude plausibility check.
If pressure altitude and geometric altitude differ by more than this value, then the pair is considered physically implausible; see the documentation of the property pressureAltitudeImplausible.
Definition at line 320 of file PositionProvider.h.
|
read |
Approximate last valid coordinate.
This property equals lastValidCoordinate, except that it is updated only every ten kilometers.
Definition at line 87 of file PositionProvider.h.
|
read |
Ownship icon.
This property holds the URL of the icon that depicts the own position on the moving map and in the lateral view. The icon shape depends on the quality of the current position info (position and true track available or not), and its colors are adapted to night mode.
Definition at line 96 of file PositionProvider.h.
|
read |
Last valid coordinate reading.
This property holds the last valid coordinate known. At the first start, this property is set to the location Freiburg Airport, EDTF. The value is stored in a QSetting at destruction, and restored in the construction.
Definition at line 105 of file PositionProvider.h.
|
read |
Last valid true track.
This property holds the last valid true track known. At the first start, this property is set to 0°. The value is stored in a QSetting at destruction, and restored in the construction.
Definition at line 122 of file PositionProvider.h.
|
readwrite |
Map center coordinate.
This property holds the current center coordinate of the flight map. It should be set from QML whenever the map center changes. This allows C++ code to use the map center for distance calculations when GPS position is unavailable.
Definition at line 114 of file PositionProvider.h.
|
read |
Position information.
This property holds information about the device position. To ensure that the data is up-to-date, the position information will be set to an invalid positionInfo when no data has arrived for more than the time specified in PositionInfo::lifetime.
Definition at line 131 of file PositionProvider.h.
|
read |
Pressure altitude.
This property holds information about the pressure altitude. If the traffic data provider provides pressure altitude, then this is reported here. If the traffic data provider does not report pressure altitude AND the current aircraft is configured to use cabin pressure for pressure altitude, then cabin pressure is reported here.
Definition at line 141 of file PositionProvider.h.
|
read |
Indicator that pressure altitude and geometric altitude are inconsistent.
This property is true if pressure altitude and geometric altitude have been differing by unrealistic amounts for a while. This typically happens when the pressure sensor does not measure static pressure, because the device rides in a pressurized cabin, or because the app receives position data from a flight simulator while the device sensor measures the air pressure at the user's desk. If this property is true, then barometric altitude data should not be trusted.
Realistic atmospheric conditions (extremely low QNH together with extreme temperature deviation from ISA) account for differences of no more than about 4,000 ft. To warn, this class requires a difference of more than 5,000 ft, persisting over 30 seconds. The warning clears as soon as the difference drops below 3,000 ft, or as soon as one of the two altitudes becomes unavailable.
Definition at line 160 of file PositionProvider.h.
|
read |
Indicator that position information is being received.
This is a shortcut for positionInfo().isValid. This property exists because it does not change so often, and can thus be more efficient to use.
Definition at line 168 of file PositionProvider.h.
|
read |
Source status.
This property holds a translated, human-readable string that describes the status of the positionInfo source. This could typically be a string of the form "OK" or "Insufficient permission to access position info"
Definition at line 176 of file PositionProvider.h.