comment on the folds
|
1 |
# vim: set foldmethod=marker foldmarker={{{,}}} : |
commit initial
|
2 |
var displayClass = { |
improves role/name variables...
|
3 |
new: func(device) { |
add new vim folds
|
4 |
# the contructor {{{ |
commit initial
|
5 |
var m = { parents: [ displayClass ] }; |
cosmétique: folding pour les...
|
6 | |
commit initial
|
7 |
m.display = canvas.new({ |
improves role/name variables...
|
8 |
"name" : device.name, |
massive code reorganisation ...
|
9 |
"size" : [1280, 1280], |
10 |
"view" : [1024, 768], |
|
commit initial
|
11 |
"mipmapping": 1 |
12 |
}); |
|
13 |
m.display.addPlacement({ |
|
configurable display size, v...
|
14 |
"node": device.data['screen-object'] != nil ? device.data['screen-object'] : "Screen", |
improves role/name variables...
|
15 |
"parent": device.name |
massive code reorganisation ...
|
16 |
}); |
commit initial
|
17 |
m.display.setColorBackground(0,0,0); |
improves role/name variables...
|
18 |
m.role = device.role; |
pass device pointer to displ...
|
19 |
m.device = device; |
écriture du wrapper pour le ...
|
20 |
m.screenElements = {}; |
massive code reorganisation ...
|
21 |
m.screen = m.display |
22 |
.createGroup() |
|
23 |
.show(); |
|
commit initial
|
24 | |
Softkeys revert to the previ...
|
25 |
m.timers2 = {}; # tho old timer implementation use already a named timer hash |
26 |
# Softkeys revert to the previous level after 45 seconds of inactivity. |
|
27 |
m.softkeys_inactivity_delay = 45; |
|
28 | ||
séparation configuration PFD...
|
29 |
var groups = { |
animation VSI
|
30 |
show : [ |
makes header visible on MFD ...
|
31 |
'Header', |
commit initial
|
32 |
'SoftKeysTexts', |
33 |
'COMM', |
|
34 |
'NAV', |
|
ajout COMM, et factorisation...
|
35 |
'nav-freq-switch', |
36 |
'comm-freq-switch', |
|
séparation configuration PFD...
|
37 |
], |
38 |
text: [ |
|
39 |
'nav1-standby-freq', 'nav1-selected-freq', 'nav1-id', |
|
40 |
'nav2-standby-freq', 'nav2-selected-freq', 'nav2-id', |
|
ajout COMM, et factorisation...
|
41 |
'comm1-standby-freq', 'comm1-selected-freq', |
42 |
'comm2-standby-freq', 'comm2-selected-freq', |
|
séparation configuration PFD...
|
43 |
], |
massive code reorganisation ...
|
44 |
hide : [ 'Failures', 'NAV-COMM-Failures' ], |
séparation configuration PFD...
|
45 |
clip: [ ], |
46 |
}; |
|
softkeys are available now
|
47 | |
add softkeys colors
|
48 |
for (var k = 0; k < 12; k += 1) { |
softkeys are available now
|
49 |
append(groups.text, sprintf("SoftKey%02i-text", k)); |
add softkeys colors
|
50 |
append(groups.show, sprintf("SoftKey%02i-bg", k)); |
51 |
} |
|
softkeys are available now
|
52 | |
massive code reorganisation ...
|
53 |
if (m.device.role == 'PFD') { |
séparation configuration PFD...
|
54 |
append(groups.show, |
adds some vim z-folds
|
55 |
# {{{ |
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', |
animation HDG bug
|
62 |
'Heading-bug', |
63 |
'PFD-Widgets', |
|
trends animation
|
64 |
'Trends', |
65 |
'Airspeed-Trend-Indicator', |
|
66 |
'Altitude-Trend-Indicator', |
|
adds OAT, TAS, GSPD, WindDat...
|
67 |
'OAT', |
68 |
'IAS-bg', |
|
69 |
'TAS', |
|
70 |
'GSPD', |
|
adds BARO settings
|
71 |
'BARO-bg', |
adds slipskid animation
|
72 |
'SlipSkid', |
add V-speeds bugs
|
73 |
'IAS-Vx', 'IAS-Vy', 'IAS-Vr', 'IAS-Vglide', |
adds some vim z-folds
|
74 |
# }}} |
séparation configuration PFD...
|
75 |
); |
76 |
append(groups.hide, |
|
adds some vim z-folds
|
77 |
# {{{ |
adds EIS
|
78 |
'EIS', |
NAV disponible (hors CDI)
|
79 |
'CDI', |
adds OMI to PFD
|
80 |
'OMI', 'MarkerBG', 'MarkerText', |
massive code reorganisation ...
|
81 |
'VDI', |
adds CDI
|
82 |
'NAV1-pointer', 'NAV1-CDI', 'NAV1-FROM', 'NAV1-TO', |
83 |
'NAV2-pointer', 'NAV2-CDI', 'NAV2-FROM', 'NAV2-TO', |
|
84 |
'GPS-pointer', 'GPS-CDI', 'GPS-CTI', 'GPS-CTI-diamond', 'GPS-FROM', 'GPS-TO', |
|
adds BRG1/2 animation
|
85 |
'BRG1-pointer', |
86 |
'BRG2-pointer', |
|
animation HDG bug
|
87 |
'SelectedHDG-bg', |
88 |
'SelectedHDG-bgtext', |
|
89 |
'SelectedHDG-text', |
|
90 |
'SelectedCRS-bg', |
|
91 |
'SelectedCRS-bgtext', |
|
92 |
'SelectedCRS-text', |
|
fix Selected Altitude displa...
|
93 |
'SelectedALT', 'SelectedALT-bug', 'SelectedALT-bg', 'SelectedALT-symbol', |
animation HDG bug
|
94 |
'TAS', |
95 |
'GSPD', |
|
96 |
'WindData', |
|
97 |
'Reversionnary', |
|
98 |
'Annunciation', |
|
99 |
'Comparator', |
|
100 |
'BRG1', |
|
101 |
'BRG2', |
|
102 |
'DME1', |
|
makes map available for PFD ...
|
103 |
'PFD-Map-bg', |
adds OAT, TAS, GSPD, WindDat...
|
104 |
'PFD-Multilines', |
improves WindData display
|
105 |
'WindData', 'WindData-OPTN1', 'WindData-OPTN2', 'WindData-OPTN1-HDG', 'WindData-OPTN2-symbol', 'WindData-OPTN2-headwind', 'WindData-OPTN2-crosswind', 'WindData-NODATA', |
nicer AOA display
|
106 |
'AOA', 'AOA-needle', 'AOA-text', 'AOA-approach', |
adds some vim z-folds
|
107 |
# }}} |
séparation configuration PFD...
|
108 |
); |
109 |
append(groups.clip, |
|
adds some vim z-folds
|
110 |
# {{{ |
animation IAS
|
111 |
'SpeedLint1', |
animation ALT
|
112 |
'SpeedTape', |
113 |
'LintAlt', |
|
massive code reorganisation ...
|
114 |
'AltLint00011', |
115 |
'PitchScale', |
|
adds some vim z-folds
|
116 |
# }}} |
animation ALT
|
117 |
); |
séparation configuration PFD...
|
118 |
append(groups.text, |
adds some vim z-folds
|
119 |
# {{{ |
fix Selected Altitude displa...
|
120 |
'SelectedALT-text', |
adds OAT, TAS, GSPD, WindDat...
|
121 |
'TAS-text', |
122 |
'GSPD-text', |
|
anime time display
|
123 |
'TIME-text', |
adds OAT, TAS, GSPD, WindDat...
|
124 |
'OAT-text', |
séparation configuration PFD...
|
125 |
'VSIText', |
126 |
'Speed110', |
|
127 |
'Alt11100', |
|
128 |
'HDG-text', |
|
adds BARO settings
|
129 |
'BARO-text', |
adds CDI
|
130 |
'CDI-SRC-text', 'CDI-GPS-ANN-text', 'CDI-GPS-XTK-text', |
adds BRG1/2 animation
|
131 |
'BRG1-pointer', 'BRG1-SRC-text', 'BRG1-DST-text', 'BRG1-WPID-text', |
132 |
'BRG2-pointer', 'BRG2-SRC-text', 'BRG2-DST-text', 'BRG2-WPID-text', |
|
adds OAT, TAS, GSPD, WindDat...
|
133 |
'WindData-OPTN1-HDG-text', 'WindData-OPTN1-SPD-text', |
134 |
'WindData-OPTN2-crosswind-text', 'WindData-OPTN2-headwind-text', |
|
adds transponder
|
135 |
'XPDR-MODE-text', 'XPDR-DIGIT-3-text', 'XPDR-DIGIT-2-text', 'XPDR-DIGIT-1-text', 'XPDR-DIGIT-0-text', |
séparation configuration PFD...
|
136 |
'AltBigC', 'AltSmallC' |
adds some vim z-folds
|
137 |
# }}} |
séparation configuration PFD...
|
138 |
); |
139 |
for (var place = 1; place <= 6; place +=1) { |
|
140 |
append(groups.text, |
|
141 |
'AltBigU' ~ place, |
|
142 |
'AltSmallU' ~ place, |
|
143 |
'AltBigD' ~ place, |
|
144 |
'AltSmallD' ~ place |
|
145 |
); |
|
146 |
} |
|
massive code reorganisation ...
|
147 |
canvas.parsesvg(m.screen, data.zkv1000_reldir ~ 'Systems/PFD.svg'); |
animation ALT
|
148 |
} |
adds EIS
|
149 |
else { |
EIS now really specific to a...
|
150 |
var eis_file = getprop('/instrumentation/zkv1000/eis/type'); |
151 |
if (eis_file == nil) |
|
152 |
eis_file = getprop('/instrumentation/zkv1000/eis/file'); |
|
153 | ||
154 |
if (eis_file != nil) { |
|
155 |
if (find('/', eis_file) == -1) |
|
156 |
eis_file = data.zkv1000_dir ~ 'Nasal/EIS/' ~ eis_file ~ '.nas'; |
|
157 |
elsif (split('/', eis_file)[0] == 'Aircraft') { |
|
158 |
var path = split('/', eis_file); |
|
159 |
if (getprop('/sim/fg-aircraft') != nil) { |
|
160 |
eis_file = getprop('/sim/fg-aircraft'); |
|
161 |
for (var i = 1; i < size(path); i += 1) |
|
162 |
eis_file ~= '/' ~ path[i]; |
|
163 |
} |
|
164 |
else |
|
165 |
eis_file = getprop('/sim/fg-root') ~ '/' ~ eis_file; |
|
166 |
} |
|
167 |
} |
|
168 |
else |
|
169 |
eis_file = data.zkv1000_dir ~ 'Nasal/EIS/none.nas'; |
|
170 | ||
171 |
if (io.stat(eis_file) == nil |
|
172 |
and print(eis_file ~ ' not found')) |
|
173 |
eis_file = data.zkv1000_dir ~ 'Nasal/EIS/none.nas'; |
|
174 |
io.load_nasal(eis_file, 'zkv1000'); |
|
175 | ||
massive code reorganisation ...
|
176 |
if (contains(m.parents[0], 'showEIS')) |
177 |
m.showEIS(groups); |
|
adds EIS
|
178 |
} |
séparation configuration PFD...
|
179 | |
massive code reorganisation ...
|
180 |
canvas.parsesvg(m.screen, data.zkv1000_reldir ~ 'Systems/softkeys.svg'); |
181 |
canvas.parsesvg(m.screen, data.zkv1000_reldir ~ 'Systems/header-nav-comm.svg'); |
|
animation ALT
|
182 | |
massive code reorganisation ...
|
183 |
m.loadGroup(groups); |
184 | ||
185 |
if (m.device.role == 'PFD') { |
|
186 |
m.device.data.aoa = 0; |
|
187 |
m.device.data['aoa-auto'] = 0; |
|
188 |
m.device.data.mapclip = { |
|
189 |
top: math.ceil(m.screenElements['PFD-Map-bg'].getTransformedBounds()[1]) - 1, |
|
190 |
right: math.ceil(m.screenElements['PFD-Map-bg'].getTransformedBounds()[2]) - 1, |
|
191 |
bottom: math.ceil(m.screenElements['PFD-Map-bg'].getTransformedBounds()[3]) - 1, |
|
192 |
left: math.ceil(m.screenElements['PFD-Map-bg'].getTransformedBounds()[0]) - 1, |
|
makes map available for PFD ...
|
193 |
}; |
séparation configuration PFD...
|
194 |
} |
animation texts EIS + power ...
|
195 |
else { |
massive code reorganisation ...
|
196 |
m.device.data.mapclip = { |
197 |
top: math.ceil(m.screenElements['Header'].getTransformedBounds()[3]), |
|
198 |
right: m.display.get('view[0]'), |
|
199 |
bottom: math.ceil(m.screenElements['SoftKeysTexts'].getTransformedBounds()[1]), |
|
200 |
left: contains(m.screenElements, 'EIS') ? math.ceil(m.screenElements['EIS'].getTransformedBounds()[2]) : 0, |
|
set MFD map size relative to...
|
201 |
}; |
makes map available for PFD ...
|
202 |
} |
massive code reorganisation ...
|
203 |
return m; |
204 |
}, |
|
205 |
#}}} |
|
makes map available for PFD ...
|
206 | |
massive code reorganisation ...
|
207 |
# timers stuff {{{ |
208 |
timers : {}, |
|
209 | ||
210 |
timerTrigger : func { |
|
211 |
var now = systime(); |
|
212 |
foreach (var id; keys(me.timers)) { |
|
213 |
if (me.timers[id] < now) { |
|
214 |
me.screenElements[id].hide(); |
|
215 |
delete(me.timers, id); |
|
216 |
} |
|
commit initial
|
217 |
} |
massive code reorganisation ...
|
218 |
settimer(func me.timerTrigger(), 1); |
219 |
}, |
|
220 | ||
221 |
addTimer : func (duration, element) { |
|
222 |
if (typeof(element) == 'scalar') |
|
223 |
element = [ element ]; |
|
224 |
var end = systime() + duration; |
|
225 |
foreach (var e; element) |
|
226 |
me.timers[e] = end; |
|
commit initial
|
227 |
}, |
cosmétique: folding pour les...
|
228 |
#}}} |
commit initial
|
229 | |
massive code reorganisation ...
|
230 |
showInitProgress : func { |
cosmétique: folding pour les...
|
231 |
#{{{ |
massive code reorganisation ...
|
232 |
if (me.device.role == 'PFD') { |
233 |
me.updateAI(); |
|
234 |
me.updateVSI(); |
|
235 |
me.updateIAS(); |
|
236 |
me.updateALT(); |
|
237 |
me.updateHSI(); |
|
238 |
me.updateTIME(); |
|
239 |
me.updateOAT(); |
|
240 |
me.updateTAS(); |
|
241 |
me.updateBRG(); |
|
242 |
me.updateXPDR(); |
|
243 |
me.updateBARO(); |
|
244 |
me.updateOMI(); |
|
245 |
me.timerTrigger(); |
|
246 |
me.screen.show(); |
|
247 |
} |
|
248 |
else { |
|
249 |
me.updateEIS(); |
|
250 |
io.load_nasal(data.zkv1000_dir ~ 'Nasal/MFD.pages.nas', 'zkv1000'); |
|
251 |
me['page selected'] = 0; |
|
252 |
me.device.data['page selection'] = [ |
|
253 |
# {{{ |
|
254 |
{ |
|
255 |
name: 'MAP', |
|
256 |
objects: [ |
|
257 |
{text: 'NAVIGATION MAP'}, |
|
258 |
{text: 'TRAFFIC MAP'}, |
|
259 |
{text: 'STORMSCOPE'}, |
|
260 |
{text: 'WEATHER DATA LINK'}, |
|
261 |
{text: 'TAWS-B'}, |
|
262 |
], |
|
263 |
}, |
|
264 |
{ |
|
265 |
name: 'WPT', |
|
266 |
objects: [ |
|
267 |
{text: 'AIRPORT INFORMATION'}, |
|
268 |
{text: 'AIRPORT DIRECTORY'}, |
|
269 |
{text: 'DEPARTURE INFORMATION'}, |
|
270 |
{text: 'ARRIVAL INFORMATION'}, |
|
271 |
{text: 'APPROACH INFORMATION'}, |
|
272 |
{text: 'WEATHER INFORMATION'}, |
|
273 |
{text: 'INTERSECTION INFORMATION'}, |
|
274 |
{text: 'NDB INFORMATION'}, |
|
275 |
{text: 'VOR INFORMATION'}, |
|
276 |
{text: 'USER WAYPOINT INFORMATION'}, |
|
277 |
], |
|
278 |
}, |
|
279 |
{ |
|
280 |
name: 'AUX', |
|
281 |
objects: [ |
|
282 |
{text: 'TRIP PLANNING'}, |
|
283 |
{text: 'UTILITY'}, |
|
284 |
{text: 'GPS STATUS'}, |
|
285 |
{text: 'SYSTEM SETUP'}, |
|
286 |
], |
|
287 |
}, |
|
288 |
{ |
|
289 |
name: 'FPL', |
|
290 |
objects: [ |
|
291 |
{text: 'ACTIVE FLIGHT PLAN'}, |
|
292 |
{text: 'WIDE VIEW, NARROW VIEW'}, |
|
293 |
{text: 'FLIGHT PLAN CATALOG'}, |
|
294 |
], |
|
295 |
}, |
|
296 |
{ |
|
297 |
name: 'PROC', |
|
298 |
objects: [ |
|
299 |
{text: 'DEPARTURE LOADING'}, |
|
300 |
{text: 'ARRIVAL LOADING'}, |
|
301 |
{text: 'APPROACH LOADING'}, |
|
302 |
], |
|
303 |
}, |
|
304 |
{ |
|
305 |
name: 'NRST', |
|
306 |
objects: [ |
|
307 |
{text: 'NEAREST AIRPORTS'}, |
|
308 |
{text: 'NEAREST INTERSECTIONS'}, |
|
309 |
{text: 'NEAREST NDB'}, |
|
310 |
{text: 'NEAREST VOR'}, |
|
311 |
{text: 'NEAREST USER WAYPOINTS'}, |
|
312 |
{text: 'NEAREST FREQUENCIES'}, |
|
313 |
{text: 'NEAREST AIRSPACES'}, |
|
314 |
], |
|
315 |
}, |
|
316 |
# }}} |
|
317 |
]; |
|
318 |
me.setMFDPages(); |
|
319 |
me.device.buttons.MENU = me.device.buttons.MapMenu; |
|
320 |
} |
|
commit initial
|
321 | |
massive code reorganisation ...
|
322 |
me.updateNAV({auto:'nav', tune: radios.getNode('nav-tune').getValue()}); |
323 |
me.updateCOMM({auto:'comm', tune: radios.getNode('comm-tune').getValue()}); |
|
324 |
me.softkeys_inactivity(); |
|
325 |
me.updateSoftKeys(); |
|
commit initial
|
326 |
}, |
cosmétique: folding pour les...
|
327 |
#}}} |
commit initial
|
328 | |
some added comments
|
329 |
colors : { |
330 |
# set of predefined colors {{{ |
|
331 |
green : [0, 1, 0], |
|
332 |
white : [1, 1, 1], |
|
333 |
black : [0, 0, 0], |
|
334 |
lightblue : [0, 1, 1], |
|
335 |
darkblue : [0, 0, 1], |
|
336 |
red : [1, 0, 0], |
|
adds CDI
|
337 |
magenta : [1, 0, 1], |
some added comments
|
338 |
}, |
339 |
#}}} |
|
340 | ||
écriture du wrapper pour le ...
|
341 |
loadGroup : func (h) { |
cosmétique: folding pour les...
|
342 |
#{{{ |
écriture du wrapper pour le ...
|
343 |
if (typeof(h) != 'hash') { |
344 |
msg_dbg(sprintf("%s need a hash, but get a %s from %s", |
|
345 |
caller(0)[0], |
|
346 |
typeof(h), |
|
347 |
caller(1)[0])); |
|
348 |
return; |
|
commit initial
|
349 |
} |
écriture du wrapper pour le ...
|
350 |
var setMethod = func (e, t) { |
351 |
if (t == 'hide') |
|
352 |
me.screenElements[e].hide(); |
|
353 |
elsif (t == 'show') |
|
354 |
me.screenElements[e].show(); |
|
AI disponible
|
355 |
elsif (t == 'rot' or t == 'trans') { |
356 |
if (! contains(me.screenElements[e], t)) |
|
357 |
me.screenElements[e][t] = me.screenElements[e].createTransform(); |
|
358 |
} |
|
359 |
elsif (t == 'clip') { |
|
360 |
if (contains(me.clips, e)) |
|
361 |
me.screenElements[e].set("clip", me.clips[e]); |
|
362 |
else |
|
printlog with adapted level ...
|
363 |
printlog('warn', 'no defined clip for ' ~ e); |
AI disponible
|
364 |
} |
animation VSI
|
365 |
elsif (t == 'text') { |
366 |
if (contains(me.texts, e)) { |
|
367 |
if (contains(me.texts[e], 'alignment')) |
|
368 |
me.screenElements[e].setAlignment(me.texts[e].alignment); |
|
369 |
if (contains(me.texts[e], 'default')) |
|
370 |
me.screenElements[e].setText(me.texts[e].default); |
|
NAV disponible (hors CDI)
|
371 |
if (contains(me.texts[e], 'color')) |
372 |
me.screenElements[e].setColor(me.texts[e].color); |
|
adds CDI
|
373 |
if (contains(me.texts[e], 'visible')) |
374 |
me.screenElements[e].setVisible(me.texts[e].visible); |
|
animation VSI
|
375 |
} |
printlog with adapted level ...
|
376 |
else |
377 |
printlog('debug', 'no text format for ' ~ e); |
|
animation VSI
|
378 |
} |
commit initial
|
379 |
else |
printlog with adapted level ...
|
380 |
printlog('warn', 'unknown method ' ~ t); |
écriture du wrapper pour le ...
|
381 |
}; |
382 |
foreach (var todo; keys(h)) { |
|
383 |
if (typeof(h[todo]) != 'vector') h[todo] = [ h[todo] ]; |
|
384 |
foreach (var id; h[todo]) { |
|
385 |
if (! contains(me.screenElements, id)) { |
|
386 |
me.screenElements[id] = me.screen.getElementById(id); |
|
387 |
if (me.screenElements[id] != nil) |
|
388 |
setMethod(id, todo); |
|
389 |
else |
|
printlog with adapted level ...
|
390 |
printlog('warn', 'SVG ID ' ~ id ~ ' not found'); |
écriture du wrapper pour le ...
|
391 |
} |
392 |
else |
|
393 |
setMethod(id, todo); |
|
394 |
} |
|
commit initial
|
395 |
} |
396 |
}, |
|
cosmétique: folding pour les...
|
397 |
#}}} |
AI disponible
|
398 | |
399 |
clips : { |
|
cosmétique: folding pour les...
|
400 |
#{{{ |
clean pre-merge
|
401 |
PitchScale : "rect(70,664,370,256)", |
402 |
SpeedLint1 : "rect(252,226,318,204)", |
|
403 |
SpeedTape : "rect(115,239,455,156)", |
|
404 |
LintAlt : "rect(115,808,455,704)", |
|
animation ALT
|
405 |
AltLint00011 : "rect(252,804,318,771)", |
AI disponible
|
406 |
}, |
cosmétique: folding pour les...
|
407 |
#}}} |
AI disponible
|
408 | |
animation VSI
|
409 |
texts : { |
cosmétique: folding pour les...
|
410 |
#{{{ |
animation VSI
|
411 |
VSIText : { |
412 |
alignment: "right-bottom", default : num('0'), |
|
413 |
}, |
|
animation IAS
|
414 |
Speed110 : { |
NAV disponible (hors CDI)
|
415 |
alignment : 'left-bottom' |
animation IAS
|
416 |
}, |
animation ALT (2)
|
417 |
Alt11100 : { |
NAV disponible (hors CDI)
|
418 |
alignment:'left-bottom' |
animation ALT (2)
|
419 |
}, |
clean pre-merge
|
420 |
"HDG-text" : { |
421 |
default: '---°' |
|
422 |
}, |
|
NAV disponible (hors CDI)
|
423 |
'nav1-standby-freq' : { |
424 |
color: [0, 1, 1], |
|
425 |
}, |
|
426 |
'nav1-id' : { |
|
427 |
default: '' |
|
428 |
}, |
|
429 |
'nav2-id' : { |
|
430 |
default: '' |
|
431 |
}, |
|
adds CDI
|
432 |
'CDI-GPS-ANN-text' : { |
433 |
visible : 0 |
|
434 |
}, |
|
435 |
'CDI-GPS-XTK-text' : { |
|
436 |
visible : 0 |
|
437 |
}, |
|
438 |
'CDI-SRC-text' : { |
|
439 |
visible : 0 |
|
440 |
}, |
|
adds BARO settings
|
441 |
'BARO-text' : { |
442 |
alignment : 'left-bottom', |
|
443 |
} |
|
some added comments
|
444 |
# 'TAS-text' : { |
445 |
# alignment : 'right-bottom', |
|
446 |
# }, |
|
447 |
# 'GSPD-text' : { |
|
448 |
# alignment : 'right-bottom', |
|
449 |
# }, |
|
animation VSI
|
450 |
}, |
cosmétique: folding pour les...
|
451 |
#}}} |
animation VSI
|
452 | |
Softkeys revert to the previ...
|
453 |
softkeys_inactivity : func { |
454 |
# automagically back to previous level after some delay {{{ |
|
455 |
me.timers2.softkeys_inactivity = maketimer ( |
|
456 |
me.softkeys_inactivity_delay, |
|
457 |
func { |
|
458 |
pop(me.device.softkeys.path); |
|
459 |
me.updateSoftKeys(); |
|
460 |
}, me); |
|
461 |
me.timers2.softkeys_inactivity.singleShot = 1; |
|
462 |
}, |
|
463 |
#}}} |
|
464 | ||
add softkeys colors
|
465 |
setSoftKeyColor : func (n, active, alert = 0) { |
466 |
# set colors for active softkeys {{{ |
|
467 |
var sftk = sprintf('SoftKey%02i-', n); |
|
468 |
if (active) { |
|
469 |
var bg = alert ? 1 : 0.5; |
|
470 |
me.screenElements[sftk ~ 'bg'] |
|
471 |
.setColorFill(bg,bg,bg); |
|
472 |
me.screenElements[sftk ~ 'text'] |
|
473 |
.setColor(0,0,0); |
|
474 |
} |
|
475 |
else { |
|
476 |
me.screenElements[sftk ~ 'bg'] |
|
477 |
.setColorFill(0,0,0); |
|
478 |
me.screenElements[sftk ~ 'text'] |
|
479 |
.setColor(1,1,1); |
|
480 |
} |
|
481 |
}, |
|
482 |
#}}} |
|
483 | ||
softkeys are available now
|
484 |
updateSoftKeys : func { |
485 |
# update SoftKeys boxes {{{ |
|
486 |
# on PFD the last boxes are always BACK and ALERTS |
|
improves role/name variables...
|
487 |
if (me.device.role == 'PFD') { |
softkeys are available now
|
488 |
me.screenElements[sprintf("SoftKey%02i-text", 11)] |
489 |
.setText('ALERTS'); |
|
490 |
if (size(me.device.softkeys.path) != 0) |
|
491 |
me.screenElements[sprintf("SoftKey%02i-text", 10)] |
|
492 |
.setText('BACK'); |
|
493 |
} |
|
494 | ||
improves role/name variables...
|
495 |
var path = keyMap[me.device.role]; |
improves softkeys coloring
|
496 |
var pathid = ''; |
497 |
foreach (var p; me.device.softkeys.path) { |
|
softkeys are available now
|
498 |
path = path[p]; |
improves softkeys coloring
|
499 |
pathid ~= p; |
500 |
} |
|
softkeys are available now
|
501 | |
502 |
# feeding with empty menus the first boxes |
|
503 |
var start = (contains(path, 'first')) ? path.first : 0; |
|
504 |
for (var k = 0; k < start; k+=1) { |
|
improves softkeys coloring
|
505 |
var sftk = sprintf("SoftKey%02i-", k); |
506 |
me.screenElements[sftk ~ 'text'] |
|
softkeys are available now
|
507 |
.setText(''); |
improves softkeys coloring
|
508 |
me.screenElements[sftk ~ 'bg'] |
509 |
.setColorFill(0,0,0); |
|
softkeys are available now
|
510 |
} |
511 |
# filling with the content the next boxes |
|
512 |
forindex (var k; path.texts) { |
|
513 |
var i = k + start; |
|
514 |
me.screenElements[sprintf("SoftKey%02i-text", i)] |
|
515 |
.setText(path.texts[k]); |
|
improves softkeys coloring
|
516 |
me.setSoftKeyColor(i, |
517 |
contains(me.device.softkeys.colored, pathid ~ path.texts[k])); |
|
softkeys are available now
|
518 |
} |
519 |
# feeding the last boxes with empty string |
|
improves role/name variables...
|
520 |
var end = (me.device.role == 'PFD') ? 10 : 12; |
softkeys are available now
|
521 |
if (size(path.texts) + start < end) { |
522 |
start = size(path.texts) + start; |
|
improves softkeys coloring
|
523 |
for (var k = start; k < end; k += 1) { |
524 |
var sftk = sprintf("SoftKey%02i-", k); |
|
525 |
me.screenElements[sftk ~ 'text'] |
|
softkeys are available now
|
526 |
.setText(''); |
improves softkeys coloring
|
527 |
me.screenElements[sftk ~ 'bg'] |
528 |
.setColorFill(0,0,0); |
|
529 |
} |
|
softkeys are available now
|
530 |
} |
Softkeys revert to the previ...
|
531 | |
532 |
if (size(me.device.softkeys.path)) |
|
533 |
me.timers2.softkeys_inactivity.restart(me.softkeys_inactivity_delay); |
|
534 |
else |
|
535 |
me.timers2.softkeys_inactivity.stop(); |
|
softkeys are available now
|
536 |
}, |
537 |
#}}} |
|
538 | ||
adds OAT, TAS, GSPD, WindDat...
|
539 |
updateAI: func(){ |
cosmétique: folding pour les...
|
540 |
#{{{ |
make some data common to all...
|
541 |
var pitch = data.pitch; |
542 |
var roll = data.roll; |
|
AI disponible
|
543 |
if (pitch > 80) |
544 |
pitch = 80; |
|
clean pre-merge
|
545 |
elsif (pitch < -80) |
AI disponible
|
546 |
pitch = -80; |
547 |
me.screenElements.Horizon |
|
fix AI animation
|
548 |
.setCenter(459, 282.8 - 6.849 * pitch) |
AI disponible
|
549 |
.setRotation(-roll * D2R) |
fix AI animation
|
550 |
.setTranslation(0, pitch * 6.849); |
AI disponible, avec bankPoin...
|
551 |
me.screenElements.bankPointer |
552 |
.setRotation(-roll * D2R); |
|
adds slipskid animation
|
553 |
me.screenElements['SlipSkid'] |
554 |
.setTranslation(getprop("/instrumentation/slip-skid-ball/indicated-slip-skid") * 10, 0); |
|
adds OAT, TAS, GSPD, WindDat...
|
555 |
settimer(func me.updateAI(), 0.1); |
AI disponible
|
556 |
}, |
cosmétique: folding pour les...
|
557 |
#}}} |
animation VSI
|
558 | |
adds OAT, TAS, GSPD, WindDat...
|
559 |
updateVSI: func () { |
comment on the folds
|
560 |
# animate VSI {{{ |
make some data common to all...
|
561 |
var vsi = data.vsi; |
animation VSI
|
562 |
me.screenElements.VSIText |
563 |
.setText(num(math.round(vsi, 10))); |
|
564 |
if (vsi > 4500) |
|
565 |
vsi = 4500; |
|
566 |
elsif (vsi < -4500) |
|
567 |
vsi = -4500; |
|
568 |
me.screenElements.VSI |
|
569 |
.setTranslation(0, vsi * -0.03465); |
|
adds OAT, TAS, GSPD, WindDat...
|
570 |
settimer(func me.updateVSI(), 0.1); |
animation VSI
|
571 |
}, |
cosmétique: folding pour les...
|
572 |
#}}} |
animation IAS
|
573 | |
adds OAT, TAS, GSPD, WindDat...
|
574 |
updateIAS: func () { |
comment on the folds
|
575 |
# animates the IAS lint (PFD) {{{ |
make some data common to all...
|
576 |
var ias = data.ias; |
animation IAS
|
577 |
if (ias >= 10) |
578 |
me.screenElements.Speed110 |
|
579 |
.setText(sprintf("% 2u",num(math.floor(ias/10)))); |
|
580 |
else |
|
581 |
me.screenElements.Speed110 |
|
582 |
.setText(''); |
|
583 |
me.screenElements.SpeedLint1 |
|
584 |
.setTranslation(0,(math.mod(ias,10) + (ias >= 10)*10) * 36); |
|
585 |
me.screenElements.SpeedTape |
|
586 |
.setTranslation(0,ias * 5.711); |
|
put Vspeeds in common data s...
|
587 |
if (ias > data.Vne and ! me._ias_already_exceeded) { # easier than .getColorFill |
adds OAT, TAS, GSPD, WindDat...
|
588 |
me._ias_already_exceeded = 1; |
589 |
me.screenElements['IAS-bg'] |
|
590 |
.setColorFill(1,0,0); |
|
591 |
} |
|
put Vspeeds in common data s...
|
592 |
elsif (ias < data.Vne and me._ias_already_exceeded) { # easier than .getColorFill |
adds OAT, TAS, GSPD, WindDat...
|
593 |
me._ias_already_exceeded = 0; |
594 |
me.screenElements['IAS-bg'] |
|
595 |
.setColorFill(0,0,0); |
|
596 |
} |
|
add V-speeds bugs
|
597 |
foreach (var v; ['Vx', 'Vy', 'Vr', 'Vglide']) { |
put Vspeeds in common data s...
|
598 |
if (me.device.data[v ~ '-visible'] and abs(data[v] - ias) < 30) |
add V-speeds bugs
|
599 |
me.screenElements['IAS-' ~ v] |
put Vspeeds in common data s...
|
600 |
.setTranslation(0, (ias - data[v]) * 5.711) |
add V-speeds bugs
|
601 |
.show(); |
602 |
else |
|
603 |
me.screenElements['IAS-' ~ v] |
|
604 |
.hide(); |
|
605 |
} |
|
606 | ||
trends animation
|
607 |
var now = systime(); |
608 |
# estimated speed in 6s |
|
609 |
var Sy = 6 * (ias - me._last_ias_kt) / (now - me._last_ias_s); |
|
610 |
if (abs(Sy) > 30) |
|
611 |
Sy = 30 * abs(Sy)/Sy; # = -30 or 30 |
|
612 |
me.screenElements['Airspeed-Trend-Indicator'] |
|
613 |
.setScale(1,Sy) |
|
614 |
.setTranslation(0, -284.5 * (Sy - 1)); |
|
615 |
me._last_ias_kt = ias; |
|
616 |
me._last_ias_s = now; |
|
adds OAT, TAS, GSPD, WindDat...
|
617 |
settimer(func me.updateIAS(), 0.1); |
animation IAS
|
618 |
}, |
trends animation
|
619 |
_last_ias_kt : 0, |
620 |
_last_ias_s : systime(), |
|
adds OAT, TAS, GSPD, WindDat...
|
621 |
_ias_already_exceeded : 0, |
cosmétique: folding pour les...
|
622 |
#}}} |
animation ALT
|
623 | |
adds OAT, TAS, GSPD, WindDat...
|
624 |
updateTAS: func { |
625 |
# updates the True Airspeed and GroundSpeed indicators {{{ |
|
626 |
me.screenElements['TAS-text'] |
|
627 |
.setText(sprintf('%iKT', getprop('/instrumentation/airspeed-indicator/true-speed-kt'))); |
|
628 |
me.screenElements['GSPD-text'] |
|
629 |
.setText(sprintf('%iKT', getprop('/velocities/groundspeed-kt'))); |
|
630 |
settimer(func me.updateTAS(), 0.5); |
|
631 |
}, |
|
632 |
#}}} |
|
633 | ||
634 |
updateALT: func () { |
|
635 |
# animates the altitude lint (PFD) {{{ |
|
make some data common to all...
|
636 |
var alt = data.alt; |
animation ALT
|
637 |
if (alt < 0) |
638 |
me.screenElements.Alt11100 |
|
639 |
.setText(sprintf("% 3i",math.ceil(alt/100))); |
|
640 |
elsif (alt < 100) |
|
641 |
me.screenElements.Alt11100 |
|
642 |
.setText(''); |
|
643 |
else |
|
644 |
me.screenElements.Alt11100 |
|
645 |
.setText(sprintf("% 3i",math.floor(alt/100))); |
|
646 |
me.screenElements.AltLint00011 |
|
647 |
.setTranslation(0,math.fmod(alt,100) * 1.24); |
|
648 | ||
649 |
# From Farmin/G1000 http://wiki.flightgear.org/Project_Farmin/FG1000 |
|
650 |
if (alt> -1000 and alt< 1000000) { |
|
651 |
var Offset10 = 0; |
|
652 |
var Offset100 = 0; |
|
653 |
var Offset1000 = 0; |
|
654 |
if (alt< 0) { |
|
655 |
var Ne = 1; |
|
656 |
var alt= -alt; |
|
657 |
} |
|
658 |
else |
|
659 |
var Ne = 0; |
|
660 | ||
661 |
var Alt10 = math.mod(alt,100); |
|
662 |
var Alt100 = int(math.mod(alt/100,10)); |
|
663 |
var Alt1000 = int(math.mod(alt/1000,10)); |
|
664 |
var Alt10000 = int(math.mod(alt/10000,10)); |
|
665 |
var Alt20 = math.mod(Alt10,20)/20; |
|
666 |
if (Alt10 >= 80) |
|
667 |
var Alt100 += Alt20; |
|
668 | ||
669 |
if (Alt10 >= 80 and Alt100 >= 9) |
|
670 |
var Alt1000 += Alt20; |
|
671 | ||
672 |
if (Alt10 >= 80 and Alt100 >= 9 and Alt1000 >= 9) |
|
673 |
var Alt10000 += Alt20; |
|
674 | ||
675 |
if (alt> 100) |
|
676 |
var Offset10 = 100; |
|
677 | ||
678 |
if (alt> 1000) |
|
679 |
var Offset100 = 10; |
|
680 | ||
681 |
if (alt> 10000) |
|
682 |
var Offset1000 = 10; |
|
683 | ||
684 |
if (!Ne) { |
|
685 |
me.screenElements.LintAlt.setTranslation(0,(math.mod(alt,100))*0.57375); |
|
686 |
var altCentral = (int(alt/100)*100); |
|
687 |
} |
|
688 |
elsif (Ne) { |
|
689 |
me.screenElements.LintAlt.setTranslation(0,(math.mod(alt,100))*-0.57375); |
|
690 |
var altCentral = -(int(alt/100)*100); |
|
691 |
} |
|
692 |
me.screenElements["AltBigC"].setText(""); |
|
693 |
me.screenElements["AltSmallC"].setText(""); |
|
694 |
for (var place = 1; place <= 6; place += 1) { |
|
695 |
var altUP = altCentral + (place*100); |
|
696 |
var offset = -30.078; |
|
697 |
if (altUP < 0) { |
|
698 |
var altUP = -altUP; |
|
699 |
var prefix = "-"; |
|
700 |
var offset += 15.039; |
|
701 |
} |
|
702 |
else |
|
703 |
var prefix = ""; |
|
704 | ||
705 |
if (altUP == 0) { |
|
706 |
var AltBigUP = ""; |
|
707 |
var AltSmallUP = "0"; |
|
708 | ||
709 |
} |
|
710 |
elsif (math.mod(altUP,500) == 0 and altUP != 0) { |
|
711 |
var AltBigUP = sprintf(prefix~"%1d", altUP); |
|
712 |
var AltSmallUP = ""; |
|
713 |
} |
|
714 |
elsif (altUP < 1000 and (math.mod(altUP,500))) { |
|
715 |
var AltBigUP = ""; |
|
716 |
var AltSmallUP = sprintf(prefix~"%1d", int(math.mod(altUP,1000))); |
|
717 |
var offset = -30.078; |
|
718 |
} |
|
719 |
elsif ((altUP < 10000) and (altUP >= 1000) and (math.mod(altUP,500))) { |
|
720 |
var AltBigUP = sprintf(prefix~"%1d", int(altUP/1000)); |
|
721 |
var AltSmallUP = sprintf("%1d", int(math.mod(altUP,1000))); |
|
722 |
var offset += 15.039; |
|
723 |
} |
|
724 |
else { |
|
725 |
var AltBigUP = sprintf(prefix~"%1d", int(altUP/1000)); |
|
726 |
var mod = int(math.mod(altUP,1000)); |
|
727 |
var AltSmallUP = sprintf("%1d", mod); |
|
728 |
var offset += 30.078; |
|
729 |
} |
|
730 | ||
731 |
me.screenElements["AltBigU"~place].setText(AltBigUP); |
|
732 |
me.screenElements["AltSmallU"~place].setText(AltSmallUP); |
|
733 |
me.screenElements["AltSmallU"~place].setTranslation(offset,0); |
|
734 |
var altDOWN = altCentral - (place*100); |
|
735 |
var offset = -30.078; |
|
736 |
if (altDOWN < 0) { |
|
737 |
var altDOWN = -altDOWN; |
|
738 |
var prefix = "-"; |
|
739 |
var offset += 15.039; |
|
740 |
} |
|
741 |
else |
|
742 |
var prefix = ""; |
|
743 | ||
744 |
if (altDOWN == 0) { |
|
745 |
var AltBigDOWN = ""; |
|
746 |
var AltSmallDOWN = "0"; |
|
747 |
} |
|
748 |
elsif (math.mod(altDOWN,500) == 0 and altDOWN != 0) { |
|
749 |
var AltBigDOWN = sprintf(prefix~"%1d", altDOWN); |
|
750 |
var AltSmallDOWN = ""; |
|
751 |
} |
|
752 |
elsif (altDOWN < 1000 and (math.mod(altDOWN,500))) { |
|
753 |
var AltBigDOWN = ""; |
|
754 |
var AltSmallDOWN = sprintf(prefix~"%1d", int(math.mod(altDOWN,1000))); |
|
755 |
var offset = -30.078; |
|
756 |
} |
|
757 |
elsif ((altDOWN < 10000) and (altDOWN >= 1000) and (math.mod(altDOWN,500))) { |
|
758 |
var AltBigDOWN = sprintf(prefix~"%1d", int(altDOWN/1000)); |
|
759 |
var AltSmallDOWN = sprintf("%1d", int(math.mod(altDOWN,1000))); |
|
760 |
var offset += 15.039; |
|
761 |
} |
|
762 |
else { |
|
763 |
var AltBigDOWN = sprintf(prefix~"%1d", int(altDOWN/1000)); |
|
764 |
var mod = int(math.mod(altDOWN,1000)); |
|
765 |
var AltSmallDOWN = sprintf("%1d", mod); |
|
766 |
var offset += 30.078; |
|
767 |
} |
|
768 |
me.screenElements["AltBigD"~place].setText(AltBigDOWN); |
|
769 |
me.screenElements["AltSmallD"~place].setText(AltSmallDOWN); |
|
770 |
me.screenElements["AltSmallD"~place].setTranslation(offset,0); |
|
771 |
} |
|
772 |
} |
|
adds OAT, TAS, GSPD, WindDat...
|
773 |
me.updateSelectedALT(); |
trends animation
|
774 |
var now = systime(); |
775 |
# altitude in 6s |
|
776 |
var Sy = .3 * (alt - me._last_alt_ft) / (now - me._last_alt_s); # scale = 1/20ft |
|
777 |
if (abs(Sy) > 15) |
|
778 |
Sy = 15 * abs(Sy)/Sy; # = -15 or 15 |
|
779 |
me.screenElements['Altitude-Trend-Indicator'] |
|
780 |
.setScale(1,Sy) |
|
781 |
.setTranslation(0, -284.5 * (Sy - 1)); |
|
782 |
me._last_alt_ft = alt; |
|
783 |
me._last_alt_s = now; |
|
adds OAT, TAS, GSPD, WindDat...
|
784 |
settimer(func me.updateALT(), 0.2); |
animation ALT
|
785 |
}, |
trends animation
|
786 |
_last_alt_ft : 0, |
787 |
_last_alt_s : systime(), |
|
cosmétique: folding pour les...
|
788 |
#}}} |
animation HSI
|
789 | |
adds BARO settings
|
790 |
updateBARO : func () { |
791 |
# update BARO widget {{{ |
|
792 |
var fmt = me._baro_unit == 'inhg' ? '%.2f%s' : '%i%s'; |
|
793 |
me.screenElements['BARO-text'] |
|
794 |
.setText(sprintf(fmt, |
|
795 |
getprop('/instrumentation/altimeter/setting-' ~ me._baro_unit), |
|
796 |
me._baro_unit == 'inhg' ? 'in' : 'hPa') |
|
797 |
); |
|
798 |
}, |
|
799 |
_baro_unit : 'inhg', |
|
800 |
#}}} |
|
801 | ||
adds OAT, TAS, GSPD, WindDat...
|
802 |
updateHSI : func () { |
comment on the folds
|
803 |
# rotates the compass (PFD) {{{ |
make some data common to all...
|
804 |
var hdg = data.hdg; |
animation HSI
|
805 |
me.screenElements.Rose |
806 |
.setRotation(-hdg * D2R); |
|
807 |
me.screenElements['HDG-text'] |
|
808 |
.setText(sprintf("%03u°", hdg)); |
|
adds OAT, TAS, GSPD, WindDat...
|
809 |
settimer(func me.updateHSI(), 0.1); |
animation HSI
|
810 |
}, |
cosmétique: folding pour les...
|
811 |
#}}} |
NAV disponible (hors CDI)
|
812 | |
removes unecessary listeners
|
813 |
updateHDG : func () { |
comment on the folds
|
814 |
# moves the heading bug and display heading-deg for 3 seconds (PFD) {{{ |
improves role/name variables...
|
815 |
if (me.device.role == 'MFD') |
animation HDG bug
|
816 |
return; |
removes unecessary listeners
|
817 |
var hdg = getprop('/instrumentation/zkv1000/afcs/heading-bug-deg'); |
animation HDG bug
|
818 |
me.screenElements['Heading-bug'] |
819 |
.setRotation(hdg * D2R); |
|
820 |
me.screenElements['SelectedHDG-bg'] |
|
821 |
.show(); |
|
822 |
me.screenElements['SelectedHDG-bgtext'] |
|
823 |
.show(); |
|
824 |
me.screenElements['SelectedHDG-text'] |
|
825 |
.setText(sprintf('%03d°%s', hdg, '')) |
|
826 |
.show(); |
|
827 |
me.addTimer(3, ['SelectedHDG-text', 'SelectedHDG-bgtext', 'SelectedHDG-bg']); |
|
828 |
}, |
|
cosmétique: folding pour les...
|
829 |
#}}} |
animation HDG bug
|
830 | |
adds CDI
|
831 |
updateCRS : func () { |
anime CRS
|
832 |
# TODO: update display for NAV/GPS/BRG courses {{{ |
improves role/name variables...
|
833 |
if (me.device.role == 'MFD') |
anime CRS
|
834 |
return; |
adds CDI
|
835 |
var source = getprop('/instrumentation/zkv1000/cdi/source'); |
836 |
if (source == 'OFF') |
|
837 |
return; |
|
838 |
var crs = getprop('/instrumentation/zkv1000/cdi/course'); |
|
839 |
if (crs == nil) |
|
840 |
return; |
|
anime CRS
|
841 |
me.screenElements['SelectedCRS-bg'] |
842 |
.show(); |
|
843 |
me.screenElements['SelectedCRS-bgtext'] |
|
844 |
.show(); |
|
845 |
me.screenElements['SelectedCRS-text'] |
|
846 |
.setText(sprintf('%03d°%s', crs, '')) |
|
adds CDI
|
847 |
.setColor(source == 'GPS' ? me.colors.magenta : me.colors.green) |
anime CRS
|
848 |
.show(); |
849 |
me.addTimer(3, ['SelectedCRS-text', 'SelectedCRS-bgtext', 'SelectedCRS-bg']); |
|
850 |
}, |
|
851 |
#}}} |
|
852 | ||
adds OAT, TAS, GSPD, WindDat...
|
853 |
updateSelectedALT : func { |
854 |
# animation for altitude section, called via updatedALT {{{ |
|
creates flightdeck hash to p...
|
855 |
if (! me.screenElements['SelectedALT'].getVisible()) |
fix Selected Altitude displa...
|
856 |
return; |
adds OAT, TAS, GSPD, WindDat...
|
857 |
var selected_alt = getprop('/instrumentation/zkv1000/afcs/selected-alt-ft'); |
make some data common to all...
|
858 |
var delta_alt = data.alt - selected_alt; |
adds OAT, TAS, GSPD, WindDat...
|
859 |
if (abs(delta_alt) > 300) |
860 |
delta_alt = 300 * abs(delta_alt)/delta_alt; |
|
fix Selected Altitude displa...
|
861 |
me.screenElements['SelectedALT-symbol'] |
862 |
.setVisible(abs(delta_alt) > 100); |
|
863 |
me.screenElements['SelectedALT-bg'] |
|
864 |
.setVisible(abs(delta_alt) > 100); |
|
865 |
me.screenElements['SelectedALT-text'] |
|
866 |
.setText(sprintf("%i", selected_alt)) |
|
adds OAT, TAS, GSPD, WindDat...
|
867 |
.setVisible(abs(delta_alt) > 100); |
fix Selected Altitude displa...
|
868 |
me.screenElements['SelectedALT-bug'] |
adds OAT, TAS, GSPD, WindDat...
|
869 |
.setTranslation(0, delta_alt * 0.567); # 170/300 = 0.567 |
870 |
}, |
|
871 |
#}}} |
|
872 | ||
adds CDI
|
873 |
updateCDI : func { |
874 |
# animation for CDI {{{ |
|
875 |
var source = getprop('/instrumentation/zkv1000/cdi/source'); |
|
876 |
if (source == 'OFF') { |
|
877 |
foreach (var s; ['GPS', 'NAV1', 'NAV2']) |
|
878 |
foreach (var t; ['pointer', 'CDI']) |
|
879 |
me.screenElements[s ~ '-' ~ t].hide(); |
|
880 |
me.screenElements['CDI-GPS-ANN-text'].hide(); |
|
881 |
me.screenElements['CDI-GPS-XTK-text'].hide(); |
|
882 |
me.screenElements['CDI-SRC-text'].hide(); |
|
883 |
me.screenElements['CDI'].hide(); |
|
884 |
} |
|
885 |
else { |
|
886 |
var course = getprop('/instrumentation/zkv1000/cdi/course'); |
|
make some data common to all...
|
887 |
var rot = (course - data.hdg) * D2R; |
adds CDI
|
888 |
me.screenElements['CDI'] |
makes the CDI available
|
889 |
.setRotation(rot) |
adds CDI
|
890 |
.show(); |
891 |
me.screenElements['GPS-CTI'] |
|
animates GPS-CTI
|
892 |
.setVisible(getprop('/instrumentation/gps/wp/wp[1]/valid')) |
893 |
.setRotation(getprop('/instrumentation/gps/wp/wp[1]/course-deviation-deg') * D2R); |
|
adds CDI
|
894 |
me.screenElements['GPS-CTI-diamond'] |
animates GPS-CTI
|
895 |
.setVisible(getprop('/instrumentation/gps/wp/wp[1]/valid')) |
896 |
.setRotation(getprop('/instrumentation/gps/wp/wp[1]/course-deviation-deg') * D2R); |
|
adds CDI
|
897 |
foreach (var s; ['GPS', 'NAV1', 'NAV2']) { |
898 |
me.screenElements[s ~ '-pointer'] |
|
899 |
.setRotation(rot) |
|
900 |
.setVisible(source == s); |
|
901 |
me.screenElements[s ~ '-CDI'] |
|
902 |
.setVisible(source == s); |
|
903 |
foreach (var f; ['FROM', 'TO']) |
|
904 |
me.screenElements[s ~ '-' ~ f] |
|
makes the CDI available
|
905 |
.setVisible(s == source and getprop('/instrumentation/zkv1000/cdi/' ~ f ~ '-flag')); |
adds CDI
|
906 |
me.screenElements['CDI-SRC-text'] |
907 |
.setText(source) |
|
908 |
.setColor(source == 'GPS' ? me.colors.magenta : me.colors.green) |
|
909 |
.show(); |
|
910 |
} |
|
makes the CDI available
|
911 |
var deflection = getprop('/instrumentation/zkv1000/cdi/course-deflection'); |
912 |
if (left(source, 3) == 'NAV') |
|
913 |
var scale = deflection / 4; |
|
914 |
else { # GPS |
|
915 |
# TODO: deviation depending of the flight phase |
|
916 |
# for now fixed 1 dot = 1 nm course error |
|
917 |
var abs_deflection = abs(deflection); |
|
918 |
me.screenElements['CDI-GPS-XTK-text'] |
|
919 |
.setText(sprintf('XTK %iNM', abs_deflection)) |
|
920 |
.setVisible(abs_deflection > 2.4); |
|
921 |
var scale = deflection / 2; |
|
922 |
} |
|
923 |
scale = (abs(scale) > 1.2) ? 1.2 : scale; |
|
924 |
me.screenElements[source ~ '-CDI'] |
|
925 |
.setTranslation(65 * scale, 0); |
|
926 |
settimer(func me.updateCDI(), 0.3); |
|
adds CDI
|
927 |
} |
928 |
}, |
|
929 |
#}}} |
|
930 | ||
ajout COMM, et factorisation...
|
931 |
_updateRadio: func { |
comment on the folds
|
932 |
# common parts for NAV/LOC/COMM radios{{{ |
ajout COMM, et factorisation...
|
933 |
# arg[0]._r = <comm|nav> |
934 |
if (contains(arg[0], "active")) { |
|
935 |
if (arg[0]['active'] == 'none') { |
|
936 |
me.screenElements[arg[0]._r ~ '1-selected-freq'] |
|
937 |
.setColor(1,1,1); |
|
938 |
me.screenElements[arg[0]._r ~ '2-selected-freq'] |
|
939 |
.setColor(1,1,1); |
|
940 |
} |
|
941 |
else { |
|
942 |
me.screenElements[arg[0]._r ~ arg[0]['active'] ~ '-selected-freq'] |
|
943 |
.setColor(0,1,0); |
|
944 |
me.screenElements[arg[0]._r ~ arg[0].inactive ~ '-selected-freq'] |
|
945 |
.setColor(1,1,1); |
|
946 |
} |
|
947 |
} |
|
948 |
if (contains(arg[0], 'tune')) { |
|
949 |
# n = 0 -> NAV1/COMM1 |
|
950 |
# n = 1 -> NAV1/COMM2 |
|
951 |
me.screenElements[arg[0]._r ~ '-freq-switch'] |
|
952 |
.setTranslation(0, arg[0].tune * 25); |
|
953 |
me.screenElements[arg[0]._r ~ (arg[0].tune + 1) ~ '-standby-freq'] |
|
954 |
.setColor(0,1,1); |
|
955 |
me.screenElements[arg[0]._r ~ ((arg[0].tune == 0) + 1) ~ '-standby-freq'] |
|
956 |
.setColor(1,1,1); |
|
957 |
} |
|
958 |
if (contains(arg[0], 'refresh')) { |
|
small stuff
|
959 |
# refresh only one line: NAV1/COMM1 or NAV2/COMM2 |
ajout COMM, et factorisation...
|
960 |
var fmt = (arg[0]._r == 'nav') ? '%.2f' : '%.3f'; |
961 |
me.screenElements[arg[0]._r ~ arg[0].refresh ~ '-selected-freq'] |
|
962 |
.setText(sprintf(fmt, getprop('/instrumentation/' |
|
963 |
~ arg[0]._r ~ '[' ~ (arg[0].refresh - 1) ~ ']/frequencies/selected-mhz'))); |
|
964 |
me.screenElements[arg[0]._r ~ arg[0].refresh ~ '-standby-freq'] |
|
965 |
.setText(sprintf(fmt, getprop('/instrumentation/' |
|
966 |
~ arg[0]._r ~ '[' ~ (arg[0].refresh - 1) ~ ']/frequencies/standby-mhz'))); |
|
967 |
} |
|
968 |
if (contains(arg[0], 'set')) { |
|
969 |
# positionne la valeur modifiée, les listeners "trigguent" en permanence ces propriétés, donc exit |
|
970 |
var n = getprop('/instrumentation/zkv1000/radios/' ~ arg[0]._r ~ '-tune'); |
|
971 |
var fmt = (arg[0]._r == 'nav') ? '%.2f' : '%.3f'; |
|
972 |
me.screenElements[arg[0]._r ~ (n + 1) ~ '-standby-freq'] |
|
fix freq display while setti...
|
973 |
.setText(sprintf(fmt, getprop('/instrumentation/' ~ arg[0]._r ~ '[' ~ n ~ ']/frequencies/standby-mhz'))); |
ajout COMM, et factorisation...
|
974 |
} |
975 |
if (contains(arg[0], 'auto')) { |
|
976 |
# pour rafraichir automagiquement, toutes les deux secondes un refresh pour un NAV |
|
977 |
var radio = arg[0].auto; |
|
978 |
me._updateRadio({refresh: 1, _r: radio}); |
|
979 |
settimer(func me._updateRadio({refresh: 2, _r: radio}), 1); |
|
980 |
settimer(func me._updateRadio({auto: radio}), 2); |
|
981 |
} |
|
982 |
}, |
|
cosmétique: folding pour les...
|
983 |
#}}} |
ajout COMM, et factorisation...
|
984 | |
NAV disponible (hors CDI)
|
985 |
updateNAV : func { |
comment on the folds
|
986 |
# update NAV/LOC rodios display upper left (PFD/MFD){{{ |
NAV disponible (hors CDI)
|
987 |
# made active via menu |
988 |
if (contains(arg[0], "active")) { |
|
adds CDI
|
989 |
arg[0]._r = 'nav'; |
NAV disponible (hors CDI)
|
990 |
if (arg[0]['active'] == 'none') { |
ajout COMM, et factorisation...
|
991 |
me._updateRadio(arg[0]); |
NAV disponible (hors CDI)
|
992 |
me.screenElements['nav1-id'] |
993 |
.setColor(1,1,1); |
|
994 |
me.screenElements['nav2-id'] |
|
995 |
.setColor(1,1,1); |
|
996 |
me.screenElements['NAV1-pointer'] |
|
997 |
.hide(); |
|
998 |
me.screenElements['NAV2-pointer'] |
|
999 |
.hide(); |
|
1000 |
} |
|
1001 |
else { |
|
ajout COMM, et factorisation...
|
1002 |
arg[0].inactive = (arg[0]['active'] == 1) + 1; |
1003 |
me._updateRadio(arg[0]); |
|
NAV disponible (hors CDI)
|
1004 |
me.screenElements['nav' ~ arg[0]['active'] ~ '-id'] |
1005 |
.setColor(0,1,0); |
|
1006 |
me.screenElements['NAV' ~ arg[0]['active'] ~ '-pointer'] |
|
1007 |
.show(); |
|
ajout COMM, et factorisation...
|
1008 |
me.screenElements['nav' ~ arg[0].inactive ~ '-id'] |
1009 |
.setColor(1,1,1); |
|
NAV disponible (hors CDI)
|
1010 |
# me.screenElements['HDI'] |
1011 |
# .setRotation(); |
|
1012 |
# me.screenElements['NAV' ~ inactive ~ '-pointer'] |
|
1013 |
# .hide(); |
|
1014 |
# foreach (var e; [ 'FROM', 'TO', 'CDI' ]) |
|
1015 |
# me.screenElements['NAV' ~ inactive ~ '-' ~ e] |
|
1016 |
# .hide(); |
|
1017 |
} |
|
1018 |
} |
|
ajout COMM, et factorisation...
|
1019 |
elsif (contains(arg[0], 'nav-id')) { |
Correction swap NAV tuning
|
1020 |
# TODO: récupérer la valeur via les paramètres transmis du listener |
ajout COMM, et factorisation...
|
1021 |
if (arg[0].val == nil) |
1022 |
arg[0].val = ''; |
|
NAV disponible (hors CDI)
|
1023 |
me.screenElements["nav" ~ arg[0]['nav-id'] ~ "-id"] |
ajout COMM, et factorisation...
|
1024 |
.setText(arg[0].val); |
NAV disponible (hors CDI)
|
1025 |
} |
ajout COMM, et factorisation...
|
1026 |
else { |
1027 |
arg[0]._r = 'nav'; |
|
1028 |
me._updateRadio(arg[0]); |
|
NAV disponible (hors CDI)
|
1029 |
} |
1030 |
}, |
|
cosmétique: folding pour les...
|
1031 |
#}}} |
ajout COMM, et factorisation...
|
1032 | |
1033 |
updateCOMM: func { |
|
comment on the folds
|
1034 |
# update COMM radios display upper right (PFD/MFD){{{ |
ajout COMM, et factorisation...
|
1035 |
arg[0]._r = 'comm'; |
1036 |
me._updateRadio(arg[0]); |
|
1037 |
}, |
|
cosmétique: folding pour les...
|
1038 |
#}}} |
anime time display
|
1039 | |
1040 |
updateTIME : func { |
|
1041 |
# updates the displayed time botoom left {{{ |
|
1042 |
me.screenElements['TIME-text'] |
|
1043 |
.setText(getprop('/sim/time/gmt-string')); |
|
1044 |
settimer(func me.updateTIME(), 1); |
|
1045 |
}, |
|
1046 |
#}}} |
|
adds OAT, TAS, GSPD, WindDat...
|
1047 | |
adds transponder
|
1048 |
updateXPDR : func { |
1049 |
# updates transponder display {{{ |
|
1050 |
for (var d = 0; d < 4; d+=1) |
|
1051 |
me.screenElements['XPDR-DIGIT-' ~ d ~ '-text'] |
|
1052 |
.setText(sprintf('%i', getprop('/instrumentation/transponder/inputs/digit[' ~ d ~ ']'))); |
|
1053 |
var tuning = getprop('/instrumentation/zkv1000/radios/xpdr-tuning-digit'); |
|
XPDR settings via knob or so...
|
1054 |
var fms = getprop('/instrumentation/zkv1000/radios/xpdr-tuning-fms-method'); |
1055 |
for (var d = 0; d < 4; d+=1) |
|
1056 |
me.screenElements['XPDR-DIGIT-' ~ d ~ '-text'] |
|
1057 |
.setColor(1,1,1); |
|
1058 |
if (tuning != nil) { |
|
1059 |
me.screenElements['XPDR-DIGIT-' ~ tuning ~ '-text'] |
|
1060 |
.setColor(0,1,1); |
|
1061 |
if (fms) |
|
1062 |
me.screenElements['XPDR-DIGIT-' ~ (tuning - 1) ~ '-text'] |
|
1063 |
.setColor(0,1,1); |
|
1064 |
} |
|
adds transponder
|
1065 |
else { |
1066 |
if (getprop('/instrumentation/transponder/ident')) |
|
1067 |
var mode = 'IDENT'; |
|
1068 |
else |
|
1069 |
var mode = getprop('/instrumentation/zkv1000/radio/xpdr-mode'); |
|
1070 |
var wow = getprop('/gear/gear/wow'); |
|
1071 |
if (! wow and mode != 'STBY') |
|
1072 |
var color = [0, 1, 0]; |
|
1073 |
else |
|
1074 |
var color = [1, 1, 1]; |
|
1075 |
for (var d = 0; d < 4; d+=1) |
|
1076 |
me.screenElements['XPDR-DIGIT-' ~ d ~ '-text'] |
|
1077 |
.setColor(color); |
|
1078 |
me.screenElements['XPDR-MODE-text'] |
|
1079 |
.setColor(color) |
|
1080 |
.setText(mode); |
|
1081 |
} |
|
XPDR settings via knob or so...
|
1082 |
}, |
adds transponder
|
1083 |
#}}} |
1084 | ||
adds OAT, TAS, GSPD, WindDat...
|
1085 |
updateOAT : func { |
1086 |
# update OAT display on normal and reversionnary modes (every 3s) {{{ |
|
1087 |
var tmp = getprop('/environment/temperature-deg' ~ me._oat_unit); |
|
1088 |
me.screenElements['OAT-text'] |
|
1089 |
.setText(sprintf((abs(tmp) < 10) ? "%.1f %s" : "%i %s", tmp, (me._oat_unit == 'c') ? '°C' : 'F')); |
|
1090 |
settimer(func me.updateOAT(), 3); |
|
1091 |
}, |
|
1092 |
_oat_unit : 'c', |
|
1093 |
#}}} |
|
1094 | ||
1095 |
updateWindData : func { |
|
1096 |
# update the window text and arrows for OPTN1/2 {{{ |
|
1097 |
if (me._winddata_optn == 0) |
|
1098 |
return; |
|
make some data common to all...
|
1099 |
if (data.ias < 30) { |
improves WindData display
|
1100 |
me.screenElements['WindData-NODATA'] |
1101 |
.hide(); |
|
1102 |
var wind_hdg = getprop('/environment/wind-from-heading-deg'); |
|
1103 |
var wind_spd = getprop('/environment/wind-speed-kt'); |
|
make some data common to all...
|
1104 |
var alpha = wind_hdg - data.hdg; |
improves WindData display
|
1105 |
if (me._winddata_optn == 1) { |
1106 |
me.screenElements['WindData-OPTN1-HDG'] |
|
1107 |
.setRotation((alpha + 180) * D2R) |
|
1108 |
.show(); |
|
1109 |
me.screenElements['WindData-OPTN1-HDG-text'] |
|
1110 |
.setText(sprintf("%03i°", wind_hdg)) |
|
1111 |
.show(); |
|
1112 |
me.screenElements['WindData-OPTN1-SPD-text'] |
|
1113 |
.setText(int(wind_spd) ~ 'KT') |
|
1114 |
.show(); |
|
adds OAT, TAS, GSPD, WindDat...
|
1115 |
} |
improves WindData display
|
1116 |
else { # me._winddata_optn == 2 |
1117 |
alpha *= D2R; |
|
1118 |
var Vt = wind_spd * math.sin(alpha); |
|
1119 |
var Ve = wind_spd * math.cos(alpha); |
|
1120 |
if (Vt != 0) { |
|
1121 |
me.screenElements['WindData-OPTN2-crosswind-text'] |
|
1122 |
.setText(sprintf('%i', abs(Vt))) |
|
1123 |
.show(); |
|
1124 |
me.screenElements['WindData-OPTN2-crosswind'] |
|
1125 |
.setScale(-abs(Vt)/Vt, 1) |
|
1126 |
.setTranslation(-35 * (abs(Vt)/Vt + 1), 0) |
|
1127 |
.show(); |
|
1128 |
} |
|
1129 |
if (Ve != 0) { |
|
1130 |
me.screenElements['WindData-OPTN2-headwind-text'] |
|
1131 |
.setText(sprintf('%i', abs(Ve))) |
|
1132 |
.show(); |
|
1133 |
me.screenElements['WindData-OPTN2-headwind'] |
|
1134 |
.setScale(1, abs(Ve)/Ve) |
|
1135 |
.setTranslation(0, 515 * (1 - abs(Ve)/Ve)) |
|
1136 |
.show(); |
|
1137 |
} |
|
adds OAT, TAS, GSPD, WindDat...
|
1138 |
} |
1139 |
} |
|
improves WindData display
|
1140 |
else { |
1141 |
foreach (var e; [ |
|
1142 |
'WindData-OPTN1-HDG', |
|
1143 |
'WindData-OPTN1-HDG-text', |
|
1144 |
'WindData-OPTN1-SPD-text', |
|
1145 |
'WindData-OPTN2-crosswind-text', |
|
1146 |
'WindData-OPTN2-crosswind', |
|
1147 |
'WindData-OPTN2-headwind-text', |
|
1148 |
'WindData-OPTN2-headwind' |
|
1149 |
]) |
|
1150 |
me.screenElements[e].hide(); |
|
1151 |
me.screenElements['WindData-NODATA'].show(); |
|
1152 |
} |
|
adds OAT, TAS, GSPD, WindDat...
|
1153 |
settimer(func me.updateWindData(), 0.5); |
1154 |
}, |
|
1155 |
_winddata_optn : 0, |
|
1156 |
#}}} |
|
adds BRG1/2 animation
|
1157 | |
adds AOA display
|
1158 |
updateAOA : func { |
1159 |
# update Angle Of Attack {{{ |
|
1160 |
if (me.device.data.aoa == 0) |
|
1161 |
return; |
|
1162 |
var color = [1,1,1]; |
|
1163 |
var norm = data.aoa / data['stall-aoa']; |
|
nicer AOA display
|
1164 |
me.screenElements['AOA-text'] |
1165 |
.setText(sprintf('% .1f', norm)); |
|
adds AOA display
|
1166 |
if (norm > 1) norm = 1; |
1167 |
if (norm > 0.9) |
|
1168 |
color = [1,0,0]; |
|
1169 |
elsif (norm > 0.7) |
|
1170 |
color = [1,1,0]; |
|
1171 |
elsif (norm < 0) { |
|
1172 |
norm = 0; |
|
1173 |
color = [1,0,0]; |
|
1174 |
} |
|
1175 |
me.screenElements['AOA-needle'] |
|
1176 |
.setRotation(-norm * math.pi) |
|
nicer AOA display
|
1177 |
.setColorFill(color); |
1178 |
me.screenElements['AOA-text'] |
|
adds AOA display
|
1179 |
.setColor(color); |
1180 |
settimer(func me.updateAOA(), 0.1); |
|
1181 |
}, |
|
1182 |
# }}} |
|
1183 | ||
adds BRG1/2 animation
|
1184 |
updateBRG : func { |
some added comments
|
1185 |
# displays and update BRG1/2 {{{ |
adds BRG1/2 animation
|
1186 |
foreach (var brg; [1, 2]) { |
1187 |
var source = 'brg' ~ brg ~ '-source'; |
|
1188 | ||
1189 |
var dev = radios.getNode(source).getValue(); |
|
1190 |
var el = 'BRG' ~ brg; |
|
1191 |
if (dev != 'OFF') { |
|
1192 |
var info = { |
|
1193 |
pointer : nil, |
|
1194 |
id : 'NO DATA', |
|
1195 |
hdg : nil, |
|
1196 |
dst : '--.-NM' |
|
1197 |
}; |
|
1198 |
if (left(dev, 3) == 'NAV') { |
|
1199 |
info.pointer = getprop('/instrumentation/nav[' ~ (brg - 1) ~ ']/in-range'); |
|
1200 |
if (info.pointer) { |
|
1201 |
info.id = getprop('/instrumentation/nav[' ~ (brg - 1) ~ ']/nav-id'); |
|
1202 |
info.hdg = getprop('/instrumentation/nav[' ~ (brg - 1) ~ ']/heading-deg'); |
|
1203 |
info.dst = sprintf('%.1d', getprop('/instrumentation/nav[' ~ (brg - 1) ~ ']/nav-distance') / 1852); # m -> /1852 |
|
1204 |
} |
|
1205 |
} |
|
1206 |
elsif (dev == 'GPS') { |
|
1207 |
info.pointer = props.getNode('/instrumentation/gps/wp').getChild('wp[1])'); |
|
1208 |
if (info.pointer) { |
|
1209 |
info.id = getprop('/instrumentation/gps/wp/wp[1]/ID'); |
|
1210 |
info.hdg = getprop('/instrumentation/gps/wp/wp[1]/bearing-mag-deg'); |
|
1211 |
info.dst = sprintf('%.1d', getprop('/instrumentation/gps/wp/wp[1]/distance-nm')); |
|
1212 |
} |
|
1213 |
} |
|
1214 |
else { # there are 2 available ADF in FG, but instrument manage only 1 |
|
1215 |
info.pointer = getprop('/instrumentation/adf/in-range'); |
|
1216 |
if (info.pointer) { |
|
1217 |
info.id = getprop('/instrumentation/adf/ident'); |
|
1218 |
info.hdg = getprop('/instrumentation/adf/indicated-bearing-deg'); |
|
1219 |
} |
|
1220 |
} |
|
1221 | ||
1222 |
if (info.pointer) |
|
1223 |
me.screenElements[el ~ '-pointer'] |
|
make some data common to all...
|
1224 |
.setRotation(-info.hdg - data.hdg * D2R) |
adds BRG1/2 animation
|
1225 |
.show(); |
1226 |
else |
|
1227 |
me.screenElements[el ~ '-pointer'] |
|
1228 |
.hide(); |
|
1229 |
me.screenElements[el ~ '-SRC-text'] |
|
1230 |
.setText(dev); |
|
1231 |
me.screenElements[el ~ '-DST-text'] |
|
1232 |
.setText(info.dst); |
|
1233 |
me.screenElements[el ~ '-WPID-text'] |
|
1234 |
.setText(info.id); |
|
1235 |
me.screenElements['BRG' ~ brg] |
|
1236 |
.show(); |
|
1237 |
} |
|
1238 |
else { |
|
1239 |
me.screenElements['BRG' ~ brg] |
|
1240 |
.hide(); |
|
1241 |
} |
|
1242 |
} |
|
colorize BRG1/2 when needed,...
|
1243 |
settimer(func me.updateBRG(), 0.5); |
adds BRG1/2 animation
|
1244 |
}, |
some added comments
|
1245 |
#}}} |
softkeys are available now
|
1246 | |
adds OMI to PFD
|
1247 |
updateOMI : func { |
1248 |
# display marker baecon Outer, Middle, Inner {{{ |
|
1249 |
var marker = nil; |
|
1250 |
foreach (var m; ['outer', 'middle', 'inner']) |
|
1251 |
if (getprop('/instrumentation/marker-beacon/' ~ m)) { |
|
1252 |
marker = m; |
|
1253 |
me.screenElements['OMI'] |
|
1254 |
.show(); |
|
1255 |
break; |
|
1256 |
} |
|
1257 |
if (marker != nil) { |
|
1258 |
me.screenElements['MarkerText'] |
|
1259 |
.setText(me._omi_data[marker].t) |
|
1260 |
.show(); |
|
1261 |
me.screenElements['MarkerBG'] |
|
1262 |
.setColorFill(me._omi_data[marker].bg) |
|
1263 |
.show(); |
|
1264 |
} |
|
1265 |
else |
|
1266 |
me.screenElements['OMI'] |
|
1267 |
.hide(); |
|
1268 |
settimer(func me.updateOMI(), 1); |
|
1269 |
}, |
|
1270 |
_omi_data : { |
|
1271 |
'outer': {t: 'O', bg: [0,1,1]}, |
|
1272 |
'middle': {t: 'M', bg: [1,1,1]}, |
|
1273 |
'inner': {t: 'I', bg: [1,1,0]}, |
|
1274 |
}, |
|
1275 |
#}}} |
|
animation texts EIS + power ...
|
1276 |
}; |