| 1 |
<?xml version="1.0"?> |
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
<PropertyList> |
| 8 |
<name>TQ6</name> |
| 9 |
<name>GoFlight TQ6</name> |
| 10 |
|
| 11 |
<nasal> |
| 12 |
<script> |
| 13 |
<![CDATA[ |
| 14 |
|
| 15 |
var MIN_READING = -0.7; |
| 16 |
var MAX_READING = 0.62; |
| 17 |
|
| 18 |
var clamp = func(v) { v < 0 ? 0 : v > 1 ? 1 : v } |
| 19 |
|
| 20 |
var normalisedValue = func { |
| 21 |
var raw = cmdarg().getNode('setting').getValue(); |
| 22 |
var range = MAX_READING - MIN_READING; |
| 23 |
return clamp((raw - MIN_READING) / range); |
| 24 |
}; |
| 25 |
|
| 26 |
var normalisedInvertedValue = func { |
| 27 |
return 1 - normalisedValue(); |
| 28 |
}; |
| 29 |
|
| 30 |
]]> |
| 31 |
</script> |
| 32 |
</nasal> |
| 33 |
|
| 34 |
|
| 35 |
<axis> |
| 36 |
<name>Left lever</name> |
| 37 |
<number> |
| 38 |
<unix>0</unix> |
| 39 |
<mac>0</mac> |
| 40 |
<windows>0</windows> |
| 41 |
</number> |
| 42 |
<desc>Speedbrake</desc> |
| 43 |
<binding> |
| 44 |
<command>nasal</command> |
| 45 |
<script>setprop('/controls/flight/speedbrake-lever', normalisedValue());</script> |
| 46 |
</binding> |
| 47 |
</axis> |
| 48 |
|
| 49 |
<axis> |
| 50 |
<name>Lever 2</name> |
| 51 |
<number> |
| 52 |
<unix>1</unix> |
| 53 |
<mac>1</mac> |
| 54 |
<windows>1</windows> |
| 55 |
</number> |
| 56 |
<desc>Not used</desc> |
| 57 |
</axis> |
| 58 |
|
| 59 |
<axis> |
| 60 |
<name>Left engine throttle</name> |
| 61 |
<number> |
| 62 |
<unix>2</unix> |
| 63 |
<mac>2</mac> |
| 64 |
<windows>2</windows> |
| 65 |
</number> |
| 66 |
<desc>Left engine throttle</desc> |
| 67 |
<binding> |
| 68 |
<command>nasal</command> |
| 69 |
<script>setprop('/controls/engines/engine[0]/throttle', normalisedInvertedValue());</script> |
| 70 |
</binding> |
| 71 |
</axis> |
| 72 |
|
| 73 |
<axis> |
| 74 |
<name>Right engine throttle</name> |
| 75 |
<number> |
| 76 |
<unix>3</unix> |
| 77 |
<mac>3</mac> |
| 78 |
<windows>3</windows> |
| 79 |
</number> |
| 80 |
<desc>Right engine throttle</desc> |
| 81 |
<binding> |
| 82 |
<command>nasal</command> |
| 83 |
<script>setprop('/controls/engines/engine[1]/throttle', normalisedInvertedValue());</script> |
| 84 |
</binding> |
| 85 |
</axis> |
| 86 |
|
| 87 |
<axis> |
| 88 |
<name>Lever 5</name> |
| 89 |
<number> |
| 90 |
<unix>4</unix> |
| 91 |
<mac>4</mac> |
| 92 |
<windows>4</windows> |
| 93 |
</number> |
| 94 |
<desc>Not used</desc> |
| 95 |
</axis> |
| 96 |
|
| 97 |
<axis> |
| 98 |
<name>Flaps level</name> |
| 99 |
<number> |
| 100 |
<unix>5</unix> |
| 101 |
<mac>5</mac> |
| 102 |
<windows>5</windows> |
| 103 |
</number> |
| 104 |
<desc>Flaps</desc> |
| 105 |
<binding> |
| 106 |
<command>nasal</command> |
| 107 |
<script>setprop('/controls/flight/flaps', normalisedValue());</script> |
| 108 |
</binding> |
| 109 |
</axis> |
| 110 |
|
| 111 |
|
| 112 |
<button> |
| 113 |
<name>A/T disconnect</name> |
| 114 |
<number> |
| 115 |
<unix>0</unix> |
| 116 |
<mac>0</mac> |
| 117 |
<windows>0</windows> |
| 118 |
</number> |
| 119 |
<desc>Auto-Throttle Disconnect</desc> |
| 120 |
<repeatable>false</repeatable> |
| 121 |
<binding> |
| 122 |
<command>nasal</command> |
| 123 |
<script>debug.dump('A/T disconnect')</script> |
| 124 |
</binding> |
| 125 |
</button> |
| 126 |
|
| 127 |
<button n="1"> |
| 128 |
<name>TO/GA</name> |
| 129 |
<number> |
| 130 |
<unix>3</unix> |
| 131 |
<mac>3</mac> |
| 132 |
<windows>3</windows> |
| 133 |
</number> |
| 134 |
<desc>Takeoff/Go-Around</desc> |
| 135 |
<repeatable>false</repeatable> |
| 136 |
<binding> |
| 137 |
<command>nasal</command> |
| 138 |
<script>debug.dump('TO/GA!')</script> |
| 139 |
</binding> |
| 140 |
<binding> |
| 141 |
<command>property-assign</command> |
| 142 |
<property>/controls/autoflight/toga-signal</property> |
| 143 |
<value>true</value> |
| 144 |
</binding> |
| 145 |
</button> |
| 146 |
|
| 147 |
<button n="2"> |
| 148 |
<name>Reverser - right</name> |
| 149 |
<number> |
| 150 |
<unix>1</unix> |
| 151 |
<mac>1</mac> |
| 152 |
<windows>1</windows> |
| 153 |
</number> |
| 154 |
<desc>Right reverser</desc> |
| 155 |
<repeatable>false</repeatable> |
| 156 |
<binding> |
| 157 |
<command>property-assign</command> |
| 158 |
<property>/controls/engines/engine[1]/reverser</property> |
| 159 |
<value>1</value> |
| 160 |
</binding> |
| 161 |
<mod-up> |
| 162 |
<binding> |
| 163 |
<command>property-assign</command> |
| 164 |
<property>/controls/engines/engine[1]/reverser</property> |
| 165 |
<value>0</value> |
| 166 |
</binding> |
| 167 |
</mod-up> |
| 168 |
</button> |
| 169 |
|
| 170 |
|
| 171 |
<button n="3"> |
| 172 |
<name>Reverser - left</name> |
| 173 |
<number> |
| 174 |
<unix>2</unix> |
| 175 |
<mac>2</mac> |
| 176 |
<windows>2</windows> |
| 177 |
</number> |
| 178 |
<desc>Left reverser</desc> |
| 179 |
<repeatable>false</repeatable> |
| 180 |
<binding> |
| 181 |
<command>property-assign</command> |
| 182 |
<property>/controls/engines/engine[0]/reverser</property> |
| 183 |
<value>1</value> |
| 184 |
</binding> |
| 185 |
<mod-up> |
| 186 |
<binding> |
| 187 |
<command>property-assign</command> |
| 188 |
<property>/controls/engines/engine[0]/reverser</property> |
| 189 |
<value>0</value> |
| 190 |
</binding> |
| 191 |
</mod-up> |
| 192 |
</button> |
| 193 |
</PropertyList> |