* Martin Spott -- Sunday 11 December 2005 20:09:
> "Jon S Berndt" wrote:
> > On Sun, 11 Dec 2005 15:02:13 +0100 Melchior FRANZ wrote:
> > > It's the job of the glue code (JSBSim.cxx) to map internal values
> > > to standard fgfs properties. This internal /fdm/jsbsim/foo thingy
> > > will hardly ever be supported by the keyboard/joystick bindings.
> 
> > Maybe I'm not understanding your meaning, though ...
> 
> I'm convinced Melchior aimed at pointing out that FDM-specific names
> for non-FDM-specific properties don't belong into FlightGear.

Exactly. FlightGear isn't a shell for JSBSim. FlightGear supports more
than just one FDM. There are conventions for where to find properties.
Engine stuff is in /engines/. There are setups relying on information
being available in the same places, no matter which FDM is used. Take
for example joystick drivers:

$ cd $FG_ROOT/Input/Joysticks
$ find -name \*.xml|xargs grep reverser|sed 's,[^I ]\+, ,'
./ThrustMaster/Top-Gun-Afterburner.xml: reverser = 
!getprop("/controls/engines/engine[0]/reverser");
./ThrustMaster/Top-Gun-Afterburner.xml: 
props.setAll("/controls/engines/engine", "reverser", reverser);
./ThrustMaster/Top-Gun-Afterburner.xml: if (reverser) {
./Saitek/Cyborg-Gold-3d-USB.xml: i = 
!getprop("/controls/engines/engine[0]/reverser");
./Saitek/Cyborg-Gold-3d-USB.xml: props.setAll("/controls/engines/engine", 
"reverser", i);
./Saitek/Cyborg-Evo.xml: reverser = 
!getprop("/controls/engines/engine[0]/reverser");
./Saitek/Cyborg-Evo.xml: props.setAll("/controls/engines/engine", "reverser", 
reverser);
./Saitek/Cyborg-Evo.xml: if (reverser) {

This makes the reverser controllable with a joystick button or axis.
The glue code is exactly for the purpose to unify FDM internal
properties and to offer them under the same addresses. How do you
think the bindings should look like if every FDM has its own funny
properties, and developers are unwilling to cooperate?

  <desc>apply thrust reverser</desc>
  <binding>
    <command>nasal</command>
    <script>
       fdm = getprop("/sim/flight-model");
       if (fdm == "yasim") {
           props.setAll("/controls/engines/engine", "reverser", 1);
       } elsif (fdm == "jsbsim") {
           props.setAll("/fdm/jsbsim/propulsion/engine", "reverser-angle", 120);
       } elsif (fdm == "uiuc") {
           props.setAll("/some/other/random", "place", "please-reverse-now");
       } else ...
    </script>

Thrust reversers aren't unique to JSBSim, and even less to the L410.

m.

_______________________________________________
Flightgear-devel mailing list
[email protected]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d

Reply via email to