GPS::Config::Config() :
_enableTurnAnticipation(true),
_turnRate(3.0), // degrees-per-second, so 180 degree turn takes 60 seconds
- _overflightArmDistance(0.5),
+ _overflightArmDistance(1.0),
_waypointAlertTime(30.0),
_tuneRadio1ToRefVor(false),
_minRunwayLengthFt(0.0),
_requireHardSurface(true),
- _cdiMaxDeflectionNm(-1), // default to angular mode
+ _cdiMaxDeflectionNm(3.0), // linear mode, 3nm at the peg
_driveAutopilot(true)
{
_enableTurnAnticipation = false;
return;
}
- // FIXME: we want to set desired track, not heading, here
- _apTrueHeading->setDoubleValue(getWP1Bearing());
+ // compatability feature - allow the route-manager / GPS to drive the
+ // generic autopilot heading hold *in leg mode only*
+ if (_mode == "leg") {
+ // FIXME: we want to set desired track, not heading, here
+ _apTrueHeading->setDoubleValue(getWP1Bearing());
+ }
}
void GPS::wp1Changed()
}
double altFt = _wp1_position.getElevationFt();
- if (altFt < -9990.0) {
- _apTargetAltitudeFt->setDoubleValue(0.0);
- } else {
+ if (altFt > -9990.0) {
_apTargetAltitudeFt->setDoubleValue(altFt);
}
}
int index = _scratchNode->getIntValue("index", -9999);
clearScratch();
- if (index == -9999) { // no index supplied, use current wp
+ if ((index < 0) || (index >= _routeMgr->size())) { // no index supplied, use current wp
index = _routeMgr->currentWaypoint();
}