For those interested, the Fuel & Weight dialog just grew a new
feature.  The new Harrier modifications from shavlir (which are
really, really nice) needed to be able to turn external stores on and
off in order to correctly draw the 3D model.  To do this, he wrote a
nice selector GUI in Nasal and hooked to the tab key.  This seemed to
overlap pretty badly with the existing Fuel & Weight dialog, though,
which was also intended to manage external stores from the GUI.  So I
spent a few hours and added the functionality to the existing dialog.

This feature seems to be pretty underutilized, even for a lot of the
aircraft for which it was intended.  So in case anyone isn't aware of
how it works, here are some docs: The F&W subsystem is entirely
property driven.  In your -set.xml file you add a bunch of
/sim/weight[n] definitions like:

  <weight n="0">
   <name>Left Rear Passenger</name>
   <weight-lb>0</weight-lb> <!-- initial/runtime value -->
   <max-lb>300</max-lb>
   <min-lb>60</min-lb>      <!-- optional, defaults to zero -->
  </weight>

This will get you a slider labeled "Left Rear Passenger" that you can
tweak at runtime from the dialog.  The FDM configuration would
obviously read "/sim/weight[0]/weight-lb" to get the weight at
runtime.

You can also (this is the new feature) include a list of options and a
initial "selected" property under the weight tag.  This will cause the
dialog to show a selectable combo box with only the named options you
want:

  <weight n="5">
    <name>Right Wingroot</name>
    <weight-lb>0</weight-lb>
    <selected>none</selected>
    <opt><name>none</name>                        <lbs>0</lbs>    </opt>
    <opt><name>AIM-9L Sidewinder</name>           <lbs>155.2</lbs></opt>
    <opt><name>AIM-120 AMRAAM</name>              <lbs>335</lbs>  </opt>
    <opt><name>ALARM Anti-radar Missile</name>    <lbs>590</lbs>  </opt>
    <opt><name>500lb Laser Guided Bomb</name>     <lbs>606</lbs>  </opt>
    <opt><name>External Fuel Tank</name>          <lbs>190</lbs>  </opt>
  </weight>

Each "opt" property has a "name" and "lbs" sub-property.  You set the
selected proprty to the appropriate default (in this case "none") and
the subsystem code ensures that the weight-lb property is filled in
correctly for the selected option.  And now, the model animations can
use the "/sim/weight[5]/selected" property to choose which model
animations to draw at runtime.

Anyway, as always let me know if I broke something or if there's
something that needs to be added for it to be useful.  A bunch of the
existing aircraft could productively use this feature, I think.

Andy


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Flightgear-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to