NAV disponible (hors CDI)
|
1 |
var setListeners = func { |
2 |
setlistener('/instrumentation/nav/nav-id', |
|
correction listeners
|
3 |
func (n) { |
4 |
var val = n.getValue(); |
|
creates flightdeck hash to p...
|
5 |
foreach (var c; keys(flightdeck)) |
removes unecessary listeners
|
6 |
flightdeck[c].display.updateNAV({'nav-id': 1, val: val}); |
NAV disponible (hors CDI)
|
7 |
}, 1, 2); |
8 |
setlistener('/instrumentation/nav[1]/nav-id', |
|
correction listeners
|
9 |
func (n) { |
10 |
var val = n.getValue(); |
|
creates flightdeck hash to p...
|
11 |
foreach (var c; keys(flightdeck)) |
removes unecessary listeners
|
12 |
flightdeck[c].display.updateNAV({'nav-id': 2, val: val}); |
NAV disponible (hors CDI)
|
13 |
}, 1, 2); |
removes unecessary listeners
|
14 |
# keep this listener as long as the code is to heavy to be modified in multiple places |
adds OAT, TAS, GSPD, WindDat...
|
15 |
setlistener('/instrumentation/zkv1000/afcs/selected-alt-ft', |
16 |
func (n) { |
|
17 |
var val = n.getValue(); |
|
creates flightdeck hash to p...
|
18 |
if (val != nil) |
19 |
foreach (var c; keys(flightdeck)) |
|
removes unecessary listeners
|
20 |
if (flightdeck[c].role == 'PFD') { |
creates flightdeck hash to p...
|
21 |
if (! flightdeck[c].display.screenElements['SelectedALT'].getVisible()) { |
22 |
flightdeck[c].display.screenElements['SelectedALT'].show(); |
|
23 |
flightdeck[c].display.screenElements['SelectedALT-text'].show(); |
|
24 |
flightdeck[c].display.screenElements['SelectedALT-symbol'].show(); |
|
25 |
flightdeck[c].display.screenElements['SelectedALT-bug'].show(); |
|
26 |
flightdeck[c].display.screenElements['SelectedALT-bg'].show(); |
|
27 |
} |
|
28 |
flightdeck[c].display.updateSelectedALT(); |
|
29 |
} |
|
adds OAT, TAS, GSPD, WindDat...
|
30 |
}, 0, 2); |
adds transponder
|
31 |
setlistener('/gear/gear/wow', |
creates flightdeck hash to p...
|
32 |
func foreach (var c; keys(flightdeck)) |
removes unecessary listeners
|
33 |
if (flightdeck[c].role == 'PFD') |
creates flightdeck hash to p...
|
34 |
flightdeck[c].display.updateXPDR(), |
adds transponder
|
35 |
0, 0); |
adds BARO settings
|
36 |
setlistener('/instrumentation/altimeter/setting-inhg', |
creates flightdeck hash to p...
|
37 |
func foreach (var c; keys(flightdeck)) |
removes unecessary listeners
|
38 |
if (flightdeck[c].role == 'PFD') |
creates flightdeck hash to p...
|
39 |
flightdeck[c].display.updateBARO(), 0, 2); |
NAV disponible (hors CDI)
|
40 |
} |
41 | ||
commit initial
|
42 |
var deviceClass = { |
improves role/name variables...
|
43 |
new: func (name) { |
commit initial
|
44 |
var m = { parents: [ deviceClass ] }; |
improves role/name variables...
|
45 |
m.name = name; |
46 |
m.role = substr(name, 0, 3); |
|
47 |
m.node = zkv.getNode(name, 1); |
|
add V-speeds bugs
|
48 |
m.data = {}; |
first attempt to centralize ...
|
49 |
m.timers = {}; |
put Vspeeds in common data s...
|
50 |
foreach (var v; ['Vx', 'Vy', 'Vr', 'Vglide']) |
add V-speeds bugs
|
51 |
m.data[v ~ '-visible'] = 1; |
configurable display size, v...
|
52 |
foreach (var v; ['screen-object', 'screen-view', 'screen-size']) |
53 |
m.data[v] = getprop('/instrumentation/zkv1000/' ~ name ~ '/' ~ v); |
|
massive code reorganisation ...
|
54 | |
improves role/name variables...
|
55 |
m.display = displayClass.new(m); |
56 |
m.softkeys = softkeysClass.new(m); |
|
57 |
m.buttons = buttonsClass.new(m); |
|
XPDR settings via knob or so...
|
58 |
m.knobs = knobsClass.new(m); |
massive code reorganisation ...
|
59 |
m.map = mapClass.new(m); |
TMR/REF window
|
60 |
m.windows = pageClass.new(m); |
massive code reorganisation ...
|
61 | |
62 |
if (! contains(data.timers, 'map')) { |
|
63 |
data.timers.map = maketimer(1, m, func { |
|
64 |
foreach (var d; keys(flightdeck)) |
|
65 |
flightdeck[d].map.update(); |
|
66 |
var gspd = getprop('/velocities/groundspeed-kt'); |
|
67 |
if (gspd != 0) |
|
68 |
var next = (me.data['range-nm']/(gspd/3600))/(me.display.display.get('view[1]')/2); |
|
69 |
else |
|
70 |
var next = 10; |
|
71 |
if (next > 10) |
|
72 |
next = 10; |
|
73 |
data.timers.map.restart(next); |
|
74 |
}); |
|
75 |
data.timers.map.singleShot = 1; |
|
76 |
data.timers.map.start(); |
|
77 |
} |
|
78 |
m.display.showInitProgress(); |
|
79 | ||
improves role/name variables...
|
80 |
setprop('/instrumentation/zkv1000/' ~ m.name ~ '/status', 1); |
81 |
msg(m.name ~ ' switched on!'); |
|
commit initial
|
82 |
return m; |
83 |
}, |
|
84 |
}; |
|
85 | ||
PFD+MFD allumés ensemble
|
86 |
var powerOn = func { |
global timers started at pow...
|
87 |
foreach (var freq; keys(data.timers)) |
88 |
data.timers[freq].start(); |
|
89 | ||
improves role/name variables...
|
90 |
foreach (var name; keys(flightdeck)) |
91 |
if (zkv.getNode(name) != nil) |
|
new var organistaion (and fi...
|
92 |
# thread.newthread(func { |
improves role/name variables...
|
93 |
flightdeck[name] = deviceClass.new(name); |
new var organistaion (and fi...
|
94 |
# }); |
correction listeners
|
95 |
settimer(setListeners, 5); |
commit initial
|
96 |
} |