Debian Codegraph @

gui/dialogs/system-failures.xml

raw symbols SCIP
1 <?xml version="1.0"?>
2
3 <PropertyList>
4
5 <name>system-failures</name>
6 <modal>false</modal>
7 <layout>vbox</layout>
8
9 <nasal>
10 <open>
11 # Code to populate the engine entries.
12 var groups = cmdarg().getChildren("group");
13 var group = groups[1].getChildren("group")[2];
14 var engines = props.globals.getNode("/engines");
15 var row = 4;
16 var engine = 0;
17 var i = 0;
18
19 group.removeChildren("checkbox");
20 group.removeChildren("input");
21 group.removeChildren("text");
22
23 # Copy in the labels.
24 var target = group.getNode("text[" ~ i ~ "]", 1);
25 props.copy(group.getNode("engine-label"), target);
26 i += 1;
27
28 target = group.getNode("text[" ~ i ~ "]", 1);
29 props.copy(group.getNode("mtbf-label"), target);
30 i += 1;
31
32 foreach (var e; engines.getChildren("engine")) {
33 var starter = e.getChild("starter");
34 var running = e.getChild("running");
35
36 (starter != nil and starter != "" and starter.getType() != "NONE")
37 or (running != nil and running != "" and running.getType() != "NONE")
38 or continue;
39
40 row = row + 1;
41
42 # Set up the label
43 target = group.getNode("text[" ~ i ~ "]", 1);
44 props.copy(group.getNode("text-template"), target);
45 target.getNode("row").setValue(row);
46
47 if (size(engines.getChildren("engine")) == 1) {
48 target.getNode("label").setValue("Engine");
49 } else {
50 # Engines are indexed from 1 in the GUI.
51 target.getNode("label").setValue("Engine " ~ (engine + 1));
52 }
53
54 # Now the checkbox
55 target = group.getNode("checkbox[" ~ i ~ "]", 1);
56 props.copy(group.getChild("checkbox-template"), target);
57 target.getNode("row").setValue(row);
58
59 var failure = "/sim/failure-manager/engines/engine[" ~ engine ~ "]/serviceable";
60 target.getNode("property").setValue(failure);
61
62 # Finally the MTBF
63 target = group.getNode("input[" ~ i ~ "]", 1);
64 props.copy(group.getChild("input-template"), target);
65 target.getNode("row").setValue(row);
66 i += 1;
67
68 var mtbf = "/sim/failure-manager/engines/engine[" ~ engine ~ "]/mtbf";
69 target.getNode("property").setValue(mtbf);
70 engine += 1;
71 }
72
73
74 </open>
75 </nasal>
76
77 <group>
78 <layout>hbox</layout>
79
80 <text>
81 <label>System Failures</label>
82 </text>
83
84 <empty><stretch>1</stretch></empty>
85
86 <button>
87 <legend>X</legend>
88 <key>Esc</key>
89 <pref-width>20</pref-width>
90 <pref-height>20</pref-height>
91 <binding>
92 <command>dialog-close</command>
93 </binding>
94 </button>
95 </group>
96
97 <hrule/>
98
99 <text>
100 <halign>left</halign>
101 <label> Uncheck a system to fail it, or set the Mean Time/Cycles Between Failures. </label>
102 </text>
103
104 <hrule/>
105
106 <group>
107 <layout>hbox</layout>
108 <halign>left</halign>
109
110 <group>
111 <layout>table</layout>
112 <halign>center</halign>
113 <valign>top</valign>
114
115 <text>
116 <row>0</row>
117 <col>0</col>
118 <label>System</label>
119 </text>
120
121 <text>
122 <row>0</row>
123 <col>2</col>
124 <label>MTBF (sec)</label>
125 </text>
126
127 <text>
128 <row>1</row>
129 <col>0</col>
130 <halign>right</halign>
131 <label>Vacuum System</label>
132 </text>
133
134 <checkbox>
135 <row>1</row>
136 <col>1</col>
137 <property>/sim/failure-manager/systems/vacuum/serviceable</property>
138 </checkbox>
139
140 <input>
141 <row>1</row>
142 <col>2</col>
143 <property>/sim/failure-manager/systems/vacuum/mtbf</property>
144 </input>
145
146 <text>
147 <row>2</row>
148 <col>0</col>
149 <halign>right</halign>
150 <label>Static System</label>
151 </text>
152
153 <checkbox>
154 <row>2</row>
155 <col>1</col>
156 <property>/sim/failure-manager/systems/static/serviceable</property>
157 </checkbox>
158
159 <input>
160 <row>2</row>
161 <col>2</col>
162 <property>/sim/failure-manager/systems/static/mtbf</property>
163 </input>
164
165 <text>
166 <row>3</row>
167 <col>0</col>
168 <halign>right</halign>
169 <label>Pitot System</label>
170 </text>
171
172 <checkbox>
173 <row>3</row>
174 <col>1</col>
175 <property>/sim/failure-manager/systems/pitot/serviceable</property>
176 </checkbox>
177
178 <input>
179 <row>3</row>
180 <col>2</col>
181 <property>/sim/failure-manager/systems/pitot/mtbf</property>
182 </input>
183
184 <text>
185 <row>4</row>
186 <col>0</col>
187 <halign>right</halign>
188 <label> Electrical System</label>
189 </text>
190
191 <checkbox>
192 <row>4</row>
193 <col>1</col>
194 <property>/sim/failure-manager/systems/electrical/serviceable</property>
195 </checkbox>
196
197 <input>
198 <row>4</row>
199 <col>2</col>
200 <property>/sim/failure-manager/systems/electrical/mtbf</property>
201 </input>
202
203 <text>
204 <row>5</row>
205 <col>0</col>
206 <halign>right</halign>
207 <label>Aileron</label>
208 </text>
209
210 <checkbox>
211 <row>5</row>
212 <col>1</col>
213 <property>/sim/failure-manager/controls/flight/aileron/serviceable</property>
214 </checkbox>
215
216 <input>
217 <row>5</row>
218 <col>2</col>
219 <property>/sim/failure-manager/controls/flight/aileron/mtbf</property>
220 </input>
221
222 <text>
223 <row>6</row>
224 <col>0</col>
225 <halign>right</halign>
226 <label>Elevator</label>
227 </text>
228
229 <checkbox>
230 <row>6</row>
231 <col>1</col>
232 <property>/sim/failure-manager/controls/flight/elevator/serviceable</property>
233 </checkbox>
234
235 <input>
236 <row>6</row>
237 <col>2</col>
238 <property>/sim/failure-manager/controls/flight/elevator/mtbf</property>
239 </input>
240
241 <text>
242 <row>7</row>
243 <col>0</col>
244 <halign>right</halign>
245 <label>Rudder</label>
246 </text>
247
248 <checkbox>
249 <row>7</row>
250 <col>1</col>
251 <property>/sim/failure-manager/controls/flight/rudder/serviceable</property>
252 </checkbox>
253
254 <input>
255 <row>7</row>
256 <col>2</col>
257 <property>/sim/failure-manager/controls/flight/rudder/mtbf</property>
258 </input>
259
260
261 </group>
262
263 <vrule/>
264
265 <group>
266 <layout>table</layout>
267 <halign>center</halign>
268 <valign>top</valign>
269
270 <text>
271 <row>0</row>
272 <col>0</col>
273 <label>System</label>
274 </text>
275
276 <text>
277 <row>0</row>
278 <col>2</col>
279 <label>MCBF</label>
280 </text>
281
282 <text>
283 <row>1</row>
284 <col>0</col>
285 <halign>right</halign>
286 <label>Landing Gear</label>
287 </text>
288
289 <checkbox>
290 <row>1</row>
291 <col>1</col>
292 <property>/sim/failure-manager/controls/gear/serviceable</property>
293 </checkbox>
294
295 <input>
296 <row>1</row>
297 <col>2</col>
298 <property>/sim/failure-manager/controls/gear/mcbf</property>
299 </input>
300
301 <text>
302 <row>2</row>
303 <col>0</col>
304 <halign>right</halign>
305 <label>Flaps</label>
306 </text>
307
308 <checkbox>
309 <row>2</row>
310 <col>1</col>
311 <property>/sim/failure-manager/controls/flight/flaps/serviceable</property>
312 </checkbox>
313
314 <input>
315 <row>2</row>
316 <col>2</col>
317 <property>/sim/failure-manager/controls/flight/flaps/mcbf</property>
318 </input>
319
320 <text>
321 <row>3</row>
322 <col>0</col>
323 <halign>right</halign>
324 <label>Speedbrake</label>
325 </text>
326
327 <checkbox>
328 <row>3</row>
329 <col>1</col>
330 <property>/sim/failure-manager/controls/flight/speedbrake/serviceable</property>
331 </checkbox>
332
333 <input>
334 <row>3</row>
335 <col>2</col>
336 <property>/sim/failure-manager/controls/flight/speedbrake/mcbf</property>
337 </input>
338 </group>
339
340 <vrule/>
341
342 <group>
343 <layout>table</layout>
344 <halign>center</halign>
345 <valign>top</valign>
346
347 <engine-label>
348 <row>0</row>
349 <col>0</col>
350 <label>Engine</label>
351 </engine-label>
352
353 <mtbf-label>
354 <row>0</row>
355 <col>2</col>
356 <label>MTBF</label>
357 </mtbf-label>
358
359 <text-template>
360 <row><!-- template value--></row>
361 <col>0</col>
362 <halign>right</halign>
363 <label><!-- template value--></label>
364 </text-template>
365
366 <checkbox-template>
367 <row><!-- template value--></row>
368 <col>1</col>
369 <property><!-- template value--></property>
370 </checkbox-template>
371
372 <input-template>
373 <row><!-- template value--></row>
374 <col>2</col>
375 <property><!-- template value--></property>
376 </input-template>
377
378 </group>
379
380 <!-- only for a gap -->
381 <group>
382 <layout>vbox</layout>
383 <default-padding>1</default-padding>
384 <text>
385 <label> </label>
386 </text>
387 </group>
388
389 </group>
390
391 <hrule/>
392
393 <group>
394 <layout>hbox</layout>
395 <default-padding>7</default-padding>
396
397 <button>
398 <legend>OK</legend>
399 <default>true</default>
400 <equal>true</equal>
401 <binding>
402 <command>dialog-apply</command>
403 </binding>
404 <binding>
405 <command>dialog-close</command>
406 </binding>
407 </button>
408
409 <button>
410 <legend>Apply</legend>
411 <equal>true</equal>
412 <binding>
413 <command>dialog-apply</command>
414 </binding>
415 </button>
416
417 <button>
418 <legend>Refresh</legend>
419 <equal>true</equal>
420 <binding>
421 <command>dialog-update</command>
422 </binding>
423 </button>
424
425 <button>
426 <legend>Cancel</legend>
427 <equal>true</equal>
428 <key>Esc</key>
429 <binding>
430 <command>dialog-close</command>
431 </binding>
432 </button>
433
434 </group>
435
436 </PropertyList>