1
0
Fork 0

call controls.stepFlaps() wrapper to keep bindings functional with aircraft

that implement special flaps behavior; use controls.throttleAxis() where
safely possible to support arbitrary numbers of engines
This commit is contained in:
mfranz 2005-06-16 16:47:31 +00:00
parent f4a90a615e
commit 8a2ba09c4a
12 changed files with 57 additions and 471 deletions

View file

@ -27,52 +27,8 @@
<axis n="2"> <axis n="2">
<desc>Throttle</desc> <desc>Throttle</desc>
<binding> <binding>
<command>property-scale</command> <command>nasal</command>
<property>/controls/engines/engine[0]/throttle</property> <script>controls.throttleAxis()</script>
<offset type="double">-1.0</offset>
<factor type="double">-0.5</factor>
</binding>
<binding>
<command>property-scale</command>
<property>/controls/engines/engine[1]/throttle</property>
<offset type="double">-1.0</offset>
<factor type="double">-0.5</factor>
</binding>
<binding>
<command>property-scale</command>
<property>/controls/engines/engine[2]/throttle</property>
<offset type="double">-1.0</offset>
<factor type="double">-0.5</factor>
</binding>
<binding>
<command>property-scale</command>
<property>/controls/engines/engine[3]/throttle</property>
<offset type="double">-1.0</offset>
<factor type="double">-0.5</factor>
</binding>
<binding>
<command>property-scale</command>
<property>/controls/engines/engine[4]/throttle</property>
<offset type="double">-1.0</offset>
<factor type="double">-0.5</factor>
</binding>
<binding>
<command>property-scale</command>
<property>/controls/engines/engine[5]/throttle</property>
<offset type="double">-1.0</offset>
<factor type="double">-0.5</factor>
</binding>
<binding>
<command>property-scale</command>
<property>/controls/engines/engine[6]/throttle</property>
<offset type="double">-1.0</offset>
<factor type="double">-0.5</factor>
</binding>
<binding>
<command>property-scale</command>
<property>/controls/engines/engine[7]/throttle</property>
<offset type="double">-1.0</offset>
<factor type="double">-0.5</factor>
</binding> </binding>
</axis> </axis>
<axis> <axis>

View file

@ -48,52 +48,8 @@ $Id$
<axis n="2"> <axis n="2">
<desc>Throttle</desc> <desc>Throttle</desc>
<binding> <binding>
<command>property-scale</command> <command>nasal</command>
<property>/controls/engines/engine[0]/throttle</property> <script>controls.throttleAxis()</script>
<offset type="double">-1.0</offset>
<factor type="double">-0.5</factor>
</binding>
<binding>
<command>property-scale</command>
<property>/controls/engines/engine[1]/throttle</property>
<offset type="double">-1.0</offset>
<factor type="double">-0.5</factor>
</binding>
<binding>
<command>property-scale</command>
<property>/controls/engines/engine[2]/throttle</property>
<offset type="double">-1.0</offset>
<factor type="double">-0.5</factor>
</binding>
<binding>
<command>property-scale</command>
<property>/controls/engines/engine[3]/throttle</property>
<offset type="double">-1.0</offset>
<factor type="double">-0.5</factor>
</binding>
<binding>
<command>property-scale</command>
<property>/controls/engines/engine[4]/throttle</property>
<offset type="double">-1.0</offset>
<factor type="double">-0.5</factor>
</binding>
<binding>
<command>property-scale</command>
<property>/controls/engines/engine[5]/throttle</property>
<offset type="double">-1.0</offset>
<factor type="double">-0.5</factor>
</binding>
<binding>
<command>property-scale</command>
<property>/controls/engines/engine[6]/throttle</property>
<offset type="double">-1.0</offset>
<factor type="double">-0.5</factor>
</binding>
<binding>
<command>property-scale</command>
<property>/controls/engines/engine[7]/throttle</property>
<offset type="double">-1.0</offset>
<factor type="double">-0.5</factor>
</binding> </binding>
</axis> </axis>
<axis n="3"> <axis n="3">
@ -189,18 +145,16 @@ $Id$
<desc>Flaps down</desc> <desc>Flaps down</desc>
<repeatable>false</repeatable> <repeatable>false</repeatable>
<binding> <binding>
<command>property-adjust</command> <command>nasal</command>
<property>/controls/flight/flaps</property> <script>controls.stepFlaps(1)</script>
<step type="double">-0.34</step>
</binding> </binding>
</button> </button>
<button n="3"> <button n="3">
<desc>Flaps up</desc> <desc>Flaps up</desc>
<repeatable>false</repeatable> <repeatable>false</repeatable>
<binding> <binding>
<command>property-adjust</command> <command>nasal</command>
<property>/controls/flight/flaps</property> <script>controls.stepFlaps(-1)</script>
<step type="double">0.34</step>
</binding> </binding>
</button> </button>
<button n="7"> <button n="7">

View file

@ -63,52 +63,8 @@ $Id$
<windows>2</windows> <windows>2</windows>
</number> </number>
<binding> <binding>
<command>property-scale</command> <command>nasal</command>
<property>/controls/engines/engine[0]/throttle</property> <script>controls.throttleAxis()</script>
<offset type="double">-1.0</offset>
<factor type="double">-0.5</factor>
</binding>
<binding>
<command>property-scale</command>
<property>/controls/engines/engine[1]/throttle</property>
<offset type="double">-1.0</offset>
<factor type="double">-0.5</factor>
</binding>
<binding>
<command>property-scale</command>
<property>/controls/engines/engine[2]/throttle</property>
<offset type="double">-1.0</offset>
<factor type="double">-0.5</factor>
</binding>
<binding>
<command>property-scale</command>
<property>/controls/engines/engine[3]/throttle</property>
<offset type="double">-1.0</offset>
<factor type="double">-0.5</factor>
</binding>
<binding>
<command>property-scale</command>
<property>/controls/engines/engine[4]/throttle</property>
<offset type="double">-1.0</offset>
<factor type="double">-0.5</factor>
</binding>
<binding>
<command>property-scale</command>
<property>/controls/engines/engine[5]/throttle</property>
<offset type="double">-1.0</offset>
<factor type="double">-0.5</factor>
</binding>
<binding>
<command>property-scale</command>
<property>/controls/engines/engine[6]/throttle</property>
<offset type="double">-1.0</offset>
<factor type="double">-0.5</factor>
</binding>
<binding>
<command>property-scale</command>
<property>/controls/engines/engine[7]/throttle</property>
<offset type="double">-1.0</offset>
<factor type="double">-0.5</factor>
</binding> </binding>
</axis> </axis>

View file

@ -59,52 +59,8 @@ $Id$
<axis n="3"> <axis n="3">
<desc>Throttle</desc> <desc>Throttle</desc>
<binding> <binding>
<command>property-scale</command> <command>nasal</command>
<property>/controls/engines/engine[0]/throttle</property> <script>controls.throttleAxis()</script>
<offset type="double">-1.0</offset>
<factor type="double">-0.5</factor>
</binding>
<binding>
<command>property-scale</command>
<property>/controls/engines/engine[1]/throttle</property>
<offset type="double">-1.0</offset>
<factor type="double">-0.5</factor>
</binding>
<binding>
<command>property-scale</command>
<property>/controls/engines/engine[2]/throttle</property>
<offset type="double">-1.0</offset>
<factor type="double">-0.5</factor>
</binding>
<binding>
<command>property-scale</command>
<property>/controls/engines/engine[3]/throttle</property>
<offset type="double">-1.0</offset>
<factor type="double">-0.5</factor>
</binding>
<binding>
<command>property-scale</command>
<property>/controls/engines/engine[4]/throttle</property>
<offset type="double">-1.0</offset>
<factor type="double">-0.5</factor>
</binding>
<binding>
<command>property-scale</command>
<property>/controls/engines/engine[5]/throttle</property>
<offset type="double">-1.0</offset>
<factor type="double">-0.5</factor>
</binding>
<binding>
<command>property-scale</command>
<property>/controls/engines/engine[6]/throttle</property>
<offset type="double">-1.0</offset>
<factor type="double">-0.5</factor>
</binding>
<binding>
<command>property-scale</command>
<property>/controls/engines/engine[7]/throttle</property>
<offset type="double">-1.0</offset>
<factor type="double">-0.5</factor>
</binding> </binding>
</axis> </axis>

View file

@ -57,52 +57,8 @@
<axis n="3"> <axis n="3">
<desc>Throttle</desc> <desc>Throttle</desc>
<binding> <binding>
<command>property-scale</command> <command>nasal</command>
<property>/controls/engines/engine[0]/throttle</property> <script>controls.throttleAxis()</script>
<offset type="double">-1.0</offset>
<factor type="double">-0.5</factor>
</binding>
<binding>
<command>property-scale</command>
<property>/controls/engines/engine[1]/throttle</property>
<offset type="double">-1.0</offset>
<factor type="double">-0.5</factor>
</binding>
<binding>
<command>property-scale</command>
<property>/controls/engines/engine[2]/throttle</property>
<offset type="double">-1.0</offset>
<factor type="double">-0.5</factor>
</binding>
<binding>
<command>property-scale</command>
<property>/controls/engines/engine[3]/throttle</property>
<offset type="double">-1.0</offset>
<factor type="double">-0.5</factor>
</binding>
<binding>
<command>property-scale</command>
<property>/controls/engines/engine[4]/throttle</property>
<offset type="double">-1.0</offset>
<factor type="double">-0.5</factor>
</binding>
<binding>
<command>property-scale</command>
<property>/controls/engines/engine[5]/throttle</property>
<offset type="double">-1.0</offset>
<factor type="double">-0.5</factor>
</binding>
<binding>
<command>property-scale</command>
<property>/controls/engines/engine[6]/throttle</property>
<offset type="double">-1.0</offset>
<factor type="double">-0.5</factor>
</binding>
<binding>
<command>property-scale</command>
<property>/controls/engines/engine[7]/throttle</property>
<offset type="double">-1.0</offset>
<factor type="double">-0.5</factor>
</binding> </binding>
</axis> </axis>
@ -211,9 +167,8 @@
<desc>Flaps down</desc> <desc>Flaps down</desc>
<repeatable>false</repeatable> <repeatable>false</repeatable>
<binding> <binding>
<command>property-adjust</command> <command>nasal</command>
<property>/controls/flight/flaps</property> <script>controls.stepFlaps(1)</script>
<step type="double">-0.34</step>
</binding> </binding>
</button> </button>
@ -221,9 +176,8 @@
<desc>Flaps up</desc> <desc>Flaps up</desc>
<repeatable>false</repeatable> <repeatable>false</repeatable>
<binding> <binding>
<command>property-adjust</command> <command>nasal</command>
<property>/controls/flight/flaps</property> <script>controls.stepFlaps(-1)</script>
<step type="double">0.34</step>
</binding> </binding>
</button> </button>

View file

@ -173,9 +173,8 @@ $Id:
<desc>Flaps down</desc> <desc>Flaps down</desc>
<repeatable>false</repeatable> <repeatable>false</repeatable>
<binding> <binding>
<command>property-adjust</command> <command>nasal</command>
<property>/controls/flight/flaps</property> <script>controls.stepFlaps(1)</script>
<step type="double">-0.34</step>
</binding> </binding>
</button> </button>
@ -183,9 +182,8 @@ $Id:
<desc>Flaps up</desc> <desc>Flaps up</desc>
<repeatable>false</repeatable> <repeatable>false</repeatable>
<binding> <binding>
<command>property-adjust</command> <command>nasal</command>
<property>/controls/flight/flaps</property> <script>controls.stepFlaps(-1)</script>
<step type="double">0.34</step>
</binding> </binding>
</button> </button>

View file

@ -48,52 +48,8 @@ $Id$
<axis n="2"> <axis n="2">
<desc>Throttle</desc> <desc>Throttle</desc>
<binding> <binding>
<command>property-scale</command> <command>nasal</command>
<property>/controls/engines/engine[0]/throttle</property> <script>controls.throttleAxis()</script>
<offset type="double">-1.0</offset>
<factor type="double">-0.5</factor>
</binding>
<binding>
<command>property-scale</command>
<property>/controls/engines/engine[1]/throttle</property>
<offset type="double">-1.0</offset>
<factor type="double">-0.5</factor>
</binding>
<binding>
<command>property-scale</command>
<property>/controls/engines/engine[2]/throttle</property>
<offset type="double">-1.0</offset>
<factor type="double">-0.5</factor>
</binding>
<binding>
<command>property-scale</command>
<property>/controls/engines/engine[3]/throttle</property>
<offset type="double">-1.0</offset>
<factor type="double">-0.5</factor>
</binding>
<binding>
<command>property-scale</command>
<property>/controls/engines/engine[4]/throttle</property>
<offset type="double">-1.0</offset>
<factor type="double">-0.5</factor>
</binding>
<binding>
<command>property-scale</command>
<property>/controls/engines/engine[5]/throttle</property>
<offset type="double">-1.0</offset>
<factor type="double">-0.5</factor>
</binding>
<binding>
<command>property-scale</command>
<property>/controls/engines/engine[6]/throttle</property>
<offset type="double">-1.0</offset>
<factor type="double">-0.5</factor>
</binding>
<binding>
<command>property-scale</command>
<property>/controls/engines/engine[7]/throttle</property>
<offset type="double">-1.0</offset>
<factor type="double">-0.5</factor>
</binding> </binding>
</axis> </axis>
@ -196,9 +152,8 @@ $Id$
<desc>Flaps down</desc> <desc>Flaps down</desc>
<repeatable>false</repeatable> <repeatable>false</repeatable>
<binding> <binding>
<command>property-adjust</command> <command>nasal</command>
<property>/controls/flight/flaps</property> <script>controls.stepFlaps(1)</script>
<step type="double">-0.34</step>
</binding> </binding>
</button> </button>
@ -206,9 +161,8 @@ $Id$
<desc>Flaps up</desc> <desc>Flaps up</desc>
<repeatable>false</repeatable> <repeatable>false</repeatable>
<binding> <binding>
<command>property-adjust</command> <command>nasal</command>
<property>/controls/flight/flaps</property> <script>controls.stepFlaps(-1)</script>
<step type="double">0.34</step>
</binding> </binding>
</button> </button>

View file

@ -208,9 +208,8 @@ $Id$
<desc>Flaps up</desc> <desc>Flaps up</desc>
<repeatable>false</repeatable> <repeatable>false</repeatable>
<binding> <binding>
<command>property-adjust</command> <command>nasal</command>
<property>/controls/flight/flaps</property> <script>controls.stepFlaps(-1)</script>
<step type="double">0.34</step>
</binding> </binding>
</button> </button>
@ -218,9 +217,8 @@ $Id$
<desc>Flaps down</desc> <desc>Flaps down</desc>
<repeatable>false</repeatable> <repeatable>false</repeatable>
<binding> <binding>
<command>property-adjust</command> <command>nasal</command>
<property>/controls/flight/flaps</property> <script>controls.stepFlaps(1)</script>
<step type="double">-0.34</step>
</binding> </binding>
</button> </button>

View file

@ -49,52 +49,8 @@ $Id$
<axis n="2"> <axis n="2">
<desc>Throttle</desc> <desc>Throttle</desc>
<binding> <binding>
<command>property-scale</command> <command>nasal</command>
<property>/controls/engines/engine[0]/throttle</property> <script>controls.throttleAxis()</script>
<offset type="double">-1.0</offset>
<factor type="double">-0.5</factor>
</binding>
<binding>
<command>property-scale</command>
<property>/controls/engines/engine[1]/throttle</property>
<offset type="double">-1.0</offset>
<factor type="double">-0.5</factor>
</binding>
<binding>
<command>property-scale</command>
<property>/controls/engines/engine[2]/throttle</property>
<offset type="double">-1.0</offset>
<factor type="double">-0.5</factor>
</binding>
<binding>
<command>property-scale</command>
<property>/controls/engines/engine[3]/throttle</property>
<offset type="double">-1.0</offset>
<factor type="double">-0.5</factor>
</binding>
<binding>
<command>property-scale</command>
<property>/controls/engines/engine[4]/throttle</property>
<offset type="double">-1.0</offset>
<factor type="double">-0.5</factor>
</binding>
<binding>
<command>property-scale</command>
<property>/controls/engines/engine[5]/throttle</property>
<offset type="double">-1.0</offset>
<factor type="double">-0.5</factor>
</binding>
<binding>
<command>property-scale</command>
<property>/controls/engines/engine[6]/throttle</property>
<offset type="double">-1.0</offset>
<factor type="double">-0.5</factor>
</binding>
<binding>
<command>property-scale</command>
<property>/controls/engines/engine[7]/throttle</property>
<offset type="double">-1.0</offset>
<factor type="double">-0.5</factor>
</binding> </binding>
</axis> </axis>
@ -183,9 +139,8 @@ $Id$
<desc>Flaps up</desc> <desc>Flaps up</desc>
<repeatable>false</repeatable> <repeatable>false</repeatable>
<binding> <binding>
<command>property-adjust</command> <command>nasal</command>
<property>/controls/flight/flaps</property> <script>controls.stepFlaps(-1)</script>
<step type="double">0.34</step>
</binding> </binding>
</button> </button>
@ -193,9 +148,8 @@ $Id$
<desc>Flaps down</desc> <desc>Flaps down</desc>
<repeatable>false</repeatable> <repeatable>false</repeatable>
<binding> <binding>
<command>property-adjust</command> <command>nasal</command>
<property>/controls/flight/flaps</property> <script>controls.stepFlaps(1)</script>
<step type="double">-0.34</step>
</binding> </binding>
</button> </button>

View file

@ -58,52 +58,8 @@ $Id$
<axis n="2"> <axis n="2">
<desc>Throttle</desc> <desc>Throttle</desc>
<binding> <binding>
<command>property-scale</command> <command>nasal</command>
<property>/controls/engines/engine[0]/throttle</property> <script>controls.throttleAxis()</script>
<offset type="double">-1.0</offset>
<factor type="double">-0.5</factor>
</binding>
<binding>
<command>property-scale</command>
<property>/controls/engines/engine[1]/throttle</property>
<offset type="double">-1.0</offset>
<factor type="double">-0.5</factor>
</binding>
<binding>
<command>property-scale</command>
<property>/controls/engines/engine[2]/throttle</property>
<offset type="double">-1.0</offset>
<factor type="double">-0.5</factor>
</binding>
<binding>
<command>property-scale</command>
<property>/controls/engines/engine[3]/throttle</property>
<offset type="double">-1.0</offset>
<factor type="double">-0.5</factor>
</binding>
<binding>
<command>property-scale</command>
<property>/controls/engines/engine[4]/throttle</property>
<offset type="double">-1.0</offset>
<factor type="double">-0.5</factor>
</binding>
<binding>
<command>property-scale</command>
<property>/controls/engines/engine[5]/throttle</property>
<offset type="double">-1.0</offset>
<factor type="double">-0.5</factor>
</binding>
<binding>
<command>property-scale</command>
<property>/controls/engines/engine[6]/throttle</property>
<offset type="double">-1.0</offset>
<factor type="double">-0.5</factor>
</binding>
<binding>
<command>property-scale</command>
<property>/controls/engines/engine[7]/throttle</property>
<offset type="double">-1.0</offset>
<factor type="double">-0.5</factor>
</binding> </binding>
</axis> </axis>
@ -249,9 +205,8 @@ $Id$
<desc>Step Flaps Down</desc> <desc>Step Flaps Down</desc>
<repeatable type="bool">false</repeatable> <repeatable type="bool">false</repeatable>
<binding> <binding>
<command>property-adjust</command> <command>nasal</command>
<property>/controls/flight/flaps</property> <script>controls.stepFlaps(1)</script>
<step type="double">+0.34</step>
</binding> </binding>
</button> </button>
@ -259,9 +214,8 @@ $Id$
<desc>Step Flaps Up</desc> <desc>Step Flaps Up</desc>
<repeatable type="bool">false</repeatable> <repeatable type="bool">false</repeatable>
<binding> <binding>
<command>property-adjust</command> <command>nasal</command>
<property>/controls/flight/flaps</property> <script>controls.stepFlaps(-1)</script>
<step type="double">-0.34</step>
</binding> </binding>
</button> </button>

View file

@ -50,52 +50,8 @@ $Id$
<axis n="2"> <axis n="2">
<desc>Throttle</desc> <desc>Throttle</desc>
<binding> <binding>
<command>property-scale</command> <command>nasal</command>
<property>/controls/engines/engine[0]/throttle</property> <script>controls.throttleAxis()</script>
<offset type="double">-1.0</offset>
<factor type="double">-0.5</factor>
</binding>
<binding>
<command>property-scale</command>
<property>/controls/engines/engine[1]/throttle</property>
<offset type="double">-1.0</offset>
<factor type="double">-0.5</factor>
</binding>
<binding>
<command>property-scale</command>
<property>/controls/engines/engine[2]/throttle</property>
<offset type="double">-1.0</offset>
<factor type="double">-0.5</factor>
</binding>
<binding>
<command>property-scale</command>
<property>/controls/engines/engine[3]/throttle</property>
<offset type="double">-1.0</offset>
<factor type="double">-0.5</factor>
</binding>
<binding>
<command>property-scale</command>
<property>/controls/engines/engine[4]/throttle</property>
<offset type="double">-1.0</offset>
<factor type="double">-0.5</factor>
</binding>
<binding>
<command>property-scale</command>
<property>/controls/engines/engine[5]/throttle</property>
<offset type="double">-1.0</offset>
<factor type="double">-0.5</factor>
</binding>
<binding>
<command>property-scale</command>
<property>/controls/engines/engine[6]/throttle</property>
<offset type="double">-1.0</offset>
<factor type="double">-0.5</factor>
</binding>
<binding>
<command>property-scale</command>
<property>/controls/engines/engine[7]/throttle</property>
<offset type="double">-1.0</offset>
<factor type="double">-0.5</factor>
</binding> </binding>
</axis> </axis>
@ -170,8 +126,8 @@ $Id$
</button> </button>
<button n="1"> <button n="1">
<desc>Center rudder</desc>
<binding> <binding>
<desc>Center rudder</desc>
<command>property-assign</command> <command>property-assign</command>
<property>/controls/flight/rudder</property> <property>/controls/flight/rudder</property>
<value type="double">0.0</value> <value type="double">0.0</value>
@ -179,20 +135,18 @@ $Id$
</button> </button>
<button n="2"> <button n="2">
<desc>Flaps up</desc>
<binding> <binding>
<desc>Flaps up</desc> <command>nasal</command>
<command>property-adjust</command> <script>controls.stepFlaps(-1)</script>
<property>/controls/flight/flaps</property>
<step type="double">-0.34</step>
</binding> </binding>
</button> </button>
<button n="3"> <button n="3">
<desc>Flaps down</desc>
<binding> <binding>
<desc>Flaps down</desc> <command>nasal</command>
<command>property-adjust</command> <script>controls.stepFlaps(1)</script>
<property>/controls/flight/flaps</property>
<step type="double">0.34</step>
</binding> </binding>
</button> </button>

View file

@ -195,9 +195,8 @@
<desc>Flaps down</desc> <desc>Flaps down</desc>
<repeatable>false</repeatable> <repeatable>false</repeatable>
<binding> <binding>
<command>property-adjust</command> <command>nasal</command>
<property>/controls/flight/flaps</property> <script>controls.stepFlaps(1)</script>
<step type="double">-0.34</step>
</binding> </binding>
</button> </button>
@ -205,9 +204,8 @@
<desc>Flaps up</desc> <desc>Flaps up</desc>
<repeatable>false</repeatable> <repeatable>false</repeatable>
<binding> <binding>
<command>property-adjust</command> <command>nasal</command>
<property>/controls/flight/flaps</property> <script>controls.stepFlaps(-1)</script>
<step type="double">0.34</step>
</binding> </binding>
</button> </button>