On 01/15/2007 12:12 AM, Ron Jensen wrote:

 > Remapped the G/g keys to control only the gear handle.
 > controls/gear/gear-down is only controlled by nasal.

That brings to light a problematic situation.

There are three properties of interest:
  1) gear-handle-down
  2) wow (aka squat switch)
  3) gear-down

There is legacy code wherein the user-interface directly manipulates
the gear-down property, via
   a) the keyboard via keyboard.xml
   b) buttons on the joystick (e.g. X52.xml)
   c) possibly others

These legacies are bugs, IMHO, because they disregard and
bypass any logic associated with squat switches, unserviceable
subsystems, et cetera.

In particular, fixing bug (a) is a good thing, but does not
go far enough, because it leaves bug (b) still on the loose,
and presumably other bugs also.


Fixing bug (a) is relatively easy, because the RG-aircraft
startup code only needs to remap one small feature of the
pre-existing UI.  Fixing bug (b) is harder, partly
because it would require tracking down who-knows-how-many
pieces of hardware and fixing their interface definitions.

The tricky bit is that fixing (say) X52.xml so that it works
properly with the non-naive RG aircraft means that it won't work
properly with other aircraft that naively expect the UI to
directly set the gear-down property.

Remarks:
  -- gear-down is a low-level property
  -- as a general principle, the UI should not be messing
   with low-level properties.  There should be at least
   one layer of indirection.

Therefore, a suggestion:  There are at least two ways to fix
these bugs once and for all:

  SCHEME 1 (quick and dirty):

  1.1) Rampage through all the UI stuff and fix it so that
   if a property called "gear-handle-down" has been defined,
   use that;  otherwise, for compatibility, (ab)use the
   gear-down property.


  SCHEME 2 (nicer, more sophisticated, and better in the long
  term):

  2.1) The fgfs startup code should install a listener
   attached to gear-handle-down.  This default listener should
   put the gear down/up in response to the gear handle, in the
   naive, backwards-compatible way.

  2.2) After that is done, rampage through all the UI stuff and
   fix it so that it manipulates the gear handle, not the gear.

  3.3) Then revise the default gear-down lister so that if
   gear-down gets set without gear-handle-down previously being
   set accordingly, it issues a warning, indicating that that
   this is improper, and the UI needs to be updated.

  3.4) Non-naive aircraft can implement their own functionality
   by replacing the gear-handle-down listener *without* having
   to mess with the UI.

Note that there is no barrier to doing (1) then (2).

Scheme 1 results in added complexity in all UI code, now and in
the future.  Scheme 2 requires slightly more work now, but yields
nicer code in the UI and elsewhere for all time.

Comments?  Anybody have a better solution?


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to