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