... | ... |
@@ -33,20 +33,30 @@ var main_loop = func () { |
33 | 33 |
# les listeners triggent en permanence sur les fréquences... |
34 | 34 |
var setListeners = func { |
35 | 35 |
setlistener('/instrumentation/nav/nav-id', |
36 |
- func { |
|
37 |
- device[0].display.updateNAV({'nav-id': 1}); |
|
38 |
- device[0].display.updateNAV({'nav-id': 1}); |
|
36 |
+ func (n) { |
|
37 |
+ var val = n.getValue(); |
|
38 |
+ device[0].display.updateNAV({'nav-id': 1, val: val}); |
|
39 |
+ device[0].display.updateNAV({'nav-id': 1, val: val}); |
|
39 | 40 |
}, 1, 2); |
40 | 41 |
setlistener('/instrumentation/nav[1]/nav-id', |
41 |
- func { |
|
42 |
- device[0].display.updateNAV({'nav-id': 2}); |
|
43 |
- device[1].display.updateNAV({'nav-id': 2}); |
|
42 |
+ func (n) { |
|
43 |
+ var val = n.getValue(); |
|
44 |
+ device[0].display.updateNAV({'nav-id': 2, val: val}); |
|
45 |
+ device[1].display.updateNAV({'nav-id': 2, val: val}); |
|
44 | 46 |
}, 1, 2); |
45 | 47 |
setlistener('/instrumentation/zkv1000/radios/nav-tune', |
46 |
- func { |
|
48 |
+ func (n) { |
|
49 |
+ var val = n.getValue(); |
|
47 | 50 |
setNavTune(); |
48 |
- device[0].display.updateNAV({tune: 1}); |
|
49 |
- device[1].display.updateNAV({tune: 1}); |
|
51 |
+ device[0].display.updateNAV({tune: val}); |
|
52 |
+ device[1].display.updateNAV({tune: val}); |
|
53 |
+ }, 1, 2); |
|
54 |
+ setlistener('/instrumentation/zkv1000/radios/comm-tune', |
|
55 |
+ func (n) { |
|
56 |
+ var val = n.getValue(); |
|
57 |
+ setCommTune(); |
|
58 |
+ device[0].display.updateCOMM({tune: val}); |
|
59 |
+ device[1].display.updateCOMM({tune: val}); |
|
50 | 60 |
}, 1, 2); |
51 | 61 |
} |
52 | 62 |
|
... | ... |
@@ -144,5 +154,5 @@ var deviceClass = { |
144 | 154 |
var powerOn = func { |
145 | 155 |
device[0] = deviceClass.new(0); |
146 | 156 |
device[1] = deviceClass.new(1); |
147 |
- setListeners(); |
|
157 |
+ settimer(setListeners, 5); |
|
148 | 158 |
} |