1
0
Fork 0

only lock AP automatically if above /autopilot/route-manager/min-lock-altitude-agl-ft

The ufo sets this to a very low value, "serious" aircraft (which don't want this
unrealistic automatism at all) set it to a very high value, and those that don't
care ... don't need to care.
This commit is contained in:
mfranz 2006-05-12 09:36:21 +00:00
parent ef339945fd
commit 244547eb4c
2 changed files with 8 additions and 4 deletions

View file

@ -144,7 +144,7 @@ void FGRouteMgr::update( double dt ) {
target_altitude_ft->setDoubleValue( target_alt * SG_METER_TO_FEET ); target_altitude_ft->setDoubleValue( target_alt * SG_METER_TO_FEET );
altitude_set = true; altitude_set = true;
if ( !on_ground() ) if ( !near_ground() )
altitude_lock->setStringValue( "altitude-hold" ); altitude_lock->setStringValue( "altitude-hold" );
} }
@ -295,7 +295,7 @@ int FGRouteMgr::new_waypoint( const string& Tgt_Alt, int n ) {
add_waypoint( *wp, n ); add_waypoint( *wp, n );
delete wp; delete wp;
if ( !on_ground() ) if ( !near_ground() )
fgSetString( "/autopilot/locks/heading", "true-heading-hold" ); fgSetString( "/autopilot/locks/heading", "true-heading-hold" );
} }
return type; return type;
@ -391,11 +391,15 @@ void FGRouteMgr::update_mirror() {
} }
bool FGRouteMgr::on_ground() { bool FGRouteMgr::near_ground() {
SGPropertyNode *gear = fgGetNode( "/gear/gear/wow", false ); SGPropertyNode *gear = fgGetNode( "/gear/gear/wow", false );
if ( !gear || gear->getType() == SGPropertyNode::NONE ) if ( !gear || gear->getType() == SGPropertyNode::NONE )
return fgGetBool( "/sim/presets/onground", true ); return fgGetBool( "/sim/presets/onground", true );
if ( fgGetDouble("/position/altitude-agl-ft", 300.0)
< fgGetDouble("/autopilot/route-manager/min-lock-altitude-agl-ft") )
return true;
return gear->getBoolValue(); return gear->getBoolValue();
} }

View file

@ -95,7 +95,7 @@ private:
int make_waypoint( SGWayPoint **wp, string& target ); int make_waypoint( SGWayPoint **wp, string& target );
void update_mirror(); void update_mirror();
bool on_ground(); bool near_ground();
public: public: