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:
parent
ef339945fd
commit
244547eb4c
2 changed files with 8 additions and 4 deletions
|
@ -144,7 +144,7 @@ void FGRouteMgr::update( double dt ) {
|
|||
target_altitude_ft->setDoubleValue( target_alt * SG_METER_TO_FEET );
|
||||
altitude_set = true;
|
||||
|
||||
if ( !on_ground() )
|
||||
if ( !near_ground() )
|
||||
altitude_lock->setStringValue( "altitude-hold" );
|
||||
}
|
||||
|
||||
|
@ -295,7 +295,7 @@ int FGRouteMgr::new_waypoint( const string& Tgt_Alt, int n ) {
|
|||
add_waypoint( *wp, n );
|
||||
delete wp;
|
||||
|
||||
if ( !on_ground() )
|
||||
if ( !near_ground() )
|
||||
fgSetString( "/autopilot/locks/heading", "true-heading-hold" );
|
||||
}
|
||||
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 );
|
||||
if ( !gear || gear->getType() == SGPropertyNode::NONE )
|
||||
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();
|
||||
}
|
||||
|
||||
|
|
|
@ -95,7 +95,7 @@ private:
|
|||
|
||||
int make_waypoint( SGWayPoint **wp, string& target );
|
||||
void update_mirror();
|
||||
bool on_ground();
|
||||
bool near_ground();
|
||||
|
||||
public:
|
||||
|
||||
|
|
Loading…
Reference in a new issue