mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-22 13:15:39 +08:00
Ref T602, read conversion table (ft/m) and functions from/to ft/m
This commit is contained in:
@@ -30,6 +30,8 @@
|
||||
#include <QMetaType>
|
||||
#include <QString>
|
||||
#include <QRegularExpression>
|
||||
#include <QVector>
|
||||
#include <tuple>
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
@@ -57,6 +59,9 @@ namespace BlackMisc
|
||||
//! Base type
|
||||
using base_type = PhysicalQuantities::CLength;
|
||||
|
||||
//! Metric tuple
|
||||
using MetricTuple = std::tuple<int, int, int>;
|
||||
|
||||
BLACKMISC_DECLARE_USING_MIXIN_METATYPE(CAltitude)
|
||||
BLACKMISC_DECLARE_USING_MIXIN_STRING(CAltitude)
|
||||
BLACKMISC_DECLARE_USING_MIXIN_DBUS(CAltitude)
|
||||
@@ -196,6 +201,11 @@ namespace BlackMisc
|
||||
//! \remark https://en.wikipedia.org/wiki/Flight_level
|
||||
CAltitude roundedToNearest100ft(bool roundDown) const;
|
||||
|
||||
//! Search the corresponding feet <-> metric / metric <-> feet @{
|
||||
static int findMetricAltitude(int feet);
|
||||
static int findAltitudeForMetricAltitude(int metric);
|
||||
//! @}
|
||||
|
||||
//! Null altitude (MSL)
|
||||
static const CAltitude &null();
|
||||
|
||||
@@ -213,6 +223,9 @@ namespace BlackMisc
|
||||
ReferenceDatum m_datum; //!< MSL or AGL?
|
||||
AltitudeType m_altitudeType = TrueAltitude; //!< type
|
||||
|
||||
//! The metric tuples m/ft/FL
|
||||
static const QVector<MetricTuple> &metricTuples();
|
||||
|
||||
BLACK_METACLASS(
|
||||
CAltitude,
|
||||
BLACK_METAMEMBER(datum),
|
||||
|
||||
Reference in New Issue
Block a user