mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-27 19:25:49 +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)
|
if (situation.getOnGroundDetails() != CAircraftSituation::NotSetGroundDetails)
|
||||||
{
|
{
|
||||||
// set some reasonable values
|
do
|
||||||
const bool isOnGround = situation.isOnGround();
|
|
||||||
engines.initEngines(engineCount, !isOnGround || situation.isMoving());
|
|
||||||
parts.setGearDown(isOnGround);
|
|
||||||
parts.setSpoilersOut(false);
|
|
||||||
parts.setEngines(engines);
|
|
||||||
|
|
||||||
if (!change.isNull())
|
|
||||||
{
|
{
|
||||||
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);
|
if (change.isConstDecelarating())
|
||||||
parts.setFlapsPercent(10);
|
{
|
||||||
return parts;
|
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
while (false);
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user