* Curtis L. Olson -- Friday 06 June 2003 17:38:
> Going with the principle of least surprise, I prefer the current
> behavior.  If I'm flying along with the autopilot and everything is
> nice and trimed out, then I disable the autopilot, with your patch I
> could suddenly be catestrophically out of trim.

Yes, that's also true of course. How would it be in a real aircraft?
Would the autopilot restore the trim value on alt unlock? (See patch.)
Iif what we currently have is realistic, then I'd certainly leave it
like that. The problem doesn't happen often, anyway.  :-)

m.



RCS file: /var/cvs/FlightGear-0.9/FlightGear/src/Autopilot/newauto.cxx,v
retrieving revision 1.8
diff -u -p -r1.8 newauto.cxx
--- newauto.cxx 22 Apr 2003 09:21:17 -0000      1.8
+++ newauto.cxx 6 Jun 2003 15:56:22 -0000
@@ -1138,8 +1138,14 @@ FGAutopilot::getAPAltitudeLock () const
 void
 FGAutopilot::setAPAltitudeLock (bool lock)
 {
-  if (lock)
+  static double old_elevator_trim = 0.0;
+
+  if (lock) {
+    old_elevator_trim = globals->get_controls()->get_elevator_trim();
     set_AltitudeMode(DEFAULT_AP_ALTITUDE_LOCK);
+  } else
+    globals->get_controls()->set_elevator_trim(old_elevator_trim);
+
   if (get_AltitudeMode() == DEFAULT_AP_ALTITUDE_LOCK)
     set_AltitudeEnabled(lock);
 }

_______________________________________________
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel

Reply via email to