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