mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-23 07:15:35 +08:00
Ref T275, Ref T280, fix parts guessing: do not return after initial guessing, also do 2nd step
This commit is contained in:
@@ -100,36 +100,40 @@ namespace BlackMisc
|
||||
|
||||
if (situation.getOnGroundDetails() != CAircraftSituation::NotSetGroundDetails)
|
||||
{
|
||||
// set some reasonable values
|
||||
const bool isOnGround = situation.isOnGround();
|
||||
engines.initEngines(engineCount, !isOnGround || situation.isMoving());
|
||||
parts.setGearDown(isOnGround);
|
||||
parts.setSpoilersOut(false);
|
||||
parts.setEngines(engines);
|
||||
|
||||
if (!change.isNull())
|
||||
do
|
||||
{
|
||||
if (change.isConstDecelarating())
|
||||
// set some reasonable values
|
||||
const bool isOnGround = situation.isOnGround();
|
||||
engines.initEngines(engineCount, !isOnGround || situation.isMoving());
|
||||
parts.setGearDown(isOnGround);
|
||||
parts.setSpoilersOut(false);
|
||||
parts.setEngines(engines);
|
||||
|
||||
if (!change.isNull())
|
||||
{
|
||||
parts.setSpoilersOut(true);
|
||||
parts.setFlapsPercent(10);
|
||||
return parts;
|
||||
if (change.isConstDecelarating())
|
||||
{
|
||||
parts.setSpoilersOut(true);
|
||||
parts.setFlapsPercent(10);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
const CSpeed slowSpeed = guessedVRotate * 0.30;
|
||||
if (situation.getGroundSpeed() < slowSpeed)
|
||||
{
|
||||
if (details) { *details += QStringLiteral("slow speed <") % slowSpeed.valueRoundedWithUnit(1) % QStringLiteral(" on ground"); }
|
||||
parts.setFlapsPercent(0);
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (details) { *details += QStringLiteral("faster speed >") % slowSpeed.valueRoundedWithUnit(1) % QStringLiteral(" on ground"); }
|
||||
parts.setFlapsPercent(0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
const CSpeed slowSpeed = guessedVRotate * 0.30;
|
||||
if (situation.getGroundSpeed() < slowSpeed)
|
||||
{
|
||||
if (details) { *details += QStringLiteral("slow speed <") % slowSpeed.valueRoundedWithUnit(1) % QStringLiteral(" on ground"); }
|
||||
parts.setFlapsPercent(0);
|
||||
return parts;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (details) { *details += QStringLiteral("faster speed >") % slowSpeed.valueRoundedWithUnit(1) % QStringLiteral(" on ground"); }
|
||||
parts.setFlapsPercent(0);
|
||||
return parts;
|
||||
}
|
||||
while (false);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user