23#include <QGeoPositionInfo>
27#include "units/Angle.h"
28#include "units/Distance.h"
29#include "units/Speed.h"
31using namespace std::chrono_literals;
47 QML_VALUE_TYPE(positionInfo)
68 [[nodiscard]] Q_INVOKABLE QGeoCoordinate
coordinate()
const
70 return m_positionInfo.coordinate();
84 [[nodiscard]] Q_INVOKABLE
bool isValid()
const;
96 [[nodiscard]] Q_INVOKABLE QString
source()
const {
return m_source;}
111 return m_positionInfo.timestamp().toUTC();
120 return m_positionInfo.timestamp().toUTC().time().toString(QStringLiteral(
"HH:mm:ss"))+
" UTC";
175 return (m_positionInfo == rhs.m_positionInfo);
179 operator QGeoPositionInfo()
const
181 return m_positionInfo;
189#if defined(Q_OS_ANDROID) or defined(Q_OS_IOS)
190 static constexpr auto lifetime = 20s;
197 QGeoPositionInfo m_positionInfo;
PositionInfo(const QGeoPositionInfo &info, const QString &source)
Constructor.
Q_INVOKABLE Units::Distance positionErrorEstimate() const
Position error estimate.
Q_INVOKABLE Units::Angle trueTrack() const
True track.
Q_INVOKABLE Units::Distance trueAltitudeErrorEstimate() const
True altitude error estimate.
static constexpr auto lifetime
Liftetime of geographic positioning information.
Q_INVOKABLE Units::Angle variation() const
Magnetic variation.
Q_INVOKABLE QString source() const
Name of source, as set in the constructor.
Q_INVOKABLE QGeoCoordinate coordinate() const
Coordinate.
Q_INVOKABLE bool operator==(const Positioning::PositionInfo &rhs) const
Comparison: equal.
Q_INVOKABLE bool isValid() const
Validity.
Q_INVOKABLE Units::Distance trueAltitudeAMSL() const
True Altitude above main sea level.
PositionInfo()=default
Default Constructor.
Q_INVOKABLE Units::Angle trueTrackErrorEstimate() const
True track error estimate.
Q_INVOKABLE QString timestampString() const
Timestamp string.
Q_INVOKABLE Units::Speed groundSpeed() const
Ground speed.
Q_INVOKABLE QDateTime timestamp() const
Timestamp.
Q_INVOKABLE Units::Speed verticalSpeed() const
Vertical speed.
Q_INVOKABLE Units::Distance terrainElevationAMSL()
Elevation of terrain at a given coordinate, above sea level.
Q_INVOKABLE Units::Distance trueAltitudeAGL()
True Altitude above ground level.
Convenience class for angle computations.
Convenience class for distance computations.
Convenience class for speed computations.