Debian Codegraph @

gui/dialogs/button-axis-config.xml

raw symbols SCIP
1 <?xml version="1.0"?>
2
3 <PropertyList>
4 <nasal>
5 <open><![CDATA[
6
7 var curpower = getprop("/sim/gui/dialogs/joystick-config/axis[" ~ getprop("/sim/gui/dialogs/joystick-config/current-axis") ~ "]/power");
8 if (curpower == nil)
9 curpower = 1.0;
10 setprop("/sim/gui/dialogs/joystick-config/gui-factor",curpower);
11
12 var assignAxis = func(cmd) {
13 var i = getprop("/sim/gui/dialogs/joystick-config/current-axis");
14 if (cmd != nil)
15 setprop("/sim/gui/dialogs/joystick-config/axis[" ~ i ~ "]/binding", cmd);
16 setprop("/sim/gui/dialogs/joystick-config/axis[" ~ i ~ "]/power", getprop("/sim/gui/dialogs/joystick-config/gui-factor"));
17 joystick.writeConfig();
18 fgcommand("reinit", props.Node.new({"subsystem": "input"}));
19 fgcommand("dialog-close", props.Node.new({"dialog-name": "button-axis-config"}));
20 fgcommand("dialog-close", props.Node.new({"dialog-name": "joystick-config"}));
21 fgcommand("dialog-show", props.Node.new({"dialog-name": "joystick-config"}));
22 }
23 ]]></open>
24
25 <close><![CDATA[
26 ]]></close>
27 </nasal>
28
29
30 <name>button-axis-config</name>
31 <layout>vbox</layout>
32 <resizable>true</resizable>
33 <modal>true</modal>
34 <default-padding>3</default-padding>
35
36 <group>
37 <layout>hbox</layout>
38 <default-padding>1</default-padding>
39
40 <text>
41 <label>Joystick Axis Configuration</label>
42 </text>
43
44 <empty><stretch>true</stretch></empty>
45
46 <button>
47 <legend>X</legend>
48 <key>Esc</key>
49 <pref-width>20</pref-width>
50 <pref-height>20</pref-height>
51 <binding>
52 <command>dialog-close</command>
53 </binding>
54 </button>
55 </group>
56
57 <hrule/>
58
59 <text>
60 <halign>left</halign>
61 <label>Select the operation to assign to this axis.</label>
62 </text>
63
64 <hrule/>
65
66 <group>
67 <layout>table</layout>
68
69 <text>
70 <row>0</row>
71 <col>0</col>
72 <label>Flight Controls</label>
73 </text>
74
75 <button>
76 <row>1</row>
77 <col>0</col>
78 <halign>fill</halign>
79 <legend>Aileron</legend>
80 <binding>
81 <command>nasal</command>
82 <script>
83 assignAxis("Aileron");
84 </script>
85 </binding>
86 </button>
87
88 <button>
89 <row>2</row>
90 <col>0</col>
91 <halign>fill</halign>
92 <legend>Elevator</legend>
93 <binding>
94 <command>nasal</command>
95 <script>
96 assignAxis("Elevator");
97 </script>
98 </binding>
99 </button>
100
101 <button>
102 <row>3</row>
103 <col>0</col>
104 <halign>fill</halign>
105 <legend>Rudder</legend>
106 <binding>
107 <command>nasal</command>
108 <script>
109 assignAxis("Rudder");
110 </script>
111 </binding>
112 </button>
113
114 <button>
115 <row>4</row>
116 <col>0</col>
117 <halign>fill</halign>
118 <legend>Brake Left</legend>
119 <binding>
120 <command>nasal</command>
121 <script>
122 assignAxis("Brake Left");
123 </script>
124 </binding>
125 </button>
126
127 <button>
128 <row>5</row>
129 <col>0</col>
130 <halign>fill</halign>
131 <legend>Brake Right</legend>
132 <binding>
133 <command>nasal</command>
134 <script>
135 assignAxis("Brake Right");
136 </script>
137 </binding>
138 </button>
139 <button>
140 <row>6</row>
141 <col>0</col>
142 <halign>fill</halign>
143 <legend>Flaps</legend>
144 <binding>
145 <command>nasal</command>
146 <script>
147 assignAxis("Flaps");
148 </script>
149 </binding>
150 </button>
151 <button>
152 <row>7</row>
153 <col>0</col>
154 <halign>fill</halign>
155 <legend>Wings</legend>
156 <binding>
157 <command>nasal</command>
158 <script>
159 assignAxis("Wings");
160 </script>
161 </binding>
162 </button>
163
164
165 <text>
166 <row>0</row>
167 <col>3</col>
168 <label>Trim</label>
169 </text>
170
171
172 <button>
173 <row>1</row>
174 <col>3</col>
175 <halign>fill</halign>
176 <legend>Aileron Trim to position</legend>
177 <binding>
178 <command>nasal</command>
179 <script>
180 assignAxis("Aileron Trim");
181 </script>
182 </binding>
183 </button>
184 <button>
185 <row>2</row>
186 <col>3</col>
187 <halign>fill</halign>
188 <legend>Elevator Trim to position</legend>
189 <binding>
190 <command>nasal</command>
191 <script>
192 assignAxis("Elevator Trim");
193 </script>
194 </binding>
195 </button>
196 <button>
197 <row>3</row>
198 <col>3</col>
199 <halign>fill</halign>
200 <legend>Rudder Trim to position</legend>
201 <binding>
202 <command>nasal</command>
203 <script>
204 assignAxis("Rudder Trim");
205 </script>
206 </binding>
207 </button>
208
209
210 <button>
211 <row>4</row>
212 <col>3</col>
213 <halign>fill</halign>
214 <legend>Aileron Trim inc.</legend>
215 <binding>
216 <command>nasal</command>
217 <script>
218 assignAxis("Aileron Trim inc.");
219 </script>
220 </binding>
221 </button>
222 <button>
223 <row>5</row>
224 <col>3</col>
225 <halign>fill</halign>
226 <legend>Elevator Trim inc.</legend>
227 <binding>
228 <command>nasal</command>
229 <script>
230 assignAxis("Elevator Trim inc.");
231 </script>
232 </binding>
233 </button>
234 <button>
235 <row>6</row>
236 <col>3</col>
237 <halign>fill</halign>
238 <legend>Rudder Trim inc.</legend>
239 <binding>
240 <command>nasal</command>
241 <script>
242 assignAxis("Rudder Trim inc.");
243 </script>
244 </binding>
245 </button>
246
247
248
249 <text>
250 <row>0</row>
251 <col>1</col>
252 <label>Engines</label>
253 </text>
254
255 <button>
256 <row>1</row>
257 <col>1</col>
258 <halign>fill</halign>
259 <legend>Throttle All Engines</legend>
260 <binding>
261 <command>nasal</command>
262 <script>
263 assignAxis("Throttle All Engines");
264 </script>
265 </binding>
266 </button>
267
268 <button>
269 <row>2</row>
270 <col>1</col>
271 <halign>fill</halign>
272 <legend>Mixture All Engines</legend>
273 <binding>
274 <command>nasal</command>
275 <script>
276 assignAxis("Mixture All Engines");
277 </script>
278 </binding>
279 </button>
280
281 <button>
282 <row>3</row>
283 <col>1</col>
284 <halign>fill</halign>
285 <legend>Propeller All Engines</legend>
286 <binding>
287 <command>nasal</command>
288 <script>
289 assignAxis("Propeller All Engines");
290 </script>
291 </binding>
292 </button>
293
294 <button>
295 <row>4</row>
296 <col>1</col>
297 <halign>fill</halign>
298 <legend>Throttle Engine 0</legend>
299 <binding>
300 <command>nasal</command>
301 <script>
302 assignAxis("Throttle Engine 0");
303 </script>
304 </binding>
305 </button>
306
307 <button>
308 <row>5</row>
309 <col>1</col>
310 <halign>fill</halign>
311 <legend>Mixture Engine 0</legend>
312 <binding>
313 <command>nasal</command>
314 <script>
315 assignAxis("Mixture Engine 0");
316 </script>
317 </binding>
318 </button>
319
320 <button>
321 <row>6</row>
322 <col>1</col>
323 <halign>fill</halign>
324 <legend>Propeller Pitch Engine 0</legend>
325 <binding>
326 <command>nasal</command>
327 <script>
328 assignAxis("Propeller Pitch Engine 0");
329 </script>
330 </binding>
331 </button>
332 <button>
333 <row>7</row>
334 <col>1</col>
335 <halign>fill</halign>
336 <legend>Throttle Engine 1</legend>
337 <binding>
338 <command>nasal</command>
339 <script>
340 assignAxis("Throttle Engine 1");
341 </script>
342 </binding>
343 </button>
344 <button>
345 <row>8</row>
346 <col>1</col>
347 <halign>fill</halign>
348 <legend>Mixture Engine 1</legend>
349 <binding>
350 <command>nasal</command>
351 <script>
352 assignAxis("Mixture Engine 1");
353 </script>
354 </binding>
355 </button>
356
357 <button>
358 <row>9</row>
359 <col>1</col>
360 <halign>fill</halign>
361 <legend>Propeller Pitch Engine 1</legend>
362 <binding>
363 <command>nasal</command>
364 <script>
365 assignAxis("Propeller Pitch Engine 1");
366 </script>
367 </binding>
368 </button>
369
370 <button>
371 <row>10</row>
372 <col>1</col>
373 <halign>fill</halign>
374 <legend>Reverser All Engines</legend>
375 <binding>
376 <command>nasal</command>
377 <script>
378 assignAxis("Reverser All Engines");
379 </script>
380 </binding>
381 </button>
382
383 <text>
384 <row>0</row>
385 <col>2</col>
386 <label>Other</label>
387 </text>
388
389 <button>
390 <row>1</row>
391 <col>2</col>
392 <halign>fill</halign>
393 <legend>View (horizontal)</legend>
394 <binding>
395 <command>nasal</command>
396 <script>
397 assignAxis("View (horizontal)");
398 </script>
399 </binding>
400 </button>
401
402 <button>
403 <row>2</row>
404 <col>2</col>
405 <halign>fill</halign>
406 <legend>View (vertical)</legend>
407 <binding>
408 <command>nasal</command>
409 <script>
410 assignAxis("View (vertical)");
411 </script>
412 </binding>
413 </button>
414
415 <button>
416 <row>3</row>
417 <col>2</col>
418 <halign>fill</halign>
419 <legend>View Horizontal Axis</legend>
420 <binding>
421 <command>nasal</command>
422 <script>
423 assignAxis("View Horizontal Axis");
424 </script>
425 </binding>
426 </button>
427
428 <button>
429 <row>4</row>
430 <col>2</col>
431 <halign>fill</halign>
432 <legend>View Vertical Axis</legend>
433 <binding>
434 <command>nasal</command>
435 <script>
436 assignAxis("View Vertical Axis");
437 </script>
438 </binding>
439 </button>
440
441
442 <slider>
443 <row>11</row>
444 <col>0</col>
445 <colspan>1</colspan>
446 <name>sensitivity</name>
447 <min>0</min>
448 <max>5</max>
449 <step>0.1</step>
450 <live>true</live>
451 <property>/sim/gui/dialogs/joystick-config/gui-factor</property>
452 <binding>
453 <command>dialog-apply</command>
454 <object-name>sensitivity</object-name>
455 </binding>
456 </slider>
457
458 <text>
459 <row>11</row>
460 <col>1</col>
461 <halign>left</halign>
462 <format>Sensitivity Reduction %2.1f</format>
463 <label>0</label>
464 <property>/sim/gui/dialogs/joystick-config/gui-factor</property>
465 <live>true</live>
466 </text>
467
468 <button>
469 <row>11</row>
470 <col>2</col>
471 <halign>fill</halign>
472 <legend>Apply sensitivity</legend>
473 <binding>
474 <command>nasal</command>
475 <script>
476 assignAxis(nil);
477 </script>
478 </binding>
479 </button>
480
481 </group>
482
483
484 <group>
485 <empty>
486 <stretch>true</stretch>
487 </empty>
488 <layout>hbox</layout>
489
490 <button>
491 <row>5</row>
492 <col>2</col>
493 <halign>fill</halign>
494 <legend>Remove assignment</legend>
495 <binding>
496 <command>nasal</command>
497 <script>
498 assignAxis("None");
499 </script>
500 </binding>
501 </button>
502
503 <button>
504 <legend>Close</legend>
505 <default>true</default>
506 <key>Esc</key>
507 <binding>
508 <command>dialog-close</command>
509 </binding>
510 </button>
511 <empty>
512 <stretch>true</stretch>
513 </empty>
514 </group>
515
516 </PropertyList>