refs #865, add onGround flag to aircraft situation

This commit is contained in:
Klaus Basan
2017-01-22 11:17:29 +01:00
committed by Mathew Sutcliffe
parent daab5eed49
commit 3c7eb6ea28
3 changed files with 50 additions and 23 deletions

View File

@@ -157,29 +157,16 @@ namespace BlackMisc
return 0;
}
bool CAircraftSituation::isOnGroundGuessed(const CLength &cgAboveGround) const
bool CAircraftSituation::isOnGroundInfoAvailable() const
{
const CLength heightAboveGround(this->getHeightAboveGround());
if (!heightAboveGround.isNull())
{
if (cgAboveGround.isNull())
{
return heightAboveGround.value(CLengthUnit::m()) < 1.0;
}
else
{
return heightAboveGround <= cgAboveGround;
}
}
return this->isOnGround() != CAircraftSituation::OnGroundSituationUnknown &&
this->getOnGroundReliability() != CAircraftSituation::OnGroundReliabilityNoSet;
}
// we guess on pitch and bank
if (qAbs(this->getPitch().value(CAngleUnit::deg())) > 10) { return false; }
if (qAbs(this->getBank().value(CAngleUnit::deg())) > 10) { return false; }
if (this->getGroundSpeed().value(CSpeedUnit::km_h()) > 50) { return false; }
// not sure, but this is a guess
return true;
void CAircraftSituation::setOnGround(CAircraftSituation::IsOnGround onGround, CAircraftSituation::OnGroundReliability reliability)
{
this->setOnGround(onGround);
this->setOnGroundReliabiliy(reliability);
}
bool CAircraftSituation::hasGroundElevation() const