mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-16 02:06:08 +08:00
refs #865, adjusted interpolator to use elevation or elevation provider
* adjusted IInterpolator::setGroundElevationFromHint * removed cgAboveGround from getCorrectedAltitude
This commit is contained in:
committed by
Mathew Sutcliffe
parent
38585d10b2
commit
daab5eed49
@@ -202,13 +202,12 @@ namespace BlackMisc
|
||||
return { 0, nullptr };
|
||||
}
|
||||
|
||||
CAltitude CAircraftSituation::getCorrectedAltitude(const CLength &cgAboveGround) const
|
||||
CAltitude CAircraftSituation::getCorrectedAltitude() const
|
||||
{
|
||||
if (!this->hasGroundElevation()) { return this->getAltitude(); }
|
||||
const CAltitude groundElevation(cgAboveGround.isNull() ?
|
||||
this->getGroundElevation() :
|
||||
CAltitude(this->getGroundElevation() + cgAboveGround, CAltitude::MeanSeaLevel));
|
||||
return (groundElevation <= this->getAltitude()) ? this->getAltitude() : groundElevation;
|
||||
if (this->getGroundElevation().isNull()) { return this->getAltitude(); }
|
||||
if (this->getAltitude().getReferenceDatum() != CAltitude::MeanSeaLevel) { return this->getAltitude(); }
|
||||
if (this->getGroundElevation() < this->getAltitude()) { return this->getAltitude(); }
|
||||
return this->getGroundElevation();
|
||||
}
|
||||
|
||||
void CAircraftSituation::setCallsign(const CCallsign &callsign)
|
||||
|
||||
Reference in New Issue
Block a user