mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-06 18:25:37 +08:00
Ref T260, utility functions for interpolation/guessing
This commit is contained in:
committed by
Roland Winklmeier
parent
d021e2dcce
commit
075ffa8ccb
@@ -71,15 +71,25 @@ namespace BlackMisc
|
||||
parts.setGearDown(onGround);
|
||||
engines.initEngines(engineNumber, !onGround || situation.isMoving());
|
||||
|
||||
const double pitchDeg = situation.getPitch().value(CAngleUnit::deg());
|
||||
double nearGround1Ft = 750;
|
||||
double nearGround2Ft = 1500;
|
||||
if (pitchDeg > 10)
|
||||
{
|
||||
// likely starting
|
||||
nearGround1Ft = 250;
|
||||
nearGround2Ft = 500;
|
||||
}
|
||||
|
||||
if (situation.hasGroundElevation())
|
||||
{
|
||||
const double aGroundFt = situation.getHeightAboveGround().value(CLengthUnit::ft());
|
||||
if (aGroundFt < 1000)
|
||||
if (aGroundFt < nearGround1Ft)
|
||||
{
|
||||
parts.setGearDown(true);
|
||||
parts.setFlapsPercent(25);
|
||||
}
|
||||
else if (aGroundFt < 2000)
|
||||
else if (aGroundFt < nearGround2Ft)
|
||||
{
|
||||
parts.setGearDown(true);
|
||||
parts.setFlapsPercent(10);
|
||||
|
||||
Reference in New Issue
Block a user