Enroute Flight Navigation
A navigation app for VFR pilots
Positioning::PositionInfo Class Reference

Geographic position. More...

#include <PositionInfo.h>

Public Member Functions

 PositionInfo ()=default
 Default Constructor.
 
 PositionInfo (const QGeoPositionInfo &info, const QString &source)
 Constructor.
 
Q_INVOKABLE QGeoCoordinate coordinate () const
 Coordinate.
 
Q_INVOKABLE Units::Speed groundSpeed () const
 Ground speed.
 
Q_INVOKABLE bool isValid () const
 Validity.
 
Q_INVOKABLE Units::Distance positionErrorEstimate () const
 Position error estimate.
 
Q_INVOKABLE QString source () const
 Name of source, as set in the constructor.
 
Q_INVOKABLE Units::Distance terrainElevationAMSL ()
 Elevation of terrain at a given coordinate, above sea level.
 
Q_INVOKABLE QDateTime timestamp () const
 Timestamp.
 
Q_INVOKABLE QString timestampString () const
 Timestamp string.
 
Q_INVOKABLE Units::Distance trueAltitudeAGL ()
 True Altitude above ground level.
 
Q_INVOKABLE Units::Distance trueAltitudeAMSL () const
 True Altitude above main sea level.
 
Q_INVOKABLE Units::Distance trueAltitudeErrorEstimate () const
 True altitude error estimate.
 
Q_INVOKABLE Units::Angle trueTrack () const
 True track.
 
Q_INVOKABLE Units::Angle trueTrackErrorEstimate () const
 True track error estimate.
 
Q_INVOKABLE Units::Angle variation () const
 Magnetic variation.
 
Q_INVOKABLE Units::Speed verticalSpeed () const
 Vertical speed.
 
Q_INVOKABLE bool operator== (const Positioning::PositionInfo &rhs) const
 Comparison: equal.
 
 operator QGeoPositionInfo () const
 Conversion.
 

Static Public Attributes

static constexpr auto lifetime = 20min
 Liftetime of geographic positioning information.
 

Detailed Description

Geographic position.

This class is a thin wrapper around QGeoPositionInfo. It exports the data from QGeoPositionInfo in a way that can be read from QML. In addition to QGeoPositionInfo, the class also contains information about the pressure altitude.

Definition at line 44 of file PositionInfo.h.

Constructor & Destructor Documentation

◆ PositionInfo()

Positioning::PositionInfo::PositionInfo ( const QGeoPositionInfo & info,
const QString & source )
explicit

Constructor.

Parameters
infoQGeoPositionInfo this is copied into this class
sourceName of the source that generated with instance

Member Function Documentation

◆ coordinate()

Q_INVOKABLE QGeoCoordinate Positioning::PositionInfo::coordinate ( ) const
inlinenodiscard

Coordinate.

If the coordinate contains altitude information, this refers to true altitude.

Returns
Coordinate

Definition at line 68 of file PositionInfo.h.

◆ groundSpeed()

Q_INVOKABLE Units::Speed Positioning::PositionInfo::groundSpeed ( ) const
nodiscard

Ground speed.

Returns
Ground speed or NaN if unknown.

◆ isValid()

Q_INVOKABLE bool Positioning::PositionInfo::isValid ( ) const
nodiscard

Validity.

Returns
True if the underlying QGeoPositionInfo is valid and if its age is less then PositionInfo::lifetime.

◆ operator==()

Q_INVOKABLE bool Positioning::PositionInfo::operator== ( const Positioning::PositionInfo & rhs) const
inline

Comparison: equal.

Parameters
rhsRight hand side of the comparison
Returns
Result of the comparison

Definition at line 173 of file PositionInfo.h.

◆ positionErrorEstimate()

Q_INVOKABLE Units::Distance Positioning::PositionInfo::positionErrorEstimate ( ) const
nodiscard

Position error estimate.

Returns
Position error estimate or NaN if unknown.

◆ source()

Q_INVOKABLE QString Positioning::PositionInfo::source ( ) const
inlinenodiscard

Name of source, as set in the constructor.

Returns
Name of source

Definition at line 96 of file PositionInfo.h.

◆ terrainElevationAMSL()

Q_INVOKABLE Units::Distance Positioning::PositionInfo::terrainElevationAMSL ( )
nodiscard

Elevation of terrain at a given coordinate, above sea level.

Returns
Elevation of the terrain at position, or NaN if the terrain elevation is unknown

◆ timestamp()

Q_INVOKABLE QDateTime Positioning::PositionInfo::timestamp ( ) const
inlinenodiscard

Timestamp.

Returns
Timestamp of the position info.

Definition at line 109 of file PositionInfo.h.

◆ timestampString()

Q_INVOKABLE QString Positioning::PositionInfo::timestampString ( ) const
inlinenodiscard

Timestamp string.

Returns
Timestamp of the position info, as a string.

Definition at line 118 of file PositionInfo.h.

◆ trueAltitudeAGL()

Q_INVOKABLE Units::Distance Positioning::PositionInfo::trueAltitudeAGL ( )
nodiscard

True Altitude above ground level.

Returns
True altitude with geoid correction taken into account or NaN if unknown.

◆ trueAltitudeAMSL()

Q_INVOKABLE Units::Distance Positioning::PositionInfo::trueAltitudeAMSL ( ) const
nodiscard

True Altitude above main sea level.

Returns
True altitude with geoid correction taken into account or NaN if unknown.

◆ trueAltitudeErrorEstimate()

Q_INVOKABLE Units::Distance Positioning::PositionInfo::trueAltitudeErrorEstimate ( ) const
nodiscard

True altitude error estimate.

Returns
True altitude error estimate or NaN if unknown.

◆ trueTrack()

Q_INVOKABLE Units::Angle Positioning::PositionInfo::trueTrack ( ) const
nodiscard

True track.

Returns
True track or NaN if unknown.

◆ trueTrackErrorEstimate()

Q_INVOKABLE Units::Angle Positioning::PositionInfo::trueTrackErrorEstimate ( ) const
nodiscard

True track error estimate.

Returns
True track error estimate or NaN if unknown.

◆ variation()

Q_INVOKABLE Units::Angle Positioning::PositionInfo::variation ( ) const
nodiscard

Magnetic variation.

Returns
Magnetic variation or NaN if unknown.

◆ verticalSpeed()

Q_INVOKABLE Units::Speed Positioning::PositionInfo::verticalSpeed ( ) const
nodiscard

Vertical speed.

Returns
Vertical speed or NaN if unknown.

Member Data Documentation

◆ lifetime

auto Positioning::PositionInfo::lifetime = 20min
staticconstexpr

Liftetime of geographic positioning information.

Geographic position information is considered valid only for this amount of time after it has been received.

Definition at line 192 of file PositionInfo.h.


The documentation for this class was generated from the following file: