commit initial
|
1 |
var displayClass = { |
2 |
new: func(node, role) { |
|
3 |
var m = { parents: [ displayClass ] }; |
|
4 |
|
|
5 |
m.display = canvas.new({ |
|
6 |
"name" : role, |
|
7 |
"size" : [1024, 768], |
|
8 |
"view" : [1024, 768], |
|
9 |
"mipmapping": 1 |
|
10 |
}); |
|
11 |
m.display.addPlacement({ |
|
12 |
"node": "Screen", |
|
13 |
"parent": role |
|
14 |
}); |
|
15 |
m.display.setColorBackground(0,0,0); |
|
16 |
m.role = role; |
|
écriture du wrapper pour le ...
|
17 |
m.screenElements = {}; |
commit initial
|
18 | |
19 |
return m; |
|
20 |
}, |
|
21 | ||
22 |
loadsvg : func () { |
|
23 |
me.screen = me.display.createGroup(); |
|
24 |
me.screen.hide(); |
|
25 |
canvas.parsesvg(me.screen, "Aircraft/Instruments-3d/zkv1000/Systems/screen.svg"); |
|
26 |
}, |
|
27 | ||
28 |
_showInitProgress : func (p,t) { |
|
29 |
p.setText(t); |
|
30 |
if (zkv.getNode(me.role ~ 'init').getValue() != 0) { |
|
31 |
if (size(t) >= 10) t = ''; |
|
32 |
settimer(func { me._showInitProgress(p, t ~ '.'); }, 0.1); |
|
33 |
} |
|
34 |
else { |
|
35 |
me.progress.hide(); |
|
36 |
me.screen.show(); |
|
séparation configuration PFD...
|
37 |
var groups = { |
animation VSI
|
38 |
show : [ |
commit initial
|
39 |
'SoftKeysTexts', |
40 |
'COMM', |
|
41 |
'NAV', |
|
ajout COMM, et factorisation...
|
42 |
'nav-freq-switch', |
43 |
'comm-freq-switch', |
|
séparation configuration PFD...
|
44 |
], |
45 |
text: [ |
|
46 |
'nav1-standby-freq', 'nav1-selected-freq', 'nav1-id', |
|
47 |
'nav2-standby-freq', 'nav2-selected-freq', 'nav2-id', |
|
ajout COMM, et factorisation...
|
48 |
'comm1-standby-freq', 'comm1-selected-freq', |
49 |
'comm2-standby-freq', 'comm2-selected-freq', |
|
séparation configuration PFD...
|
50 |
], |
ajout COMM, et factorisation...
|
51 |
hide : [ ], |
séparation configuration PFD...
|
52 |
clip: [ ], |
53 |
}; |
|
54 |
if (me.role == 'PFD') { |
|
55 |
append(groups.show, |
|
commit initial
|
56 |
'XPDR-TIME', |
AI disponible
|
57 |
'FlightInstruments', |
58 |
'Horizon', |
|
AI disponible, avec bankPoin...
|
59 |
'bankPointer', |
animation VSI
|
60 |
'VSI', |
animation HSI
|
61 |
'Rose', |
séparation configuration PFD...
|
62 |
); |
63 |
append(groups.hide, |
|
NAV disponible (hors CDI)
|
64 |
'CDI', |
animation HSI
|
65 |
'NAV1-pointer', |
66 |
'NAV2-pointer', |
|
67 |
'GPS-pointer', |
|
68 |
'Bearing1', |
|
69 |
'Bearing2', |
|
séparation configuration PFD...
|
70 |
); |
71 |
append(groups.clip, |
|
animation IAS
|
72 |
'SpeedLint1', |
animation ALT
|
73 |
'SpeedTape', |
74 |
'LintAlt', |
|
75 |
'AltLint00011' |
|
76 |
); |
|
séparation configuration PFD...
|
77 |
append(groups.text, |
78 |
'VSIText', |
|
79 |
'Speed110', |
|
80 |
'Alt11100', |
|
81 |
'HDG-text', |
|
82 |
'AltBigC', 'AltSmallC' |
|
83 |
); |
|
84 |
for (var place = 1; place <= 6; place +=1) { |
|
85 |
append(groups.text, |
|
86 |
'AltBigU' ~ place, |
|
87 |
'AltSmallU' ~ place, |
|
88 |
'AltBigD' ~ place, |
|
89 |
'AltSmallD' ~ place |
|
90 |
); |
|
91 |
} |
|
animation ALT
|
92 |
} |
séparation configuration PFD...
|
93 |
else |
94 |
append(groups.show, 'Header'); |
|
95 | ||
96 |
me.loadGroup(groups); |
|
animation ALT
|
97 | |
séparation configuration PFD...
|
98 |
if (me.role == 'PFD') { |
99 |
me.updateAI(getprop('/orientation/roll-deg'),getprop('orientation/pitch-deg')); |
|
100 |
me.updateVSI(getprop('/instrumentation/vertical-speed-indicator/indicated-speed-fpm')); |
|
101 |
me.updateIAS(getprop('/velocities/airspeed-kt')); |
|
102 |
me.updateALT(getprop('instrumentation/altimeter/indicated-altitude-ft')); |
|
103 |
me.updateHSI(getprop('orientation/heading-deg')); |
|
104 |
} |
|
ajout COMM, et factorisation...
|
105 |
me._updateRadio({auto:'nav'}); |
106 |
me._updateRadio({auto:'comm'}); |
|
commit initial
|
107 |
me.progress.removeAllChildren(); |
108 |
me.progress = nil; |
|
109 |
me.showInitProgress = nil; |
|
110 |
me._showInitProgress = nil; |
|
111 |
zkv.removeChild(me.role ~ 'init'); |
|
112 |
} |
|
113 |
}, |
|
114 | ||
115 |
showInitProgress : func (role) { |
|
116 |
me.progress = me.display.createGroup(); |
|
117 |
me.progress.show(); |
|
118 |
me.progress.createChild("text", role ~ " title") |
|
119 |
.setTranslation(512, 384) |
|
120 |
.setAlignment("center-center") |
|
121 |
.setFont("LiberationFonts/LiberationSans-Italic.ttf") |
|
122 |
.setFontSize(64, 1) |
|
123 |
.setColor(1,1,1) |
|
124 |
.setText("ZKV1000 " ~ role ~ " init"); |
|
125 | ||
126 |
zkv.getNode(role ~ 'init',1).setIntValue(1); |
|
127 | ||
128 |
me._showInitProgress(me.progress.createChild("text", role ~ "progress") |
|
129 |
.setTranslation(512, 484) |
|
130 |
.setAlignment("center-center") |
|
131 |
.setFont("LiberationFonts/LiberationSans-Bold.ttf") |
|
132 |
.setFontSize(128, 1) |
|
133 |
.setColor(1,0,0), '.'); |
|
134 |
}, |
|
135 | ||
écriture du wrapper pour le ...
|
136 |
loadGroup : func (h) { |
137 |
if (typeof(h) != 'hash') { |
|
138 |
msg_dbg(sprintf("%s need a hash, but get a %s from %s", |
|
139 |
caller(0)[0], |
|
140 |
typeof(h), |
|
141 |
caller(1)[0])); |
|
142 |
return; |
|
commit initial
|
143 |
} |
écriture du wrapper pour le ...
|
144 |
var setMethod = func (e, t) { |
145 |
if (t == 'hide') |
|
146 |
me.screenElements[e].hide(); |
|
147 |
elsif (t == 'show') |
|
148 |
me.screenElements[e].show(); |
|
AI disponible
|
149 |
elsif (t == 'rot' or t == 'trans') { |
150 |
if (! contains(me.screenElements[e], t)) |
|
151 |
me.screenElements[e][t] = me.screenElements[e].createTransform(); |
|
152 |
} |
|
153 |
elsif (t == 'clip') { |
|
154 |
if (contains(me.clips, e)) |
|
155 |
me.screenElements[e].set("clip", me.clips[e]); |
|
156 |
else |
|
157 |
print('no defined clip for ' ~ e); |
|
158 |
} |
|
animation VSI
|
159 |
elsif (t == 'text') { |
160 |
if (contains(me.texts, e)) { |
|
161 |
if (contains(me.texts[e], 'alignment')) |
|
162 |
me.screenElements[e].setAlignment(me.texts[e].alignment); |
|
163 |
if (contains(me.texts[e], 'default')) |
|
164 |
me.screenElements[e].setText(me.texts[e].default); |
|
NAV disponible (hors CDI)
|
165 |
if (contains(me.texts[e], 'color')) |
166 |
me.screenElements[e].setColor(me.texts[e].color); |
|
animation VSI
|
167 |
} |
clean pre-merge
|
168 |
# else |
169 |
# print('no text format for ' ~ e); |
|
animation VSI
|
170 |
} |
commit initial
|
171 |
else |
écriture du wrapper pour le ...
|
172 |
print('unknown method ' ~ t); |
173 |
}; |
|
174 |
foreach (var todo; keys(h)) { |
|
175 |
if (typeof(h[todo]) != 'vector') h[todo] = [ h[todo] ]; |
|
176 |
foreach (var id; h[todo]) { |
|
177 |
if (! contains(me.screenElements, id)) { |
|
178 |
me.screenElements[id] = me.screen.getElementById(id); |
|
179 |
if (me.screenElements[id] != nil) |
|
180 |
setMethod(id, todo); |
|
181 |
else |
|
182 |
print('SVG ID ' ~ id ~ ' not found'); |
|
183 |
} |
|
184 |
else |
|
185 |
setMethod(id, todo); |
|
186 |
} |
|
commit initial
|
187 |
} |
188 |
}, |
|
AI disponible
|
189 | |
190 |
clips : { |
|
clean pre-merge
|
191 |
PitchScale : "rect(70,664,370,256)", |
192 |
SpeedLint1 : "rect(252,226,318,204)", |
|
193 |
SpeedTape : "rect(115,239,455,156)", |
|
194 |
LintAlt : "rect(115,808,455,704)", |
|
animation ALT
|
195 |
AltLint00011 : "rect(252,804,318,771)", |
AI disponible
|
196 |
}, |
197 | ||
animation VSI
|
198 |
texts : { |
199 |
VSIText : { |
|
200 |
alignment: "right-bottom", default : num('0'), |
|
201 |
}, |
|
animation IAS
|
202 |
Speed110 : { |
NAV disponible (hors CDI)
|
203 |
alignment : 'left-bottom' |
animation IAS
|
204 |
}, |
animation ALT (2)
|
205 |
Alt11100 : { |
NAV disponible (hors CDI)
|
206 |
alignment:'left-bottom' |
animation ALT (2)
|
207 |
}, |
clean pre-merge
|
208 |
"HDG-text" : { |
209 |
default: '---°' |
|
210 |
}, |
|
NAV disponible (hors CDI)
|
211 |
'nav1-standby-freq' : { |
212 |
color: [0, 1, 1], |
|
213 |
}, |
|
214 |
'nav1-id' : { |
|
215 |
default: '' |
|
216 |
}, |
|
217 |
'nav2-id' : { |
|
218 |
default: '' |
|
219 |
}, |
|
animation VSI
|
220 |
}, |
221 | ||
AI disponible, avec bankPoin...
|
222 |
updateAI: func(roll,pitch){ |
AI disponible
|
223 |
if (pitch > 80) |
224 |
pitch = 80; |
|
clean pre-merge
|
225 |
elsif (pitch < -80) |
AI disponible
|
226 |
pitch = -80; |
227 |
me.screenElements.Horizon |
|
228 |
.setRotation(-roll * D2R) |
|
229 |
.setTranslation(0, pitch * 6.8571428); |
|
AI disponible, avec bankPoin...
|
230 |
me.screenElements.bankPointer |
231 |
.setRotation(-roll * D2R); |
|
232 |
settimer(func me.updateAI(getprop('/orientation/roll-deg'),getprop('orientation/pitch-deg')), 0.1); |
|
AI disponible
|
233 |
}, |
animation VSI
|
234 | |
235 |
updateVSI: func (vsi) { |
|
236 |
me.screenElements.VSIText |
|
237 |
.setText(num(math.round(vsi, 10))); |
|
238 |
if (vsi > 4500) |
|
239 |
vsi = 4500; |
|
240 |
elsif (vsi < -4500) |
|
241 |
vsi = -4500; |
|
242 |
me.screenElements.VSI |
|
243 |
.setTranslation(0, vsi * -0.03465); |
|
244 |
settimer(func me.updateVSI(getprop('/instrumentation/vertical-speed-indicator/indicated-speed-fpm')), 0.1); |
|
245 |
}, |
|
animation IAS
|
246 | |
247 |
updateIAS: func (ias) { |
|
248 |
if (ias >= 10) |
|
249 |
me.screenElements.Speed110 |
|
250 |
.setText(sprintf("% 2u",num(math.floor(ias/10)))); |
|
251 |
else |
|
252 |
me.screenElements.Speed110 |
|
253 |
.setText(''); |
|
254 |
me.screenElements.SpeedLint1 |
|
255 |
.setTranslation(0,(math.mod(ias,10) + (ias >= 10)*10) * 36); |
|
256 |
me.screenElements.SpeedTape |
|
257 |
.setTranslation(0,ias * 5.711); |
|
258 |
settimer(func me.updateIAS(getprop('/velocities/airspeed-kt')), 0.1); |
|
259 |
}, |
|
animation ALT
|
260 | |
261 |
updateALT: func (alt) { |
|
262 |
if (alt < 0) |
|
263 |
me.screenElements.Alt11100 |
|
264 |
.setText(sprintf("% 3i",math.ceil(alt/100))); |
|
265 |
elsif (alt < 100) |
|
266 |
me.screenElements.Alt11100 |
|
267 |
.setText(''); |
|
268 |
else |
|
269 |
me.screenElements.Alt11100 |
|
270 |
.setText(sprintf("% 3i",math.floor(alt/100))); |
|
271 |
me.screenElements.AltLint00011 |
|
272 |
.setTranslation(0,math.fmod(alt,100) * 1.24); |
|
273 | ||
274 |
# From Farmin/G1000 http://wiki.flightgear.org/Project_Farmin/FG1000 |
|
275 |
if (alt> -1000 and alt< 1000000) { |
|
276 |
var Offset10 = 0; |
|
277 |
var Offset100 = 0; |
|
278 |
var Offset1000 = 0; |
|
279 |
if (alt< 0) { |
|
280 |
var Ne = 1; |
|
281 |
var alt= -alt; |
|
282 |
} |
|
283 |
else |
|
284 |
var Ne = 0; |
|
285 | ||
286 |
var Alt10 = math.mod(alt,100); |
|
287 |
var Alt100 = int(math.mod(alt/100,10)); |
|
288 |
var Alt1000 = int(math.mod(alt/1000,10)); |
|
289 |
var Alt10000 = int(math.mod(alt/10000,10)); |
|
290 |
var Alt20 = math.mod(Alt10,20)/20; |
|
291 |
if (Alt10 >= 80) |
|
292 |
var Alt100 += Alt20; |
|
293 | ||
294 |
if (Alt10 >= 80 and Alt100 >= 9) |
|
295 |
var Alt1000 += Alt20; |
|
296 | ||
297 |
if (Alt10 >= 80 and Alt100 >= 9 and Alt1000 >= 9) |
|
298 |
var Alt10000 += Alt20; |
|
299 | ||
300 |
if (alt> 100) |
|
301 |
var Offset10 = 100; |
|
302 | ||
303 |
if (alt> 1000) |
|
304 |
var Offset100 = 10; |
|
305 | ||
306 |
if (alt> 10000) |
|
307 |
var Offset1000 = 10; |
|
308 | ||
309 |
if (!Ne) { |
|
310 |
me.screenElements.LintAlt.setTranslation(0,(math.mod(alt,100))*0.57375); |
|
311 |
var altCentral = (int(alt/100)*100); |
|
312 |
} |
|
313 |
elsif (Ne) { |
|
314 |
me.screenElements.LintAlt.setTranslation(0,(math.mod(alt,100))*-0.57375); |
|
315 |
var altCentral = -(int(alt/100)*100); |
|
316 |
} |
|
317 |
me.screenElements["AltBigC"].setText(""); |
|
318 |
me.screenElements["AltSmallC"].setText(""); |
|
319 |
for (var place = 1; place <= 6; place += 1) { |
|
320 |
var altUP = altCentral + (place*100); |
|
321 |
var offset = -30.078; |
|
322 |
if (altUP < 0) { |
|
323 |
var altUP = -altUP; |
|
324 |
var prefix = "-"; |
|
325 |
var offset += 15.039; |
|
326 |
} |
|
327 |
else |
|
328 |
var prefix = ""; |
|
329 | ||
330 |
if (altUP == 0) { |
|
331 |
var AltBigUP = ""; |
|
332 |
var AltSmallUP = "0"; |
|
333 | ||
334 |
} |
|
335 |
elsif (math.mod(altUP,500) == 0 and altUP != 0) { |
|
336 |
var AltBigUP = sprintf(prefix~"%1d", altUP); |
|
337 |
var AltSmallUP = ""; |
|
338 |
} |
|
339 |
elsif (altUP < 1000 and (math.mod(altUP,500))) { |
|
340 |
var AltBigUP = ""; |
|
341 |
var AltSmallUP = sprintf(prefix~"%1d", int(math.mod(altUP,1000))); |
|
342 |
var offset = -30.078; |
|
343 |
} |
|
344 |
elsif ((altUP < 10000) and (altUP >= 1000) and (math.mod(altUP,500))) { |
|
345 |
var AltBigUP = sprintf(prefix~"%1d", int(altUP/1000)); |
|
346 |
var AltSmallUP = sprintf("%1d", int(math.mod(altUP,1000))); |
|
347 |
var offset += 15.039; |
|
348 |
} |
|
349 |
else { |
|
350 |
var AltBigUP = sprintf(prefix~"%1d", int(altUP/1000)); |
|
351 |
var mod = int(math.mod(altUP,1000)); |
|
352 |
var AltSmallUP = sprintf("%1d", mod); |
|
353 |
var offset += 30.078; |
|
354 |
} |
|
355 | ||
356 |
me.screenElements["AltBigU"~place].setText(AltBigUP); |
|
357 |
me.screenElements["AltSmallU"~place].setText(AltSmallUP); |
|
358 |
me.screenElements["AltSmallU"~place].setTranslation(offset,0); |
|
359 |
var altDOWN = altCentral - (place*100); |
|
360 |
var offset = -30.078; |
|
361 |
if (altDOWN < 0) { |
|
362 |
var altDOWN = -altDOWN; |
|
363 |
var prefix = "-"; |
|
364 |
var offset += 15.039; |
|
365 |
} |
|
366 |
else |
|
367 |
var prefix = ""; |
|
368 | ||
369 |
if (altDOWN == 0) { |
|
370 |
var AltBigDOWN = ""; |
|
371 |
var AltSmallDOWN = "0"; |
|
372 |
} |
|
373 |
elsif (math.mod(altDOWN,500) == 0 and altDOWN != 0) { |
|
374 |
var AltBigDOWN = sprintf(prefix~"%1d", altDOWN); |
|
375 |
var AltSmallDOWN = ""; |
|
376 |
} |
|
377 |
elsif (altDOWN < 1000 and (math.mod(altDOWN,500))) { |
|
378 |
var AltBigDOWN = ""; |
|
379 |
var AltSmallDOWN = sprintf(prefix~"%1d", int(math.mod(altDOWN,1000))); |
|
380 |
var offset = -30.078; |
|
381 |
} |
|
382 |
elsif ((altDOWN < 10000) and (altDOWN >= 1000) and (math.mod(altDOWN,500))) { |
|
383 |
var AltBigDOWN = sprintf(prefix~"%1d", int(altDOWN/1000)); |
|
384 |
var AltSmallDOWN = sprintf("%1d", int(math.mod(altDOWN,1000))); |
|
385 |
var offset += 15.039; |
|
386 |
} |
|
387 |
else { |
|
388 |
var AltBigDOWN = sprintf(prefix~"%1d", int(altDOWN/1000)); |
|
389 |
var mod = int(math.mod(altDOWN,1000)); |
|
390 |
var AltSmallDOWN = sprintf("%1d", mod); |
|
391 |
var offset += 30.078; |
|
392 |
} |
|
393 |
me.screenElements["AltBigD"~place].setText(AltBigDOWN); |
|
394 |
me.screenElements["AltSmallD"~place].setText(AltSmallDOWN); |
|
395 |
me.screenElements["AltSmallD"~place].setTranslation(offset,0); |
|
396 |
} |
|
397 |
} |
|
398 |
settimer(func me.updateALT(getprop('instrumentation/altimeter/indicated-altitude-ft')), 0.2); |
|
399 |
}, |
|
animation HSI
|
400 | |
401 |
updateHSI : func (hdg) { |
|
402 |
me.screenElements.Rose |
|
403 |
.setRotation(-hdg * D2R); |
|
404 |
me.screenElements['HDG-text'] |
|
405 |
.setText(sprintf("%03u°", hdg)); |
|
406 |
settimer(func me.updateHSI(getprop('orientation/heading-deg')), 0.1); |
|
407 |
}, |
|
NAV disponible (hors CDI)
|
408 | |
ajout COMM, et factorisation...
|
409 |
_updateRadio: func { |
410 |
# arg[0]._r = <comm|nav> |
|
411 |
if (contains(arg[0], "active")) { |
|
412 |
if (arg[0]['active'] == 'none') { |
|
413 |
me.screenElements[arg[0]._r ~ '1-selected-freq'] |
|
414 |
.setColor(1,1,1); |
|
415 |
me.screenElements[arg[0]._r ~ '2-selected-freq'] |
|
416 |
.setColor(1,1,1); |
|
417 |
} |
|
418 |
else { |
|
419 |
me.screenElements[arg[0]._r ~ arg[0]['active'] ~ '-selected-freq'] |
|
420 |
.setColor(0,1,0); |
|
421 |
me.screenElements[arg[0]._r ~ arg[0].inactive ~ '-selected-freq'] |
|
422 |
.setColor(1,1,1); |
|
423 |
} |
|
424 |
} |
|
425 |
if (contains(arg[0], 'tune')) { |
|
426 |
# n = 0 -> NAV1/COMM1 |
|
427 |
# n = 1 -> NAV1/COMM2 |
|
428 |
me.screenElements[arg[0]._r ~ '-freq-switch'] |
|
429 |
.setTranslation(0, arg[0].tune * 25); |
|
430 |
me.screenElements[arg[0]._r ~ (arg[0].tune + 1) ~ '-standby-freq'] |
|
431 |
.setColor(0,1,1); |
|
432 |
me.screenElements[arg[0]._r ~ ((arg[0].tune == 0) + 1) ~ '-standby-freq'] |
|
433 |
.setColor(1,1,1); |
|
434 |
} |
|
435 |
if (contains(arg[0], 'refresh')) { |
|
436 |
# rafraichi une seule ligne NAV1/COMM1 ou NAV2/COMM2 |
|
437 |
var fmt = (arg[0]._r == 'nav') ? '%.2f' : '%.3f'; |
|
438 |
me.screenElements[arg[0]._r ~ arg[0].refresh ~ '-selected-freq'] |
|
439 |
.setText(sprintf(fmt, getprop('/instrumentation/' |
|
440 |
~ arg[0]._r ~ '[' ~ (arg[0].refresh - 1) ~ ']/frequencies/selected-mhz'))); |
|
441 |
me.screenElements[arg[0]._r ~ arg[0].refresh ~ '-standby-freq'] |
|
442 |
.setText(sprintf(fmt, getprop('/instrumentation/' |
|
443 |
~ arg[0]._r ~ '[' ~ (arg[0].refresh - 1) ~ ']/frequencies/standby-mhz'))); |
|
444 |
} |
|
445 |
if (contains(arg[0], 'set')) { |
|
446 |
# positionne la valeur modifiée, les listeners "trigguent" en permanence ces propriétés, donc exit |
|
447 |
var n = getprop('/instrumentation/zkv1000/radios/' ~ arg[0]._r ~ '-tune'); |
|
448 |
var fmt = (arg[0]._r == 'nav') ? '%.2f' : '%.3f'; |
|
449 |
me.screenElements[arg[0]._r ~ (n + 1) ~ '-standby-freq'] |
|
450 |
.setText(getprop('/instrumentation/' ~ arg[0]._r ~ '[' ~ n ~ ']/frequencies/standby-mhz')); |
|
451 |
} |
|
452 |
if (contains(arg[0], 'auto')) { |
|
453 |
# pour rafraichir automagiquement, toutes les deux secondes un refresh pour un NAV |
|
454 |
var radio = arg[0].auto; |
|
455 |
me._updateRadio({refresh: 1, _r: radio}); |
|
456 |
settimer(func me._updateRadio({refresh: 2, _r: radio}), 1); |
|
457 |
settimer(func me._updateRadio({auto: radio}), 2); |
|
458 |
} |
|
459 |
}, |
|
460 | ||
NAV disponible (hors CDI)
|
461 |
updateNAV : func { |
462 |
# made active via menu |
|
463 |
if (contains(arg[0], "active")) { |
|
464 |
if (arg[0]['active'] == 'none') { |
|
ajout COMM, et factorisation...
|
465 |
arg[0]._r = 'nav'; |
466 |
me._updateRadio(arg[0]); |
|
NAV disponible (hors CDI)
|
467 |
me.screenElements['nav1-id'] |
468 |
.setColor(1,1,1); |
|
469 |
me.screenElements['nav2-id'] |
|
470 |
.setColor(1,1,1); |
|
471 |
me.screenElements['NAV1-pointer'] |
|
472 |
.hide(); |
|
473 |
me.screenElements['NAV2-pointer'] |
|
474 |
.hide(); |
|
475 |
} |
|
476 |
else { |
|
ajout COMM, et factorisation...
|
477 |
arg[0]._r = 'nav'; |
478 |
arg[0].inactive = (arg[0]['active'] == 1) + 1; |
|
479 |
me._updateRadio(arg[0]); |
|
NAV disponible (hors CDI)
|
480 |
me.screenElements['nav' ~ arg[0]['active'] ~ '-id'] |
481 |
.setColor(0,1,0); |
|
482 |
me.screenElements['NAV' ~ arg[0]['active'] ~ '-pointer'] |
|
483 |
.show(); |
|
ajout COMM, et factorisation...
|
484 |
me.screenElements['nav' ~ arg[0].inactive ~ '-id'] |
485 |
.setColor(1,1,1); |
|
NAV disponible (hors CDI)
|
486 |
# me.screenElements['HDI'] |
487 |
# .setRotation(); |
|
488 |
# me.screenElements['NAV' ~ inactive ~ '-pointer'] |
|
489 |
# .hide(); |
|
490 |
# foreach (var e; [ 'FROM', 'TO', 'CDI' ]) |
|
491 |
# me.screenElements['NAV' ~ inactive ~ '-' ~ e] |
|
492 |
# .hide(); |
|
493 |
} |
|
494 |
} |
|
ajout COMM, et factorisation...
|
495 |
elsif (contains(arg[0], 'nav-id')) { |
Correction swap NAV tuning
|
496 |
# TODO: récupérer la valeur via les paramètres transmis du listener |
ajout COMM, et factorisation...
|
497 |
if (arg[0].val == nil) |
498 |
arg[0].val = ''; |
|
NAV disponible (hors CDI)
|
499 |
me.screenElements["nav" ~ arg[0]['nav-id'] ~ "-id"] |
ajout COMM, et factorisation...
|
500 |
.setText(arg[0].val); |
NAV disponible (hors CDI)
|
501 |
} |
ajout COMM, et factorisation...
|
502 |
else { |
503 |
arg[0]._r = 'nav'; |
|
504 |
me._updateRadio(arg[0]); |
|
NAV disponible (hors CDI)
|
505 |
} |
506 |
}, |
|
ajout COMM, et factorisation...
|
507 | |
508 |
updateCOMM: func { |
|
509 |
arg[0]._r = 'comm'; |
|
510 |
me._updateRadio(arg[0]); |
|
511 |
}, |
|
commit initial
|
512 |
}; |