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

@@ -108,6 +108,12 @@ namespace BlackMisc
//! Add offset value
void addOffset(const CLength &offset);
//! Value in switched unit
CAltitude &switchUnit(const PhysicalQuantities::CLengthUnit &newUnit);
//! Value in switched unit
CAltitude switchedUnit(const PhysicalQuantities::CLengthUnit &newUnit) const;
//! AGL Above ground level?
bool isAboveGroundLevel() const { return AboveGround == this->m_datum; }
@@ -176,6 +182,10 @@ namespace BlackMisc
//! Null altitude (MSL)
static const CAltitude &null();
//! Default unit for calculations
//! \remark using this is optional and will simplify debugging and calculations
static const PhysicalQuantities::CLengthUnit &defaultUnit();
//! Standard pressure 1013.25mbar/hPa
static const PhysicalQuantities::CPressure &standardISASeaLevelPressure();