Ref T261, unify unit handling in situation altitude related values

* this is an optimization, it would work without that, but there are numerous calculations in interpolation which are faster and easier to debug in the same unit
* PQ switch unit functions use "const &PQUnit"
This commit is contained in:
Klaus Basan
2018-05-07 11:40:59 +02:00
committed by Roland Winklmeier
parent 337f661499
commit 23c54938ea
8 changed files with 107 additions and 29 deletions

View File

@@ -253,7 +253,7 @@ namespace BlackMisc
void setGroundElevation(const Aviation::CAltitude &altitude);
//! Elevation of the ground directly beneath
void setGroundElevation(const Geo::CElevationPlane &elevationPlane) { m_groundElevationPlane = elevationPlane; }
void setGroundElevation(const Geo::CElevationPlane &elevationPlane);
//! Set elevation of the ground directly beneath, but checked
//! \remark override if better
@@ -277,6 +277,9 @@ namespace BlackMisc
//! Get altitude unit
const PhysicalQuantities::CLengthUnit &getAltitudeUnit() const { return m_position.geodeticHeight().getUnit(); }
//! Get altitude unit
const PhysicalQuantities::CLengthUnit &getAltitudeOrDefaultUnit() const;
//! Get altitude under consideration of ground elevation and ground flag
//! \remark with dragToGround it will also compensate overflows, otherwise only underflow
//! @{
@@ -291,7 +294,7 @@ namespace BlackMisc
//! @}
//! Set altitude
void setAltitude(const CAltitude &altitude) { m_position.setGeodeticHeight(altitude); }
void setAltitude(const CAltitude &altitude);
//! Add offset to altitude
CAltitude addAltitudeOffset(const PhysicalQuantities::CLength &offset);
@@ -342,7 +345,7 @@ namespace BlackMisc
const PhysicalQuantities::CLength &getCG() const { return m_cg; }
//! Set CG
void setCG(const PhysicalQuantities::CLength &cg) { m_cg = cg; }
void setCG(const PhysicalQuantities::CLength &cg);
//! Has CG set?
bool hasCG() const { return !m_cg.isNull(); }