refs #865, adjusted interpolator to use elevation or elevation provider

* adjusted IInterpolator::setGroundElevationFromHint
* removed cgAboveGround from getCorrectedAltitude
This commit is contained in:
Klaus Basan
2017-01-22 00:30:53 +01:00
committed by Mathew Sutcliffe
parent 38585d10b2
commit daab5eed49
5 changed files with 24 additions and 22 deletions

View File

@@ -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)