GPS: improve reliability (at the expense of some in-development features) for pending release.
- default to an invalid altitude in routes, instead of cruise altitude (temporarily) - only set an altitude on the autopilot, if valid - only add departure airport/runway to the route, if not airborne
This commit is contained in:
parent
21f1fcd17a
commit
10d4799058
2 changed files with 11 additions and 6 deletions
|
@ -340,9 +340,9 @@ void FGRouteMgr::new_waypoint( const string& target, int n ) {
|
|||
SGWayPoint* FGRouteMgr::make_waypoint(const string& tgt ) {
|
||||
string target(boost::to_upper_copy(tgt));
|
||||
|
||||
// extract altitude
|
||||
double alt = cruise->getDoubleValue("altitude-ft") * SG_FEET_TO_METER;
|
||||
|
||||
double alt = -9999.0;
|
||||
// extract altitude
|
||||
size_t pos = target.find( '@' );
|
||||
if ( pos != string::npos ) {
|
||||
alt = atof( target.c_str() + pos + 1 );
|
||||
|
@ -490,7 +490,14 @@ void FGRouteMgr::InputListener::valueChanged(SGPropertyNode *prop)
|
|||
|
||||
bool FGRouteMgr::activate()
|
||||
{
|
||||
if (_departure) {
|
||||
if (isRouteActive()) {
|
||||
SG_LOG(SG_AUTOPILOT, SG_WARN, "duplicate route-activation, no-op");
|
||||
return false;
|
||||
}
|
||||
|
||||
// only add departure waypoint if we're not airborne, so that
|
||||
// in-air route activation doesn't confuse matters.
|
||||
if (weightOnWheels->getBoolValue() && _departure) {
|
||||
string runwayId(departure->getStringValue("runway"));
|
||||
FGRunway* runway = NULL;
|
||||
if (_departure->hasRunwayWithIdent(runwayId)) {
|
||||
|
|
|
@ -1021,9 +1021,7 @@ void GPS::wp1Changed()
|
|||
}
|
||||
|
||||
double altFt = _wp1_position.getElevationFt();
|
||||
if (altFt < -9990.0) {
|
||||
_apTargetAltitudeFt->setDoubleValue(0.0);
|
||||
} else {
|
||||
if (altFt > -9990.0) {
|
||||
_apTargetAltitudeFt->setDoubleValue(altFt);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue