|
swift
|
Altitude as used in aviation, can be AGL or MSL altitude. More...
#include <altitude.h>
Public Types | |
| enum | ReferenceDatum { MeanSeaLevel = 0 , AboveGround , FlightLevel } |
| Enum type to distinguish between MSL and AGL. More... | |
| enum | AltitudeType { PressureAltitude , TrueAltitude } |
| Altitude type. More... | |
| using | base_type = physical_quantities::CLength |
| Base type. | |
| using | MetricTuple = std::tuple<int, int> |
| Metric tuple. | |
| Public Types inherited from swift::misc::physical_quantities::CPhysicalQuantity< CLengthUnit, CLength > | |
| enum | ColumnIndex |
| Index. More... | |
| Public Types inherited from swift::misc::mixin::Index< CLength > | |
| enum | ColumnIndex |
| Base class enums. More... | |
| Public Types inherited from swift::misc::mixin::Index< CAltitude > | |
| enum | ColumnIndex |
| Base class enums. More... | |
Public Member Functions | |
| CAltitude () | |
| Default constructor: 0m Altitude MSL. | |
| CAltitude (double value, ReferenceDatum datum, const physical_quantities::CLengthUnit &unit) | |
| Constructor. | |
| CAltitude (double value, ReferenceDatum datum, AltitudeType type, const physical_quantities::CLengthUnit &unit) | |
| Constructor. | |
| CAltitude (double value, const physical_quantities::CLengthUnit &unit) | |
| Constructor, value as CAltitude::MeanSeaLevel. | |
| CAltitude (double value, const physical_quantities::CLengthUnit &unit, const physical_quantities::CLengthUnit &switchUnit) | |
| Constructor, value as CAltitude::MeanSeaLevel. | |
| CAltitude (const QString &altitudeAsString, physical_quantities::CPqString::SeparatorMode mode=physical_quantities::CPqString::SeparatorBestGuess) | |
| Altitude as string. | |
| CAltitude (const physical_quantities::CLength &altitude, ReferenceDatum datum) | |
| Constructor by CLength. | |
| CAltitude | withOffset (const CLength &offset) const |
| Altitude with offset. | |
| void | addOffset (const CLength &offset) |
| Add offset value. | |
| CAltitude & | switchUnit (const physical_quantities::CLengthUnit &newUnit) |
| Value in switched unit. | |
| CAltitude | switchedUnit (const physical_quantities::CLengthUnit &newUnit) const |
| Value in switched unit. | |
| bool | isAboveGroundLevel () const |
| AGL Above ground level? | |
| bool | isMeanSeaLevel () const |
| MSL Mean sea level? | |
| bool | isFlightLevel () const |
| Flight level? | |
| ReferenceDatum | getReferenceDatum () const |
| Get reference datum (MSL or AGL). | |
| bool | toFlightLevel () |
| MSL to flightlevel. | |
| bool | toMeanSeaLevel () |
| Flightlevel to MSL. | |
| bool | hasMeanSeaLevelValue () const |
| Non-NULL MSL value? | |
| AltitudeType | getAltitudeType () const |
| Current altitude type. | |
| void | convertToPressureAltitude (const physical_quantities::CPressure &seaLevelPressure) |
| Converts this to pressure altitude. Requires the current barometric pressure at MSL. | |
| CAltitude | toPressureAltitude (const physical_quantities::CPressure &seaLevelPressure) const |
| Returns the altitude converted to pressure altitude. Requires the current barometric pressure at MSL. | |
| void | parseFromString (const QString &value) |
| Parse value from string. | |
| void | parseFromString (const QString &value, physical_quantities::CPqString::SeparatorMode mode) |
| Parse value from string, with specified separator. | |
| bool | parseFromFpAltitudeString (const QString &value, CStatusMessageList *msgs=nullptr) |
| Parse from FP altitude string. | |
| bool | isValidFpAltitude (CStatusMessageList *msgs=nullptr) const |
| Is this a valid FP altitude. | |
| QString | asFpICAOAltitudeString () const |
| Altitude string (official version). | |
| QString | asFpVatsimAltitudeString () const |
| As simple VATSIM string, only FLxxx or altitude as ft. | |
| swift::misc::CIcons::IconIndex | toIcon () const |
| As icon, not implemented by all classes. | |
| int | compare (const CAltitude &otherAltitude) const |
| Return negative, zero, or positive if a is less than, equal to, or greater than b. | |
| QString | convertToQString (bool i18n=false) const |
| Cast as QString. | |
| int | comparePropertyByIndex (CPropertyIndexRef index, const CAltitude &compareValue) const |
| Set property by index. | |
| CAltitude | roundedToNearest100ft (bool roundDown) const |
| Round to the nearest 100ft, like needed for China and Russia. | |
| Public Member Functions inherited from swift::misc::physical_quantities::CLength | |
| CLength () | |
| Default constructor. | |
| CLength (double value, const CLengthUnit &unit) | |
| Init by double value. | |
| CLength (double value, const CLengthUnit &unit, const CLengthUnit &switchUnit) | |
| Init by double value and switch unit. | |
| CLength (const QString &unitString) | |
| Public Member Functions inherited from swift::misc::physical_quantities::CPhysicalQuantity< CLengthUnit, CLength > | |
| const CLengthUnit & | getUnit () const |
| Unit. | |
| void | setUnit (const CLengthUnit &unit) |
| Simply set unit, do no calclulate conversion. | |
| void | setUnitBySymbol (const QString &unitName) |
| Set unit by string. | |
| QString | getUnitSymbol () const |
| Unit. | |
| CLength & | switchUnit (const CLengthUnit &newUnit) |
| Change unit, and convert value to maintain the same quantity. | |
| CLength | switchedUnit (const CLengthUnit &newUnit) const |
| Return copy with switched unit. | |
| bool | isNull () const |
| Is quantity null? | |
| void | setNull () |
| Set null. | |
| double | value (CLengthUnit unit) const |
| Value in given unit. | |
| void | setCurrentUnitValue (double value) |
| Set value in current unit. | |
| int | valueInteger (CLengthUnit unit) const |
| As integer value. | |
| QString | valueIntegerAsString (CLengthUnit unit) const |
| As integer value. | |
| bool | isInteger () const |
| Is value an integer. | |
| double | valueRounded (CLengthUnit unit, int digits=-1) const |
| Rounded value in given unit. | |
| QString | valueRoundedAsString (CLengthUnit unit, int digits=-1) const |
| Rounded value in given unit. | |
| QString | valueRoundedWithUnit (const CLengthUnit &unit, int digits=-1, bool withGroupSeparator=false, bool i18n=false) const |
| Value to QString with the given unit, e.g. "5.00m". | |
| void | roundToEpsilon () |
| Round current value in current unit to epsilon. | |
| void | setValueSameUnit (double value) |
| Change value without changing unit. | |
| void | addValueSameUnit (double value) |
| Add to the value in the current unit. | |
| void | substractValueSameUnit (double value) |
| Substract from the value in the current unit. | |
| CPhysicalQuantity & | operator*= (double multiply) |
| Multiply operator *=. | |
| CPhysicalQuantity & | operator/= (double divide) |
| Divide operator /=. | |
| CLength | operator* (double multiply) const |
| Operator *. | |
| CLength | operator/ (double divide) const |
| Operator /. | |
| CLength | operator- () const |
| Unary operator -. | |
| CPhysicalQuantity & | operator+= (const CPhysicalQuantity &other) |
| Plus operator +=. | |
| CPhysicalQuantity & | operator-= (const CPhysicalQuantity &other) |
| Minus operator-=. | |
| bool | isZeroEpsilonConsidered () const |
| Quantity value <= epsilon. | |
| bool | isPositiveWithEpsilonConsidered () const |
| Value >= 0 epsilon considered. | |
| bool | isNegativeWithEpsilonConsidered () const |
| Value <= 0 epsilon considered. | |
| const CLength & | makePositive () |
| Make value always positive. | |
| const CLength & | makeNegative () |
| Make value always negative. | |
| CLength | abs () const |
| Absolute value (always >=0). | |
| void | marshallToDbus (QDBusArgument &argument) const |
| Marshall without begin/endStructure, for when composed within another object. | |
| void | unmarshallFromDbus (const QDBusArgument &argument) |
| Unmarshall without begin/endStructure, for when composed within another object. | |
| void | marshalToDataStream (QDataStream &stream) const |
| Marshal a value to a QDataStream. | |
| void | unmarshalFromDataStream (QDataStream &stream) |
| Unmarshal a value from a QDataStream. | |
| size_t | getValueHash () const |
| qHash overload, needed for storing value in a QSet. | |
| QJsonObject | toJson () const |
| Cast to JSON object. | |
| void | convertFromJson (const QJsonObject &json) |
| Assign from JSON object. | |
| QVariant | propertyByIndex (CPropertyIndexRef index) const |
| Property by index. | |
| void | setPropertyByIndex (CPropertyIndexRef index, const QVariant &variant) |
| Set property by index. | |
| int | comparePropertyByIndex (CPropertyIndexRef index, const CLength &pq) const |
| Compare for index. | |
| QString | convertToQString (bool i18n=false) const |
| Cast as QString. | |
| void | parseFromString (const QString &value) |
| Parse value from string. | |
| Public Member Functions inherited from swift::misc::mixin::Index< CLength > | |
| CPropertyIndexList | apply (const CPropertyIndexVariantMap &indexMap, bool skipEqualValues=false) |
| Update by variant map. | |
| void | setPropertyByIndex (CPropertyIndexRef index, const QVariant &variant) |
| Set property by index. | |
| QVariant | propertyByIndex (CPropertyIndexRef index) const |
| Property by index. | |
| int | comparePropertyByIndex (CPropertyIndexRef index, const CLength &compareValue) const |
| Compare for index. | |
| bool | equalsPropertyByIndex (const QVariant &compareValue, CPropertyIndexRef index) const |
| Is given variant equal to value of property index? | |
| Public Member Functions inherited from swift::misc::mixin::MetaType< CLength > | |
| int | getMetaTypeId () const |
| Returns the Qt meta type ID of this object. | |
| QString | getClassName () const |
| Class name. | |
| bool | isA (int metaTypeId) const |
| Returns true if this object is an instance of the class with the given meta type ID, or one of its subclasses. | |
| Public Member Functions inherited from swift::misc::mixin::String< CLength > | |
| QString | toQString (bool i18n=false) const |
| Cast as QString. | |
| std::string | toStdString (bool i18n=false) const |
| To std string. | |
| QString | stringForStreaming () const |
| String for streaming operators. | |
| Public Member Functions inherited from swift::misc::mixin::Icon< CPhysicalQuantity< CLengthUnit, CLength > > | |
| CIcons::CIcons::StandardIconUnknown16 | toIcon () const |
| As icon, not implemented by all classes. | |
| Public Member Functions inherited from swift::misc::mixin::MetaType< CAltitude > | |
| int | getMetaTypeId () const |
| Returns the Qt meta type ID of this object. | |
| QString | getClassName () const |
| Class name. | |
| bool | isA (int metaTypeId) const |
| Returns true if this object is an instance of the class with the given meta type ID, or one of its subclasses. | |
| Public Member Functions inherited from swift::misc::mixin::DBusByMetaClass< CAltitude > | |
| void | marshallToDbus (QDBusArgument &arg, Tags...) const |
| Marshall without begin/endStructure, for when composed within another object. | |
| void | unmarshallFromDbus (const QDBusArgument &arg, Tags...) |
| Unmarshall without begin/endStructure, for when composed within another object. | |
| Public Member Functions inherited from swift::misc::mixin::DBusByMetaClass< CAltitude, LosslessTag > | |
| void | marshallToDbus (QDBusArgument &arg, Tags...) const |
| Marshall without begin/endStructure, for when composed within another object. | |
| void | unmarshallFromDbus (const QDBusArgument &arg, Tags...) |
| Unmarshall without begin/endStructure, for when composed within another object. | |
| Public Member Functions inherited from swift::misc::mixin::DataStreamByMetaClass< CAltitude > | |
| void | marshalToDataStream (QDataStream &stream) const |
| Marshal a value to a QDataStream. | |
| void | unmarshalFromDataStream (QDataStream &stream) |
| Unmarshal a value from a QDataStream. | |
| Public Member Functions inherited from swift::misc::mixin::JsonByMetaClass< CAltitude > | |
| QJsonObject | toJson () const |
| Cast to JSON object. | |
| QString | toJsonString (QJsonDocument::JsonFormat format=QJsonDocument::Indented) const |
| Convenience function JSON as string. | |
| void | convertFromJson (const QJsonObject &json) |
| Assign from JSON object. | |
| Public Member Functions inherited from swift::misc::mixin::String< CAltitude > | |
| QString | toQString (bool i18n=false) const |
| Cast as QString. | |
| std::string | toStdString (bool i18n=false) const |
| To std string. | |
| QString | stringForStreaming () const |
| String for streaming operators. | |
| Public Member Functions inherited from swift::misc::mixin::Icon< CAltitude > | |
| CIcons::CIcons::StandardIconUnknown16 | toIcon () const |
| As icon, not implemented by all classes. | |
| Public Member Functions inherited from swift::misc::mixin::Index< CAltitude > | |
| CPropertyIndexList | apply (const CPropertyIndexVariantMap &indexMap, bool skipEqualValues=false) |
| Update by variant map. | |
| void | setPropertyByIndex (CPropertyIndexRef index, const QVariant &variant) |
| Set property by index. | |
| QVariant | propertyByIndex (CPropertyIndexRef index) const |
| Property by index. | |
| int | comparePropertyByIndex (CPropertyIndexRef index, const CAltitude &compareValue) const |
| Compare for index. | |
| bool | equalsPropertyByIndex (const QVariant &compareValue, CPropertyIndexRef index) const |
| Is given variant equal to value of property index? | |
Static Public Member Functions | |
| static const QRegularExpression & | fpAltitudeRegExp () |
| Checking FP altitude strings like "A20", "FL100". | |
| static QString | fpAltitudeInfo (const QString &separator=", ") |
| Info for FP altitude strings. | |
| static QString | fpAltitudeExamples () |
| Examples of FP altitude strings. | |
| static const CAltitude & | null () |
| Null altitude (MSL). | |
| static physical_quantities::CLengthUnit | defaultUnit () |
| Default unit for calculations. | |
| static const physical_quantities::CPressure & | standardISASeaLevelPressure () |
| Standard pressure 1013.25mbar/hPa. | |
| static void | registerMetadata () |
| Register metadata. | |
| static int | findMetricAltitude (int feet) |
| Search the corresponding feet <-> metric / metric <-> feet. | |
| static int | findAltitudeForMetricAltitude (int metric) |
| Search the corresponding feet <-> metric / metric <-> feet. | |
| Static Public Member Functions inherited from swift::misc::physical_quantities::CPhysicalQuantity< CLengthUnit, CLength > | |
| static const CLength & | maxValue (const CLength &pq1, const CLength &pq2) |
| Maximum of 2 quantities. | |
| static const CLength & | minValue (const CLength &pq1, const CLength &pq2) |
| Minimum of 2 quantities. | |
| static const CLength & | null () |
| NULL PQ. | |
| static CLength | parsedFromString (const QString &value, CPqString::SeparatorMode mode=CPqString::SeparatorBestGuess) |
| Parsed from given string. | |
| Static Public Member Functions inherited from swift::misc::mixin::MetaType< CLength > | |
| static void | registerMetadata () |
| Register metadata. | |
| Static Public Member Functions inherited from swift::misc::mixin::MetaType< CAltitude > | |
| static void | registerMetadata () |
| Register metadata. | |
| Static Public Member Functions inherited from swift::misc::mixin::JsonByMetaClass< CAltitude > | |
| static DerivedObj | fromJson (const QJsonObject &json) |
| Get object from QJsonObject. | |
| static DerivedObj | fromJsonNoThrow (const QString &jsonString, bool acceptCacheJson, bool &success, QString &errMsg) |
| Get object from JSON string. | |
Additional Inherited Members | |
| Protected Member Functions inherited from swift::misc::physical_quantities::CPhysicalQuantity< CLengthUnit, CLength > | |
| CPhysicalQuantity (double value, CLengthUnit unit) | |
| Constructor with double. | |
Altitude as used in aviation, can be AGL or MSL altitude.
Definition at line 39 of file altitude.h.
Base type.
Definition at line 55 of file altitude.h.
| using swift::misc::aviation::CAltitude::MetricTuple = std::tuple<int, int> |
Metric tuple.
Definition at line 58 of file altitude.h.
Altitude type.
| Enumerator | |
|---|---|
| PressureAltitude | Altitude above the standard datum plane. |
| TrueAltitude | Height of the airplane above Mean Sea Level (MSL). |
Definition at line 80 of file altitude.h.
Enum type to distinguish between MSL and AGL.
| Enumerator | |
|---|---|
| MeanSeaLevel | MSL. |
| AboveGround | AGL. |
| FlightLevel | Flight level. |
Definition at line 72 of file altitude.h.
|
inline |
Default constructor: 0m Altitude MSL.
Definition at line 87 of file altitude.h.
|
inline |
Constructor.
Definition at line 90 of file altitude.h.
|
inline |
Constructor.
Definition at line 95 of file altitude.h.
|
inline |
Constructor, value as CAltitude::MeanSeaLevel.
Definition at line 100 of file altitude.h.
|
inline |
Constructor, value as CAltitude::MeanSeaLevel.
Definition at line 105 of file altitude.h.
| swift::misc::aviation::CAltitude::CAltitude | ( | const QString & | altitudeAsString, |
| physical_quantities::CPqString::SeparatorMode | mode = physical_quantities::CPqString::SeparatorBestGuess ) |
Altitude as string.
Definition at line 55 of file altitude.cpp.
|
inline |
Constructor by CLength.
Definition at line 117 of file altitude.h.
| void swift::misc::aviation::CAltitude::addOffset | ( | const CLength & | offset | ) |
Add offset value.
Definition at line 75 of file altitude.cpp.
| QString swift::misc::aviation::CAltitude::asFpICAOAltitudeString | ( | ) | const |
Altitude string (official version).
Definition at line 406 of file altitude.cpp.
| QString swift::misc::aviation::CAltitude::asFpVatsimAltitudeString | ( | ) | const |
As simple VATSIM string, only FLxxx or altitude as ft.
Definition at line 432 of file altitude.cpp.
| int swift::misc::aviation::CAltitude::compare | ( | const CAltitude & | otherAltitude | ) | const |
Return negative, zero, or positive if a is less than, equal to, or greater than b.
Definition at line 471 of file altitude.cpp.
| int swift::misc::aviation::CAltitude::comparePropertyByIndex | ( | CPropertyIndexRef | index, |
| const CAltitude & | compareValue ) const |
Set property by index.
Definition at line 117 of file altitude.cpp.
| void swift::misc::aviation::CAltitude::convertToPressureAltitude | ( | const physical_quantities::CPressure & | seaLevelPressure | ) |
Converts this to pressure altitude. Requires the current barometric pressure at MSL.
Definition at line 146 of file altitude.cpp.
| QString swift::misc::aviation::CAltitude::convertToQString | ( | bool | i18n = false | ) | const |
Cast as QString.
Definition at line 98 of file altitude.cpp.
|
static |
Default unit for calculations.
Definition at line 517 of file altitude.cpp.
|
static |
Search the corresponding feet <-> metric / metric <-> feet.
Definition at line 501 of file altitude.cpp.
|
static |
Search the corresponding feet <-> metric / metric <-> feet.
Definition at line 491 of file altitude.cpp.
|
static |
Examples of FP altitude strings.
Definition at line 463 of file altitude.cpp.
Info for FP altitude strings.
Definition at line 453 of file altitude.cpp.
|
static |
Checking FP altitude strings like "A20", "FL100".
Definition at line 446 of file altitude.cpp.
|
inline |
Current altitude type.
Definition at line 157 of file altitude.h.
|
inline |
Get reference datum (MSL or AGL).
Definition at line 145 of file altitude.h.
|
inline |
Non-NULL MSL value?
Definition at line 154 of file altitude.h.
|
inline |
AGL Above ground level?
Definition at line 136 of file altitude.h.
|
inline |
Flight level?
Definition at line 142 of file altitude.h.
|
inline |
MSL Mean sea level?
Definition at line 139 of file altitude.h.
| bool swift::misc::aviation::CAltitude::isValidFpAltitude | ( | CStatusMessageList * | msgs = nullptr | ) | const |
Is this a valid FP altitude.
Definition at line 338 of file altitude.cpp.
|
static |
Null altitude (MSL).
Definition at line 511 of file altitude.cpp.
| bool swift::misc::aviation::CAltitude::parseFromFpAltitudeString | ( | const QString & | value, |
| CStatusMessageList * | msgs = nullptr ) |
Parse from FP altitude string.
Definition at line 227 of file altitude.cpp.
| void swift::misc::aviation::CAltitude::parseFromString | ( | const QString & | value | ) |
Parse value from string.
Definition at line 179 of file altitude.cpp.
| void swift::misc::aviation::CAltitude::parseFromString | ( | const QString & | value, |
| physical_quantities::CPqString::SeparatorMode | mode ) |
Parse value from string, with specified separator.
Definition at line 184 of file altitude.cpp.
|
static |
Register metadata.
Definition at line 25 of file altitude.cpp.
| CAltitude swift::misc::aviation::CAltitude::roundedToNearest100ft | ( | bool | roundDown | ) | const |
Round to the nearest 100ft, like needed for China and Russia.
Definition at line 481 of file altitude.cpp.
|
static |
Standard pressure 1013.25mbar/hPa.
Definition at line 519 of file altitude.cpp.
| CAltitude swift::misc::aviation::CAltitude::switchedUnit | ( | const physical_quantities::CLengthUnit & | newUnit | ) | const |
Value in switched unit.
Definition at line 87 of file altitude.cpp.
| CAltitude & swift::misc::aviation::CAltitude::switchUnit | ( | const physical_quantities::CLengthUnit & | newUnit | ) |
Value in switched unit.
Definition at line 77 of file altitude.cpp.
| bool swift::misc::aviation::CAltitude::toFlightLevel | ( | ) |
MSL to flightlevel.
Definition at line 126 of file altitude.cpp.
| CIcons::IconIndex swift::misc::aviation::CAltitude::toIcon | ( | ) | const |
As icon, not implemented by all classes.
Definition at line 469 of file altitude.cpp.
| bool swift::misc::aviation::CAltitude::toMeanSeaLevel | ( | ) |
Flightlevel to MSL.
Definition at line 136 of file altitude.cpp.
| CAltitude swift::misc::aviation::CAltitude::toPressureAltitude | ( | const physical_quantities::CPressure & | seaLevelPressure | ) | const |
Returns the altitude converted to pressure altitude. Requires the current barometric pressure at MSL.
Definition at line 164 of file altitude.cpp.
Altitude with offset.
Definition at line 61 of file altitude.cpp.