On Mon, 2007-04-02 at 13:45 +0100, Nick Warne wrote:
> Hi all,
> 
> Helping Vivian today on the Spitfire model, the gear warning (stall) klaxon 
> wasn't working for me [again] although Vivian had fixed the previous issue 
> why it failed sometimes.
> 
> After investigation, it turns out one of the conditions required for the 
> stall 
> warning to go off is:
> 
>             <equals>
>               <property>controls/engines/engine/throttle</property>
>               <value>0</value>
>             </equals>
> 
> It turns out I calibrated my JS using JSCAL, and the throttle axis ran 
> from -32766 <-> 32767.
> 
> Thus, when my throttle was off, FG actually reports it as (similar):
> 
> 1.598490389232043e -5
> 
> so it isn't '0', and therefore klaxon criteria wasn't met.
> 
> Hand 'tweaking' my jscal file, I have now got my JS to report -32767 <-> 
> 32767 
> on all axis, and now FG does show throttle to be 1 <-> 0 at the ends of the 
> range.
> 
> So, how accurate does the throttle need to be?  Surely not 1.5e -5?
> 
> Nick

You probably should change the condition to not depend on a perfectly
rigged joystick.  Testing for equal is not a great idea any time you are
using floating point math...  This is the gear warning out of the
c182rg:

  <gear-horn>
   <name>gear-horn</name>
   <mode>looped</mode>
   <path>Aircraft/c182rg/Sounds/stall-600-chopped.wav</path>
   <condition>
    <and>
      <less-than>
        <property>controls/engines/engine/throttle</property>
        <value>0.3</value>
      </less-than>
      <equals>
        <property>controls/gear/gear-handle-down</property>
        <value>0</value>
      </equals>
    </and>
   </condition>
  </gear-horn>

As you can see, it only needs the throttle to be less than 30%.  Try
something like this for the spitfire:

     <condition> 
          <and> 
            <less-than> 
              <property>controls/engines/engine/throttle</property>
              <value>0.2</value>
            </less-than>
            <equals> 
              <property>controls/gear/gear-down</property>
              <value>0</value>
            </equals>
            <equals> 
              <property>sim/alarms/gear-warn</property>
              <value>0</value>
            </equals>
          </and>
        </condition>

Ron



-------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to