diff --git a/src/blackmisc/aviation/aircraftsituation.h b/src/blackmisc/aviation/aircraftsituation.h index 29bb60549..f2f501a06 100644 --- a/src/blackmisc/aviation/aircraftsituation.h +++ b/src/blackmisc/aviation/aircraftsituation.h @@ -257,6 +257,9 @@ namespace BlackMisc //! Get altitude const CAltitude &getAltitude() const { return m_position.geodeticHeight(); } + //! Get altitude unit + const PhysicalQuantities::CLengthUnit &getAltitudeUnit() const { return m_position.geodeticHeight().getUnit(); } + //! Get altitude under consideration of ground elevation and ground flag //! \remark with dragToGround it will also compensate overflows, otherwise ony underflow CAltitude getCorrectedAltitude(const PhysicalQuantities::CLength ¢erOfGravity = PhysicalQuantities::CLength::null(), bool enableDragToGround = true, AltitudeCorrection *correctetion = nullptr) const; diff --git a/src/blackmisc/pq/physicalquantity.cpp b/src/blackmisc/pq/physicalquantity.cpp index 0aa488c41..e1b71eea6 100644 --- a/src/blackmisc/pq/physicalquantity.cpp +++ b/src/blackmisc/pq/physicalquantity.cpp @@ -41,12 +41,6 @@ namespace BlackMisc { namespace PhysicalQuantities { - template - MU CPhysicalQuantity::getUnit() const - { - return m_unit; - } - template void CPhysicalQuantity::setUnitBySymbol(const QString &unitName) { diff --git a/src/blackmisc/pq/physicalquantity.h b/src/blackmisc/pq/physicalquantity.h index caa4dbda9..6614ddab0 100644 --- a/src/blackmisc/pq/physicalquantity.h +++ b/src/blackmisc/pq/physicalquantity.h @@ -60,7 +60,7 @@ namespace BlackMisc //! Index enum ColumnIndex { - IndexUnit = BlackMisc::CPropertyIndex::GlobalIndexCPhysicalQuantity, + IndexUnit = CPropertyIndex::GlobalIndexCPhysicalQuantity, IndexValue, IndexValueRounded0DigitsWithUnit, IndexValueRounded1DigitsWithUnit, @@ -70,11 +70,11 @@ namespace BlackMisc }; //! Unit - MU getUnit() const; + const MU &getUnit() const { return m_unit; } //! Simply set unit, do no calclulate conversion //! \sa switchUnit - void setUnit(MU unit) { this->m_unit = unit; } + void setUnit(MU unit) { m_unit = unit; } //! Set unit by string void setUnitBySymbol(const QString &unitName);