... | ... |
@@ -41,7 +41,7 @@ var setListeners = func { |
41 | 41 |
flightdeck[c].display.updateXPDR(), |
42 | 42 |
0, 0); |
43 | 43 |
|
44 |
- prop = '/instrumentation/altimeter/setting-inhg'; |
|
44 |
+ prop = misc.getNode('alt-setting-inhg').getPath(); |
|
45 | 45 |
data.listeners[prop] = setlistener(prop, |
46 | 46 |
func foreach (var c; keys(flightdeck)) |
47 | 47 |
if (flightdeck[c].role == 'PFD') |
... | ... |
@@ -86,6 +86,14 @@ var deviceClass = { |
86 | 86 |
m.map = mapClass.new(m); |
87 | 87 |
m.windows = pageClass.new(m); |
88 | 88 |
|
89 |
+ if (! contains(data.timers, 'alt-setting-inhg')) { |
|
90 |
+ data.timers['alt-setting-inhg'] = maketimer(0.1, m, func { |
|
91 |
+ var inhg = getprop('/instrumentation/altimeter/setting-inhg'); |
|
92 |
+ if (inhg != misc.getValue('alt-setting-inhg')) |
|
93 |
+ misc.getNode('alt-setting-inhg').setValue(inhg); |
|
94 |
+ }); |
|
95 |
+ data.timers['alt-setting-inhg'].start(); |
|
96 |
+ } |
|
89 | 97 |
if (! contains(data.timers, 'map')) { |
90 | 98 |
data.timers.map = maketimer(1, m, func { |
91 | 99 |
foreach (var d; keys(flightdeck)) |
... | ... |
@@ -61,7 +61,7 @@ var data = { # set of data common to all devices |
61 | 61 |
listeners : {}, |
62 | 62 |
}; |
63 | 63 |
|
64 |
-var zkv = cdi = radios = alerts = infos = cursors = afcs = eis = nil; |
|
64 |
+var zkv = cdi = radios = alerts = infos = cursors = afcs = eis = misc = nil; |
|
65 | 65 |
|
66 | 66 |
var init_props = func { |
67 | 67 |
zkv = props.globals.getNode('/instrumentation/zkv1000',1); |
... | ... |
@@ -137,6 +137,9 @@ var init_props = func { |
137 | 137 |
afcs.getNode('pit-active-mode-blink',1).setBoolValue(0); |
138 | 138 |
afcs.getNode('route',1); |
139 | 139 |
|
140 |
+ misc = zkv.getNode('misc',1); |
|
141 |
+ misc.getNode('alt-setting-inhg',1).setDoubleValue(getprop('/instrumentation/altimeter/setting-inhg')); |
|
142 |
+ |
|
140 | 143 |
eis = zkv.getNode('eis',1); |
141 | 144 |
eis.getNode('fuel-qty-at-start', 1).setValue( |
142 | 145 |
getprop('/consumables/fuel/tank/level-gal_us') |