mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-03 15:45:46 +08:00
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:
committed by
Roland Winklmeier
parent
337f661499
commit
23c54938ea
@@ -45,6 +45,13 @@ namespace BlackMisc
|
||||
this->setGeodeticHeight(newAlt);
|
||||
}
|
||||
|
||||
void CElevationPlane::switchAltitudeUnit(const CLengthUnit &unit)
|
||||
{
|
||||
if (unit.isNull() || this->getAltitudeUnit().isNull()) { return; }
|
||||
if (this->getAltitudeUnit() == unit) { return; }
|
||||
this->setGeodeticHeight(this->getAltitude().switchedUnit(unit));
|
||||
}
|
||||
|
||||
const CAltitude &CElevationPlane::getAltitudeIfWithinRadius(const ICoordinateGeodetic &coordinate) const
|
||||
{
|
||||
return (isWithinRange(coordinate)) ? geodeticHeight() : CAltitude::null();
|
||||
|
||||
Reference in New Issue
Block a user