zkv1000 / Nasal / softkeys.nas /
Newer Older
1232 lines | 65.536kb
massive code reorganisation ...
Sébastien MARQUE authored on 2017-05-01
1
# vim: set foldmethod=marker foldmarker={{{,}}} :
commit initial
Sébastien MARQUE authored on 2017-03-07
2
var softkeysClass = {
improves role/name variables...
Sébastien MARQUE authored on 2017-04-08
3
    new : func (device) {
commit initial
Sébastien MARQUE authored on 2017-03-07
4
        var m = { parents: [ softkeysClass ] };
softkeys are available now
Sébastien MARQUE authored on 2017-03-14
5
        m.device = device;
6
        m.path = [];
improves softkeys coloring
Sébastien MARQUE authored on 2017-04-15
7
        m.colored = {};
commit initial
Sébastien MARQUE authored on 2017-03-07
8
        return m;
9
    },
10

            
softkeys are available now
Sébastien MARQUE authored on 2017-03-14
11
    SoftKey : func (n, a) {
12
        # released key not yet managed
13
        if (a == 1)
14
            return;
15

            
16
        var key = me.device.display.screenElements[sprintf("SoftKey%02i-text",n)].get('text');
17
        if (key == '' or key == nil)
18
            return;
19

            
improves role/name variables...
Sébastien MARQUE authored on 2017-04-08
20
        var path = keyMap[me.device.role];
softkeys are available now
Sébastien MARQUE authored on 2017-03-14
21
        foreach(var p; me.path) {
22
            if (contains(path, p))
23
                path = path[p];
24
            else
25
                break;
commit initial
Sébastien MARQUE authored on 2017-03-07
26
        }
27

            
improves role/name variables...
Sébastien MARQUE authored on 2017-04-08
28
        var bindings = me.bindings[me.device.role];
softkeys are available now
Sébastien MARQUE authored on 2017-03-14
29
        foreach(var p; me.path) {
30
            if (contains(bindings, p))
31
                bindings = bindings[p];
32
            else
33
                break;
commit initial
Sébastien MARQUE authored on 2017-03-07
34
        }
35

            
softkeys are available now
Sébastien MARQUE authored on 2017-03-14
36
        if (contains(path, key)) {
37
            append(me.path, key);
fix issue with some menus
Sébastien MARQUE authored on 2017-03-20
38
            if (contains(bindings, key))
39
                if (contains(bindings[key], 'hook'))
40
                    call(bindings[key].hook, [], me);
softkeys are available now
Sébastien MARQUE authored on 2017-03-14
41
            me.device.display.updateSoftKeys();
commit initial
Sébastien MARQUE authored on 2017-03-07
42
        }
softkeys are available now
Sébastien MARQUE authored on 2017-03-14
43
        elsif (contains(bindings, key)) {
44
            call(bindings[key], [], me);
commit initial
Sébastien MARQUE authored on 2017-03-07
45
        }
softkeys are available now
Sébastien MARQUE authored on 2017-03-14
46
        elsif (key == 'BACK') {
47
            pop(me.path);
48
            me.device.display.updateSoftKeys();
commit initial
Sébastien MARQUE authored on 2017-03-07
49
        }
show the complete path menu ...
Sébastien MARQUE authored on 2017-03-20
50
        else {
51
            var list_path = '';
52
            foreach(var p; me.path) list_path ~= p ~ '/';
53
            print(me.device.role ~ ':' ~ list_path ~ key ~ ' : not yet implemented');
54
        }
softkeys are available now
Sébastien MARQUE authored on 2017-03-14
55
    },
56

            
57
    bindings : {
58
        PFD : {
59
            INSET: {
60
                OFF: func {
separates maps code
Sébastien MARQUE authored on 2017-05-11
61
                    me.device.map.setVisible(0);
PFD INSET map available
Sébastien MARQUE authored on 2017-04-19
62
                    me.device.display.screenElements['PFD-Map-bg'].hide();
63
                },
add TCAS
Sébastien MARQUE authored on 2017-12-21
64
                TRAFFIC: func {
improve the selection of dis...
Sébastien MARQUE authored on 2017-12-30
65
                    call(me.bindings.PFD.INSET.declutter, ['INSETTRAFFIC', 'tcas', 2], me);
66
                },
67
                ROUTE: func {
68
                    call(me.bindings.PFD.INSET.declutter, ['INSETROUTE', 'route', 3], me);
69
                },
70
                TERRAIN: func {
71
                    call(me.bindings.PFD.INSET.declutter, ['INSETTERRAIN', 'tiles', 5], me);
72
                },
73
                NAVAIDS: {
74
                    ALL: func (root_id = 'INSETNAVAIDS') {
75
                        if (contains(me.colored, root_id ~ 'ALL'))
76
                            foreach (var n; [ 'ALL', 'VOR', 'DME', 'NDB', 'TACAN', 'APT' ])
77
                                delete(me.colored, root_id ~ n);
78
                        else
79
                            foreach (var n; [ 'ALL', 'VOR', 'DME', 'NDB', 'TACAN', 'APT' ])
80
                                me.colored[root_id ~ n] = 1;
81
                        me.device.display.updateSoftKeys();
82
                        foreach (var n; [ 'VOR', 'TACAN', 'NDB', 'DME' ])
83
                            me.device.map.layers.navaids._can[n]
84
                                .setVisible(contains(me.colored, root_id ~ n));
85
                        me.device.map.layers.navaids._can.airport
86
                            .setVisible(contains(me.colored, root_id ~ 'APT'));
87
                    },
88
                    VOR: func {
89
                        call(me.bindings.PFD.INSET.NAVAIDS.declutter, ['INSETNAVAIDSVOR', 'VOR', 2], me);
90
                    },
91
                    TACAN: func {
92
                        call(me.bindings.PFD.INSET.NAVAIDS.declutter, ['INSETNAVAIDSTACAN', 'TACAN', 3], me);
93
                    },
94
                    NDB: func {
95
                        call(me.bindings.PFD.INSET.NAVAIDS.declutter, ['INSETNAVAIDSNDB', 'NDB', 4], me);
96
                    },
97
                    DME: func {
98
                        call(me.bindings.PFD.INSET.NAVAIDS.declutter, ['INSETNAVAIDSDME', 'DME', 5], me);
99
                    },
100
                    APT: func {
101
                        call(me.bindings.PFD.INSET.NAVAIDS.declutter, ['INSETNAVAIDSAPT', 'airport', 6], me);
102
                    },
103
                    declutter: func (id, type) {
104
                        if (contains(me.colored, id)) {
105
                            delete(me.colored, id);
106
                            if (me.device.role == 'PFD')
107
                                delete(me.colored, 'INSETNAVAIDSALL');
108
                            if (me.device.role == 'MFD')
109
                                delete(me.colored, 'MAPNAVAIDSALL');
110
                        }
111
                        else
112
                            me.colored[id] = 1;
113
                        me.device.display.updateSoftKeys();
114
                        me.device.map.layers.navaids._can[type]
115
                            .setVisible(contains(me.colored, id));
116
                    },
117
                },
118
                declutter: func (id, layer) {
119
                    if (contains(me.colored, id))
120
                        delete(me.colored, id);
add TCAS
Sébastien MARQUE authored on 2017-12-21
121
                    else
improve the selection of dis...
Sébastien MARQUE authored on 2017-12-30
122
                        me.colored[id] = 1;
add TCAS
Sébastien MARQUE authored on 2017-12-21
123
                    me.device.display.updateSoftKeys();
improve the selection of dis...
Sébastien MARQUE authored on 2017-12-30
124
                    me.device.map.layers[layer]
125
                        .setVisible(contains(me.colored, id));
add TCAS
Sébastien MARQUE authored on 2017-12-21
126
                },
PFD INSET map available
Sébastien MARQUE authored on 2017-04-19
127
                hook : func {
128
                    me.device.display.screenElements['PFD-Map-bg'].show();
separates maps code
Sébastien MARQUE authored on 2017-05-11
129
                    me.device.map.setVisible(1);
130
                    me.device.map.update();
softkeys are available now
Sébastien MARQUE authored on 2017-03-14
131
                },
132
            },
133
            PFD: {
adds OAT, TAS, GSPD, WindDat...
Sébastien MARQUE authored on 2017-03-15
134
                'AOA/WIND' : {
adds AOA display
Sébastien MARQUE authored on 2017-04-15
135
                    AOA : {
136
                        'AOA ON' : func {
137
                            if (me.device.data['aoa-auto'])
138
                                return;
139
                            me.device.data.aoa = ! me.device.data.aoa;
nicer AOA display
Sébastien MARQUE authored on 2017-04-16
140
                            foreach (var e; ['AOA', 'AOA-needle', 'AOA-text'])
141
                                me.device.display.screenElements[e]
142
                                    .setVisible(me.device.data.aoa);
143
                            me.device.display.screenElements['AOA-approach']
144
                                .setVisible(me.device.data.aoa and contains(data, 'approach-aoa'));
adds AOA display
Sébastien MARQUE authored on 2017-04-15
145
                            me.device.display.updateAOA();
146
                            me.device.display.setSoftKeyColor(5 ,me.device.data.aoa);
147
                            if (me.device.data.aoa)
148
                                me.colored['PFDAOA/WINDAOAAOA ON'] = 1;
149
                            else
150
                                delete(me.colored, 'PFDAOA/WINDAOAAOA ON');
151
                        },
152
                        'AOA AUTO' : func {
153
                            if (me.device.data.aoa)
154
                                return;
155
                            me.device.data['aoa-auto'] = ! me.device.data['aoa-auto'];
156
                            me.device.display.setSoftKeyColor(6 ,me.device.data['aoa-auto']);
157
                            if (me.device.data['aoa-auto']) {
158
                                me.colored['PFDAOA/WINDAOAAOA AUTO'] = 1;
159
                                if (!contains(me.device.timers, 'aoa'))
160
                                    me.device.timers.aoa = maketimer(1,
161
                                            func {
162
                                                var v = getprop('/gear/gear/position-norm') == 1
163
                                                    and getprop('/surfaces-positions/flap-pos-norm') != 0;
nicer AOA display
Sébastien MARQUE authored on 2017-04-16
164
                                                foreach (var e; ['AOA', 'AOA-needle', 'AOA-text'])
165
                                                    me.device.display.screenElements[e]
166
                                                        .setVisible(v);
167
                                                me.device.display.screenElements['AOA-approach']
168
                                                    .setVisible(v and contains(data, 'approach-aoa'));
fix AOA not shown
Sébastien MARQUE authored on 2020-05-30
169
                                                me.device.display.updateAOA();
adds AOA display
Sébastien MARQUE authored on 2017-04-15
170
                                            }, me);
171
                                me.device.timers.aoa.start();
172
                            }
173
                            else {
174
                                delete(me.colored, 'PFDAOA/WINDAOAAOA AUTO');
175
                                me.device.timers.aoa.stop();
176
                                me.device.data.aoa = 0;
177
                                me.device.display.screenElements['AOA']
178
                                    .hide();
179
                            }
180
                        },
nicer AOA display
Sébastien MARQUE authored on 2017-04-16
181
                        hook : func {
182
                            if (contains(data,'approach-aoa'))
183
                                me.device.display.screenElements['AOA-approach']
184
                                    .setRotation(-data['approach-aoa']/data['stall-aoa']*math.pi);
185
                        },
adds AOA display
Sébastien MARQUE authored on 2017-04-15
186
                    },
adds OAT, TAS, GSPD, WindDat...
Sébastien MARQUE authored on 2017-03-15
187
                    WIND : {
188
                        OPTN1 : func {
189
                            me.device.display._winddata_optn = 1;
190
                            me.device.display.screenElements['WindData'].show();
191
                            me.device.display.screenElements['WindData-OPTN1'].show();
192
                            me.device.display.screenElements['WindData-OPTN1-HDG'].show();
193
                            me.device.display.screenElements['WindData-OPTN2'].hide();
194
                            me.device.display.updateWindData();
uses the new coloration for ...
Sébastien MARQUE authored on 2017-04-15
195
                            me.device.display.setSoftKeyColor(2, 1);
196
                            me.colored['PFDAOA/WINDWINDOPTN1'] = 1;
197
                            me.device.display.setSoftKeyColor(3, 0);
198
                            delete(me.colored, 'PFDAOA/WINDWINDOPTN2');
adds OAT, TAS, GSPD, WindDat...
Sébastien MARQUE authored on 2017-03-15
199
                        },
200
                        OPTN2 : func {
201
                            me.device.display._winddata_optn = 2;
202
                            me.device.display.screenElements['WindData'].show();
203
                            me.device.display.screenElements['WindData-OPTN1'].hide();
204
                            me.device.display.screenElements['WindData-OPTN2'].show();
205
                            me.device.display.screenElements['WindData-OPTN2-symbol'].show();
206
                            me.device.display.screenElements['WindData-OPTN2-headwind'].show();
207
                            me.device.display.screenElements['WindData-OPTN2-crosswind'].show();
208
                            me.device.display.updateWindData();
uses the new coloration for ...
Sébastien MARQUE authored on 2017-04-15
209
                            me.device.display.setSoftKeyColor(2, 0);
210
                            delete(me.colored, 'PFDAOA/WINDWINDOPTN1');
211
                            me.device.display.setSoftKeyColor(3, 1);
212
                            me.colored['PFDAOA/WINDWINDOPTN2'] = 1;
adds OAT, TAS, GSPD, WindDat...
Sébastien MARQUE authored on 2017-03-15
213
                        },
214
                        OFF : func {
215
                            me.device.display._winddata_optn = 0;
216
                            me.device.display.screenElements['WindData'].hide();
217
                            me.device.display.screenElements['WindData-OPTN1'].hide();
218
                            me.device.display.screenElements['WindData-OPTN2'].hide();
uses the new coloration for ...
Sébastien MARQUE authored on 2017-04-15
219
                            me.device.display.setSoftKeyColor(2, 0);
220
                            delete(me.colored, 'PFDAOA/WINDWINDOPTN1');
221
                            me.device.display.setSoftKeyColor(3, 0);
222
                            delete(me.colored, 'PFDAOA/WINDWINDOPTN2');
adds OAT, TAS, GSPD, WindDat...
Sébastien MARQUE authored on 2017-03-15
223
                        },
224
                    },
225
                },
adds BRG1/2 animation
Sébastien MARQUE authored on 2017-03-16
226
                BRG1 : func (brg = 1){
227
                    var source = 'brg' ~ brg ~ '-source';
228
                    var list = ['NAV' ~ brg, 'GPS', 'ADF', 'OFF'];
229
                    var index = std.Vector
230
                                   .new(list)
231
                                   .index(radios.getNode(source).getValue());
232
                    var next = (index == size(list) -1) ?  0 : index + 1;
233
                    radios.getNode(source).setValue(list[next]);
uses the new coloration for ...
Sébastien MARQUE authored on 2017-04-15
234
                    if (list[next] != 'OFF') {
235
                        me.device.display.setSoftKeyColor(brg == 1 ? 4 : 6, 1);
236
                        me.colored['PFDBRG' ~ brg] = 1;
237
                    }
238
                    else {
239
                        me.device.display.setSoftKeyColor(brg == 1 ? 4 : 6, 0);
240
                        delete(me.colored, 'PFDBRG' ~ brg);
241
                    }
adds BRG1/2 animation
Sébastien MARQUE authored on 2017-03-16
242
                },
243
                BRG2 : func {
244
                    call(me.bindings.PFD.PFD.BRG1, [ 2 ], me);
245
                },
adds BARO settings
Sébastien MARQUE authored on 2017-03-20
246
                'STD BARO' : func {
247
                    setprop('/instrumentation/altimeter/setting-inhg', 29.92);
248
                    me.device.display.updateBARO();
249
                    pop(me.path);
250
                    me.device.display.updateSoftKeys();
251
                },
252
                IN :  func {
253
                    me.device.display._baro_unit = 'inhg';
254
                    me.device.display.updateBARO();
255
                },
256
                HPA : func {
257
                    me.device.display._baro_unit = 'hpa';
258
                    me.device.display.updateBARO();
259
                },
softkeys are available now
Sébastien MARQUE authored on 2017-03-14
260
            },
261
            XPDR: {
adds transponder
Sébastien MARQUE authored on 2017-03-17
262
                STBY : func {
263
                    setprop('/instrumentation/transponder/ident', 0);
264
                    setprop('/instrumentation/transponder/knob-mode', 1);
remove hardcoded properties ...
Sébastien MARQUE authored on 2020-04-27
265
                    radios.setValue('xpdr-mode', 'STBY');
adds transponder
Sébastien MARQUE authored on 2017-03-17
266
                    me.device.display.updateXPDR();
267
                },
268
                ON : func {
269
                    setprop('/instrumentation/transponder/ident', 1);
270
                    setprop('/instrumentation/transponder/knob-mode', 4);
remove hardcoded properties ...
Sébastien MARQUE authored on 2020-04-27
271
                    radios.setValue('xpdr-mode', 'ON');
adds transponder
Sébastien MARQUE authored on 2017-03-17
272
                    me.device.display.updateXPDR();
273
                },
274
                ALT : func {
275
                    setprop('/instrumentation/transponder/ident', 1);
276
                    setprop('/instrumentation/transponder/knob-mode', 5);
remove hardcoded properties ...
Sébastien MARQUE authored on 2020-04-27
277
                    radios.setValue('xpdr-mode', 'ALT');
adds transponder
Sébastien MARQUE authored on 2017-03-17
278
                    me.device.display.updateXPDR();
279
                },
280
                VFR : func {
281
                    setprop('/instrumentation/transponder/id-code', '1200');
282
                    me.device.display.updateXPDR();
283
                },
284
                IDENT : func {
285
                    call(me.bindings.PFD.IDENT, [], me);
286
                },
287
                CODE : {
288
                    '0' : func (n = 0) {
remove hardcoded properties ...
Sébastien MARQUE authored on 2020-04-27
289
                        if (radios.getValue('xpdr-tuning-fms-method'))
XPDR settings via knob or so...
Sébastien MARQUE authored on 2017-03-22
290
                            return;
old timers2 removed
Sébastien MARQUE authored on 2020-05-15
291
                        me.device.display.timers.softkeys_inactivity.stop();
Softkeys revert to the previ...
Sébastien MARQUE authored on 2017-03-21
292
                        me.bindings.PFD.XPDR.CODE.inactivity.restart(me.device.display.softkeys_inactivity_delay);
XPDR settings via knob or so...
Sébastien MARQUE authored on 2017-03-22
293
                        # disable FMS knob entering method
294
                        me.device.knobs.FmsInner = void;
295
                        # When entering the code, the next softkey in sequence
296
                        # must be pressed within 10 seconds, or the entry is cancelled
297
                        # and restored to the previous code
298
                        if (!contains(me.bindings.PFD.XPDR.CODE, 'on_change_inactivity')) {
299
                            me.bindings.PFD.XPDR.CODE.on_change_inactivity = maketimer(10,
300
                                func {
remove hardcoded properties ...
Sébastien MARQUE authored on 2020-04-27
301
                                    radios.setValue('xpdr-tuning-digit', 3);
XPDR settings via knob or so...
Sébastien MARQUE authored on 2017-03-22
302
                                    me.device.knobs.FmsInner = me.device.knobs.XPDRCodeSetDigits;
303
                                    me.device.knobs.FmsOuter = me.device.knobs.XPDRCodeNextDigits;
304
                                    call(me.bindings.PFD.XPDR.CODE.restore, [], me);
305
                                });
306
                            me.bindings.PFD.XPDR.CODE.on_change_inactivity.singleShot = 1;
307
                            me.bindings.PFD.XPDR.CODE.on_change_inactivity.start();
308
                        }
309
                        else
310
                            me.bindings.PFD.XPDR.CODE.on_change_inactivity.restart(10);
adds transponder
Sébastien MARQUE authored on 2017-03-17
311
                        var tuning = radios.getNode('xpdr-tuning-digit');
312
                        var d = tuning.getValue();
313
                        setprop('/instrumentation/transponder/inputs/digit[' ~ d ~ ']', n);
fix not able to set 4th digi...
Sébastien MARQUE authored on 2020-04-30
314
                        if (d == 0) {
XPDR settings via knob or so...
Sébastien MARQUE authored on 2017-03-22
315
                            if (!contains(me.bindings.PFD.XPDR.CODE, 'on_change_auto_validation'))
316
                                me.bindings.PFD.XPDR.CODE.on_change_auto_validation = maketimer(5,
317
                                    func call(me.bindings.PFD.IDENT, [], me));
318
                            me.bindings.PFD.XPDR.CODE.on_change_auto_validation.singleShot = 1;
319
                            me.bindings.PFD.XPDR.CODE.on_change_auto_validation.start();
320
                        }
321
                        else {
322
                            d -= 1;
323
                            tuning.setValue(d);
324
                        }
adds transponder
Sébastien MARQUE authored on 2017-03-17
325
                        me.device.display.updateXPDR();
326
                    },
327
                    '1' : func {
328
                        call(me.bindings.PFD.XPDR.CODE['0'], [ 1 ], me);
329
                    },
330
                    '2' : func {
331
                        call(me.bindings.PFD.XPDR.CODE['0'], [ 2 ], me);
332
                    },
333
                    '3' : func {
334
                        call(me.bindings.PFD.XPDR.CODE['0'], [ 3 ], me);
335
                    },
336
                    '4' : func {
337
                        call(me.bindings.PFD.XPDR.CODE['0'], [ 4 ], me);
338
                    },
339
                    '5' : func {
340
                        call(me.bindings.PFD.XPDR.CODE['0'], [ 5 ], me);
341
                    },
342
                    '6' : func {
343
                        call(me.bindings.PFD.XPDR.CODE['0'], [ 6 ], me);
344
                    },
345
                    '7' : func {
346
                        call(me.bindings.PFD.XPDR.CODE['0'], [ 7 ], me);
347
                    },
softkeys are available now
Sébastien MARQUE authored on 2017-03-14
348
                    IDENT: func {
Softkeys revert to the previ...
Sébastien MARQUE authored on 2017-03-21
349
                        me.bindings.PFD.XPDR.CODE.inactivity.restart(me.device.display.softkeys_inactivity_delay);
old timers2 removed
Sébastien MARQUE authored on 2020-05-15
350
                        me.device.display.timers.softkeys_inactivity.restart(me.device.display.softkeys_inactivity_delay);
adds transponder
Sébastien MARQUE authored on 2017-03-17
351
                        call(me.bindings.PFD.IDENT, [], me);
352
                    },
353
                    BKSP: func {
remove hardcoded properties ...
Sébastien MARQUE authored on 2020-04-27
354
                        if (radios.getValue('xpdr-tuning-fms-method'))
XPDR settings via knob or so...
Sébastien MARQUE authored on 2017-03-22
355
                            return;
356
                        if (contains(me.bindings.PFD.XPDR.CODE, 'on_change_inactivity'))
357
                            me.bindings.PFD.XPDR.CODE.on_change_inactivity.restart(10);
358
                        if (contains(me.bindings.PFD.XPDR.CODE, 'on_change_auto_validation'))
359
                                me.bindings.PFD.XPDR.CODE.on_change_auto_validation.stop();
adds transponder
Sébastien MARQUE authored on 2017-03-17
360
                        var tuning = radios.getNode('xpdr-tuning-digit');
361
                        var d = tuning.getValue();
XPDR settings via knob or so...
Sébastien MARQUE authored on 2017-03-22
362
                        if (d < 3) {
363
                            d += 1;
364
                            tuning.setValue(d);
365
                        }
adds transponder
Sébastien MARQUE authored on 2017-03-17
366
                        me.device.display.updateXPDR();
softkeys are available now
Sébastien MARQUE authored on 2017-03-14
367
                    },
adds transponder
Sébastien MARQUE authored on 2017-03-17
368
                    BACK : func (inactive = 0) {
XPDR settings via knob or so...
Sébastien MARQUE authored on 2017-03-22
369
                        call(me.bindings.PFD.XPDR.CODE.restore, [], me);
adds transponder
Sébastien MARQUE authored on 2017-03-17
370
                        pop(me.path);
XPDR settings via knob or so...
Sébastien MARQUE authored on 2017-03-22
371
                        call(me.bindings.PFD.XPDR.CODE.exit, [me.path], me);
372
                    },
373
                    restore : func {
374
                        setprop('/instrumentation/transponder/id-code',
remove hardcoded properties ...
Sébastien MARQUE authored on 2020-04-27
375
                            sprintf('%s', radios.getValue('xpdr-backup-code')));
XPDR settings via knob or so...
Sébastien MARQUE authored on 2017-03-22
376
                        me.device.display.updateXPDR();
adds transponder
Sébastien MARQUE authored on 2017-03-17
377
                    },
378
                    exit : func (p) {
Softkeys revert to the previ...
Sébastien MARQUE authored on 2017-03-21
379
                        if (contains(me.bindings.PFD.XPDR.CODE, 'inactivity')) # does not exists if IDENT pressed from top-level
380
                            me.bindings.PFD.XPDR.CODE.inactivity.stop();
adds transponder
Sébastien MARQUE authored on 2017-03-17
381
                        radios.removeChild('xpdr-tuning-digit', 0);
382
                        radios.removeChild('xpdr-backup-code', 0);
XPDR settings via knob or so...
Sébastien MARQUE authored on 2017-03-22
383
                        radios.removeChild('xpdr-tuning-fms-method', 0);
adds transponder
Sébastien MARQUE authored on 2017-03-17
384
                        me.path = p;
385
                        me.device.display.updateXPDR();
softkeys are available now
Sébastien MARQUE authored on 2017-03-14
386
                        me.device.display.updateSoftKeys();
XPDR settings via knob or so...
Sébastien MARQUE authored on 2017-03-22
387
                        me.device.knobs.FmsInner = void;
388
                        me.device.knobs.FmsOuter = void;
old timers2 removed
Sébastien MARQUE authored on 2020-05-15
389
                        me.device.display.timers.softkeys_inactivity.restart(me.device.display.softkeys_inactivity_delay);
softkeys are available now
Sébastien MARQUE authored on 2017-03-14
390
                    },
adds transponder
Sébastien MARQUE authored on 2017-03-17
391
                    hook : func {
XPDR settings via knob or so...
Sébastien MARQUE authored on 2017-03-22
392
                        # this level has its own timer as we may need to revert changes, and got different timers
old timers2 removed
Sébastien MARQUE authored on 2020-05-15
393
                        me.device.display.timers.softkeys_inactivity.stop();
Softkeys revert to the previ...
Sébastien MARQUE authored on 2017-03-21
394
                        me.bindings.PFD.XPDR.CODE.inactivity = maketimer(
395
                            me.device.display.softkeys_inactivity_delay,
XPDR settings via knob or so...
Sébastien MARQUE authored on 2017-03-22
396
                            func call(me.bindings.PFD.XPDR.CODE.BACK, [], me));
Softkeys revert to the previ...
Sébastien MARQUE authored on 2017-03-21
397
                        me.bindings.PFD.XPDR.CODE.inactivity.singleShot = 1;
398
                        me.bindings.PFD.XPDR.CODE.inactivity.start();
remove hardcoded properties ...
Sébastien MARQUE authored on 2020-04-27
399
                        var tuning = radios.getValue('xpdr-tuning-digit');
adds transponder
Sébastien MARQUE authored on 2017-03-17
400
                        if (tuning == nil) {
401
                            radios.getNode('xpdr-tuning-digit', 1).setValue(3);
402
                            radios.getNode('xpdr-backup-code', 1).setValue(getprop('/instrumentation/transponder/id-code'));
XPDR settings via knob or so...
Sébastien MARQUE authored on 2017-03-22
403
                            radios.getNode('xpdr-tuning-fms-method', 1).setValue(0);
adds transponder
Sébastien MARQUE authored on 2017-03-17
404
                            me.device.display.updateXPDR();
405
                        }
XPDR settings via knob or so...
Sébastien MARQUE authored on 2017-03-22
406
                        me.device.knobs.FmsInner = me.device.knobs.XPDRCodeSetDigits;
407
                        me.device.knobs.FmsOuter = me.device.knobs.XPDRCodeNextDigits;
adds transponder
Sébastien MARQUE authored on 2017-03-17
408
                    },
softkeys are available now
Sébastien MARQUE authored on 2017-03-14
409
                },
adds transponder
Sébastien MARQUE authored on 2017-03-17
410
            },
411
            IDENT : func {
remove hardcoded properties ...
Sébastien MARQUE authored on 2020-04-27
412
                if (radios.getValue('xpdr-mode') == 'STBY')
adds transponder
Sébastien MARQUE authored on 2017-03-17
413
                    return;
414
                setprop('/instrumentation/transponder/ident', 1);
415
                me.bindings.PFD.XPDR.ident = maketimer(18,
416
                        func {
417
                            setprop('/instrumentation/transponder/ident', 0);
418
                            me.device.display.updateXPDR();
419
                        });
420
                me.bindings.PFD.XPDR.ident.singleShot = 1;
421
                me.bindings.PFD.XPDR.ident.start();
XPDR settings via knob or so...
Sébastien MARQUE authored on 2017-03-22
422
                call(me.bindings.PFD.XPDR.CODE.exit, [], me);
softkeys are available now
Sébastien MARQUE authored on 2017-03-14
423
            },
adds CDI
Sébastien MARQUE authored on 2017-03-18
424
            CDI : func {
425
                var list = ['OFF'];
426
                if (getprop('/instrumentation/gps/route-distance-nm') != nil)
427
                    append(list, 'GPS');
428
                if (getprop('/instrumentation/nav/in-range') != nil)
429
                    append(list, 'NAV1');
430
                if (getprop('/instrumentation/nav[1]/in-range') != nil)
431
                    append(list, 'NAV2');
432
                var index = std.Vector
433
                               .new(list)
434
                               .index(cdi.getNode('source').getValue());
435
                var next = (index == size(list) -1) ?  0 : index + 1;
436
                cdi.getNode('source').setValue(list[next]);
437
                CDIfromSOURCE(list[next]);
438
                me.device.display.updateCDI();
439
            },
TMR/REF window
Sébastien MARQUE authored on 2017-03-28
440
            'TMR/REF' : func {
441
                if (!contains(me.device.windows.state, 'TMR/REF')) {
TMR/REF available
Sébastien MARQUE authored on 2017-04-10
442
                    var Vspeed_visiblity = func (id, selected, Vspeed)
443
                        me.device.data[Vspeed ~ '-visible'] =
444
                            me.device.windows.state[id].objects[selected].text
445
                            ==
446
                            me.device.windows.state[id].objects[selected].choices[0];
447
                    var GenericTimer = func (id, selected) {
448
                        var action = me.device.windows.state[id].objects[selected].text;
449
                        if (action == 'START?') {
450
                            me.device.data.TMRrevert = 0;
451
                            me.device.data.TMRlast = getprop('/sim/time/elapsed-sec') - 1;
452
                            me.device.data.TMRreset = me.device.windows.state[id].objects[selected - 2].text;
453
                            me.device.data.TMRtimer = maketimer(1, func {
454
                                    var (hh, mm, ss) = split(':',
455
                                            me.device.windows.state[id].objects[selected - 2].text);
456
                                    var direction = -1;
457
                                    if ((me.device.windows.state[id].objects[selected - 1].text
458
                                            ==
459
                                        me.device.windows.state[id].objects[selected - 1].choices[0])
460
                                    or me.device.data.TMRrevert)
461
                                        direction = 1;
462
                                    var now = getprop('/sim/time/elapsed-sec');
463
                                    var dt = int(now - me.device.data.TMRlast) * direction;
464
                                    me.device.data.TMRlast = now;
465
                                    var val = HMS(hh, mm, ss, dt);
466
                                    me.device.windows.state[id].objects[selected - 2].text = val;
467
                                    me.device.windows.window[id ~ '-' ~ (selected -2)]
468
                                        .setText(val);
469
                                    if (val == '00:00:00' and direction == -1)
470
                                        me.device.data.TMRrevert = 1;
471
                                }, me);
472
                            me.device.data.TMRtimer.start();
473
                            action = 'STOP?';
474
                        }
475
                        elsif (action == 'STOP?') {
476
                            me.device.data.TMRtimer.stop();
477
                            action = 'RESET?';
478
                        }
479
                        elsif (action == 'RESET?') {
480
                            action = 'START?';
481
                            if ((me.device.windows.state[id].objects[selected - 1].text
482
                                        ==
483
                                me.device.windows.state[id].objects[selected - 1].choices[1])
484
                            and !me.device.data.TMRrevert)
485
                                var val = me.device.data.TMRreset;
486
                            else
487
                                var val = '00:00:00';
488
                            me.device.windows.state[id].objects[selected - 2].text = val;
489
                            me.device.windows.window[id ~ '-' ~ (selected -2)]
490
                                .setText(val);
491
                        }
492
                        me.device.windows.window[me.device.windows.selected]
493
                            .setText(action);
494
                        me.device.windows.state[id].objects[selected].text = action;
495
                    };
TMR/REF window
Sébastien MARQUE authored on 2017-03-28
496
                    me.device.windows.draw(
497
                        'TMR/REF',
498
                        {x: 720, y: 535, w: 300, l: 5, sep: 3},
TMR/REF window adaptation
Sébastien MARQUE authored on 2017-04-02
499
                        [ # objects infos
TMR/REF window
Sébastien MARQUE authored on 2017-03-28
500
                            {text: 'REFERENCES', type: 'title'},
501
                            {type: 'separator'},
502
                            {text: 'TIMER', type: 'normal'},
503
                            {text: '00:00:00', type: 'selected|time', },
TMR/REF available
Sébastien MARQUE authored on 2017-04-10
504
                            {text: '  UP >', type: 'editable', choices: ['  UP >', '<DOWN ']},
505
                            {text: 'START?', type: 'editable|end-of-line', callback: func (id, selected) GenericTimer(id, selected)},
TMR/REF window
Sébastien MARQUE authored on 2017-03-28
506
                            {type: 'separator'},
fix non-set values
Sébastien MARQUE authored on 2020-04-27
507
                            {text: sprintf('Vx     %3iKT',
508
                                            alerts.getNode('Vx') != nil ? alerts.getValue('Vx') : 0), type: 'normal', scrollgroup:0},
TMR/REF available
Sébastien MARQUE authored on 2017-04-10
509
                            {text: me.device.data['Vx-visible'] ? '   ON >' : '< OFF  ', type: 'editable|immediate|end-of-line', choices: ['   ON >', '< OFF  '], scrollgroup:0, callback: func (id, selected) Vspeed_visiblity(id, selected, 'Vx')},
fix non-set values
Sébastien MARQUE authored on 2020-04-27
510
                            {text: sprintf('Vy     %3iKT',
511
                                            alerts.getNode('Vy') != nil ? alerts.getValue('Vy') : 0), type: 'normal', scrollgroup:1},
TMR/REF available
Sébastien MARQUE authored on 2017-04-10
512
                            {text: me.device.data['Vy-visible'] ? '   ON >' : '< OFF  ', type: 'editable|immediate|end-of-line', choices: ['   ON >', '< OFF  '], scrollgroup:1, callback: func (id, selected) Vspeed_visiblity(id, selected, 'Vy')},
fix non-set values
Sébastien MARQUE authored on 2020-04-27
513
                            {text: sprintf('Vr     %3iKT',
514
                                            alerts.getNode('Vr') != nil ? alerts.getValue('Vr') : 0), type: 'normal', scrollgroup:2},
TMR/REF available
Sébastien MARQUE authored on 2017-04-10
515
                            {text: me.device.data['Vr-visible'] ? '   ON >' : '< OFF  ', type: 'editable|immediate|end-of-line', choices: ['   ON >', '< OFF  '], scrollgroup:2, callback: func (id, selected) Vspeed_visiblity(id, selected, 'Vr')},
fix non-set values
Sébastien MARQUE authored on 2020-04-27
516
                            {text: sprintf('Vglide %3iKT',
517
                                            alerts.getNode('Vglide') != nil ? alerts.getValue('Vglide') : 0), type: 'normal', scrollgroup:3},
TMR/REF available
Sébastien MARQUE authored on 2017-04-10
518
                            {text: me.device.data['Vglide-visible'] ? '   ON >' : '< OFF  ', type: 'editable|immediate|end-of-line', choices: ['   ON >', '< OFF  '], scrollgroup:3, callback: func (id, selected) Vspeed_visiblity(id, selected, 'Vglide')},
TMR/REF window
Sébastien MARQUE authored on 2017-03-28
519
                            {type: 'separator'},
520
                            {text: 'MINIMUMS', type: 'normal'},
TMR/REF available
Sébastien MARQUE authored on 2017-04-10
521
                            {text: '   OFF   >', type: 'editable', choices: ['   OFF   >', '<  BARO  >','<TEMP COMP'], callback: func},
TMR/REF window adaptation
Sébastien MARQUE authored on 2017-04-02
522
                            {text: ' 1000FT', type: 'editable', format: '% 5iFT', factor: 100, callback: func},
523
                        ],
524
                        { # scrolling info, see menu.nas
525
                            lines : 3,
526
                            columns : 2,
527
                        }
TMR/REF window
Sébastien MARQUE authored on 2017-03-28
528
                    );
529
                    me.device.knobs.FmsInner = me.device.knobs.MenuSettings;
530
                    me.device.knobs.FmsOuter = me.device.knobs.NavigateMenu;
TMR/REF available
Sébastien MARQUE authored on 2017-04-10
531
                    me.device.buttons.ENT = me.device.buttons.ValidateTMRREF;
532
                    me.device.buttons.FMS = me.device.buttons.ValidateTMRREF;
533
                    me.device.buttons.CLR = me.device.buttons.ClearTMRREF;
TMR/REF window
Sébastien MARQUE authored on 2017-03-28
534
                }
535
                else {
TMR/REF available
Sébastien MARQUE authored on 2017-04-10
536
                    me.device.buttons.ClearTMRREF();
TMR/REF window
Sébastien MARQUE authored on 2017-03-28
537
                }
538
            },
add PFD/NRST softkey
Sébastien MARQUE authored on 2020-05-16
539
            NRST: {
540
                _displayNearest: func (type, where) {
541
                    var id = 'PFD NRST';
542
                    me.device.display.updateSoftKeys();
543
                    me.device.windows.del(id);
544
                    var results = [];
545
                    var list = [];
546
                    if (type == 'apt') {
547
                        results = findAirportsWithinRange(100);
548
                    }
549
                    else {
550
                        results = findNavaidsWithinRange(100, type);
551
                    }
simplifies NRST code
Sébastien MARQUE authored on 2020-05-18
552
                    var norm_360 = func (a) return math.periodic(0, 360, a);
553
                    if    (where == 'OMNI')  var side = -1;
554
                    elsif (where == 'FRONT') var side = norm_360(data.hdg);
555
                    elsif (where == 'RIGHT') var side = norm_360(data.hdg + 90);
556
                    elsif (where == 'LEFT')  var side = norm_360(data.hdg - 90);
557
                    elsif (where == 'REAR')  var side = norm_360(data.hdg + 180);
558
                    foreach (var n; results) {
559
                        var (course, dist) = courseAndDistance(n);
560
                        if (side > -1) {
add PFD/NRST softkey
Sébastien MARQUE authored on 2020-05-16
561
                            var angle = 180 - abs(abs(course - side) - 180);
simplifies NRST code
Sébastien MARQUE authored on 2020-05-18
562
                            if (angle > 50)
563
                                continue;
add PFD/NRST softkey
Sébastien MARQUE authored on 2020-05-16
564
                        }
simplifies NRST code
Sébastien MARQUE authored on 2020-05-18
565
                        append(list, [n, course, dist]);
566
                        if (size(list) == 5)
567
                            break;
add PFD/NRST softkey
Sébastien MARQUE authored on 2020-05-16
568
                    }
569
                    var obj_infos = [
570
                        { text: sprintf('NEAREST %s (%s)', string.uc(type), where), type: 'title' },
571
                        { type: 'separator' }
572
                    ];
573
                    var firstEntry = 1;
574
                    foreach (var n; list) {
575
                        append(obj_infos, {
576
                            text: sprintf('%s (%s)', n[0].id, n[0].name),
577
                            type: (firstEntry ? 'selected' : 'editable') ~ '|end-of-line',
578
                            dto: n[0],
579
                        });
adds NAV freq if VOR selecte...
Sébastien MARQUE authored on 2020-05-18
580
                        if (type == 'vor') {
581
                            var idx = size(obj_infos) - 1;
582
                            obj_infos[idx]._freq = n[0].frequency;
583
                            obj_infos[idx].callback = func (id, selected) radios.getNode('nav-freq-mhz').setValue(me.device.windows.state[id].objects[selected]._freq / 100);
584
                        }
add PFD/NRST softkey
Sébastien MARQUE authored on 2020-05-16
585
                        append(obj_infos, {
586
                            text: sprintf('%s %03i° %3iNM', utf8.chstr(9658), n[1], n[2]),
587
                            type: 'normal|end-of-line'
588
                        });
589
                        firstEntry = 0;
590
                    }
591
                    me.device.knobs.FmsInner = me.device.knobs.NavigateMenu;
592
                    me.device.knobs.FmsOuter = me.device.knobs.NavigateMenu;
593
                    me.device.buttons.ENT    = me.device.buttons.ValidateTMRREF;
594
                    me.device.buttons.CLR = func {
595
                        me.device.windows.del(id);
596
                        me.device.knobs.FmsOuter = func;
597
                        me.device.knobs.FmsInner = func;
fix MENU issue
Sébastien MARQUE authored on 2020-05-23
598
                        me.device.buttons.MENU = me.device.buttons.GlobalParams;
599
                        foreach (var b; ['ENT', 'CLR'])
add PFD/NRST softkey
Sébastien MARQUE authored on 2020-05-16
600
                            me.device.buttons[b] = func;
601
                    }
fix MENU issue
Sébastien MARQUE authored on 2020-05-23
602
                    me.device.buttons.MENU = func;
add PFD/NRST softkey
Sébastien MARQUE authored on 2020-05-16
603
                    me.device.windows.draw( id, {autogeom: 1}, obj_infos );
604
                },
adds NRST/COMMS
Sébastien MARQUE authored on 2020-05-18
605
                _displayNearestCOMM: func (where) {
606
                    var id = 'PFD NRST';
607
                    me.device.display.updateSoftKeys();
608
                    me.device.windows.del(id);
609
                    var results = [];
610
                    var ATIS_list = [];
611
                    var TRAFFIC_list = [];
612
                    var TWR_list = [];
613
                    results = findAirportsWithinRange(100);
614
                    var norm_360 = func (a) return math.periodic(0, 360, a);
615
                    if    (where == 'OMNI')  var side = -1;
616
                    elsif (where == 'FRONT') var side = norm_360(data.hdg);
617
                    elsif (where == 'RIGHT') var side = norm_360(data.hdg + 90);
618
                    elsif (where == 'LEFT')  var side = norm_360(data.hdg - 90);
619
                    elsif (where == 'REAR')  var side = norm_360(data.hdg + 180);
620
                    foreach (var r; results) {
621
                        var (course, dist) = courseAndDistance(r);
622
                        if (side > -1) {
623
                            var bearing = 180 - abs(abs(course - side) - 180);
624
                            if (bearing > 50)
625
                                continue;
626
                        }
627
                        foreach (var c; r.comms()) {
628
                            if (size(ATIS_list) < 4
629
                            and (string.match(c.ident, '*ATIS*') or string.match(c.ident, '*A[SW]OS*')))
630
                                append(ATIS_list, [r.id, c.frequency, course, dist]);
631

            
632
                            if (size(TWR_list) < 4
633
                            and string.match(c.ident, '*TWR*'))
634
                                append(TWR_list, [r.id, c.frequency, course, dist]);
635

            
636
                            if (size(TRAFFIC_list) < 4
637
                            and (string.match(c.ident, '*CTAF*') or string.match(c.ident, '*UNICOM*') or string.match(c.ident, '*MULTICOM*')))
638
                                append(TRAFFIC_list, [r.id, c.frequency, course, dist]);
639
                        }
640
                    }
641
                    var obj_infos = [];
642
                    firstEntry = 1;
643
                    if (size(ATIS_list) > 0) {
644
                        append(obj_infos, {text: 'ATIS', type: 'title'});
645
                        append(obj_infos, {type: 'separator'});
646
                        foreach (var atis; ATIS_list) {
647
                            append(obj_infos, {
648
                                text: atis[0],
649
                                _freq: atis[1],
650
                                type: firstEntry ? 'selected' : 'editable',
651
                                callback: func (id, selected) radios.getNode('comm-freq-mhz').setValue(me.device.windows.state[id].objects[selected]._freq),
652
                            });
653
                            append(obj_infos, {
654
                                text: sprintf(' (%.3fMHz) %3i° %2iNM', atis[1], atis[2], atis[3]),
655
                                type: 'normal|end-of-line'
656
                            });
657
                            firstEntry = 0;
658
                        }
659
                    }
660
                    if (size(TRAFFIC_list) > 0) {
661
                        append(obj_infos, {text: 'TRAFFIC', type: 'title'});
662
                        append(obj_infos, {type: 'separator'});
663
                        foreach (var traffic; TRAFFIC_list) {
664
                            append(obj_infos, {
665
                                text: traffic[0],
666
                                _freq: traffic[1],
667
                                type: firstEntry ? 'selected' : 'editable',
668
                                callback: func (id, selected) radios.getNode('comm-freq-mhz').setValue(me.device.windows.state[id].objects[selected]._freq),
669
                            });
670
                            append(obj_infos, {
671
                                text: sprintf(' (%.3fMHz) %3i° %2iNM', traffic[1], traffic[2], traffic[3]),
672
                                type: 'normal|end-of-line'
673
                            });
674
                            firstEntry = 0;
675
                        }
676
                    }
677
                    if (size(TWR_list) > 0) {
678
                        append(obj_infos, {text: 'TOWER', type: 'title'});
679
                        append(obj_infos, {type: 'separator'});
680
                        foreach (var tower; TWR_list) {
681
                            append(obj_infos, {
682
                                text: tower[0],
683
                                _freq: tower[1],
684
                                type: firstEntry ? 'selected' : 'editable',
685
                                callback: func (id, selected) radios.getNode('comm-freq-mhz').setValue(me.device.windows.state[id].objects[selected]._freq),
686
                            });
687
                            append(obj_infos, {
688
                                text: sprintf(' (%.3fMHz) %3i° %2iNM', tower[1], tower[2], tower[3]),
689
                                type: 'normal|end-of-line'
690
                            });
691
                            firstEntry = 0;
692
                        }
693
                    }
694
                    me.device.knobs.FmsInner = me.device.knobs.NavigateMenu;
695
                    me.device.knobs.FmsOuter = me.device.knobs.NavigateMenu;
fix MENU issue
Sébastien MARQUE authored on 2020-05-23
696
                    me.device.buttons.MENU = func;
adds NRST/COMMS
Sébastien MARQUE authored on 2020-05-18
697
                    me.device.buttons.CLR = func {
698
                        me.device.windows.del(id);
699
                        me.device.knobs.FmsOuter = func;
700
                        me.device.knobs.FmsInner = func;
fix MENU issue
Sébastien MARQUE authored on 2020-05-23
701
                        me.device.buttons.MENU = me.device.buttons.GlobalParams;
702
                        foreach (var b; ['ENT', 'CLR'])
adds NRST/COMMS
Sébastien MARQUE authored on 2020-05-18
703
                            me.device.buttons[b] = func;
704
                    }
705
                    me.device.buttons.ENT    = me.device.buttons.ValidateTMRREF;
706
                    me.device.windows.draw( id, {autogeom: 1}, obj_infos );
707
                },
add PFD/NRST softkey
Sébastien MARQUE authored on 2020-05-16
708
############################################################################################################
709
# THIS CODE SHOULD REPLACE THE LINES BELOW (in new()), but it makes all call with the same args (apt, RIGHT)
710
############################################################################################################
711
#        if (m.device.role == 'PFD')
712
#            foreach (var dir; keyMap.PFD.NRST.texts) {
713
#                m.bindings.PFD.NRST[dir] = {};
714
#                foreach (var type; keyMap.PFD.NRST.OMNI.texts) {
715
#                    m.bindings.PFD.NRST[dir][type] = func {
716
#                        call(m.bindings.PFD.NRST._displayNearest, [string.lc(type), dir], m)
717
#                    };
718
#                }
719
#            }
720
############################################################################################################
721
                OMNI: {
722
                    APT: func { call(me.bindings.PFD.NRST._displayNearest, ['apt', 'OMNI'], me) },
723
                    VOR: func { call(me.bindings.PFD.NRST._displayNearest, ['vor', 'OMNI'], me) },
724
                    NDB: func { call(me.bindings.PFD.NRST._displayNearest, ['ndb', 'OMNI'], me) },
725
                    FIX: func { call(me.bindings.PFD.NRST._displayNearest, ['fix', 'OMNI'], me) },
adds NRST/COMMS
Sébastien MARQUE authored on 2020-05-18
726
                    COMM:func { call(me.bindings.PFD.NRST._displayNearestCOMM,    ['OMNI'], me) },
add PFD/NRST softkey
Sébastien MARQUE authored on 2020-05-16
727
                },
728
                FRONT: {
729
                    APT: func { call(me.bindings.PFD.NRST._displayNearest, ['apt', 'FRONT'], me) },
730
                    VOR: func { call(me.bindings.PFD.NRST._displayNearest, ['vor', 'FRONT'], me) },
731
                    NDB: func { call(me.bindings.PFD.NRST._displayNearest, ['ndb', 'FRONT'], me) },
732
                    FIX: func { call(me.bindings.PFD.NRST._displayNearest, ['fix', 'FRONT'], me) },
adds NRST/COMMS
Sébastien MARQUE authored on 2020-05-18
733
                    COMM:func { call(me.bindings.PFD.NRST._displayNearestCOMM,    ['FRONT'], me) },
add PFD/NRST softkey
Sébastien MARQUE authored on 2020-05-16
734
                },
735
                RIGHT: {
736
                    APT: func { call(me.bindings.PFD.NRST._displayNearest, ['apt', 'RIGHT'], me) },
737
                    VOR: func { call(me.bindings.PFD.NRST._displayNearest, ['vor', 'RIGHT'], me) },
738
                    NDB: func { call(me.bindings.PFD.NRST._displayNearest, ['ndb', 'RIGHT'], me) },
739
                    FIX: func { call(me.bindings.PFD.NRST._displayNearest, ['fix', 'RIGHT'], me) },
adds NRST/COMMS
Sébastien MARQUE authored on 2020-05-18
740
                    COMM:func { call(me.bindings.PFD.NRST._displayNearestCOMM,    ['RIGHT'], me) },
add PFD/NRST softkey
Sébastien MARQUE authored on 2020-05-16
741
                },
742
                REAR: {
743
                    APT: func { call(me.bindings.PFD.NRST._displayNearest, ['apt', 'REAR'], me) },
744
                    VOR: func { call(me.bindings.PFD.NRST._displayNearest, ['vor', 'REAR'], me) },
745
                    NDB: func { call(me.bindings.PFD.NRST._displayNearest, ['ndb', 'REAR'], me) },
746
                    FIX: func { call(me.bindings.PFD.NRST._displayNearest, ['fix', 'REAR'], me) },
adds NRST/COMMS
Sébastien MARQUE authored on 2020-05-18
747
                    COMM:func { call(me.bindings.PFD.NRST._displayNearestCOMM,    ['REAR'], me) },
add PFD/NRST softkey
Sébastien MARQUE authored on 2020-05-16
748
                },
749
                LEFT: {
750
                    APT: func { call(me.bindings.PFD.NRST._displayNearest, ['apt', 'LEFT'], me) },
751
                    VOR: func { call(me.bindings.PFD.NRST._displayNearest, ['vor', 'LEFT'], me) },
752
                    NDB: func { call(me.bindings.PFD.NRST._displayNearest, ['ndb', 'LEFT'], me) },
753
                    FIX: func { call(me.bindings.PFD.NRST._displayNearest, ['fix', 'LEFT'], me) },
adds NRST/COMMS
Sébastien MARQUE authored on 2020-05-18
754
                    COMM:func { call(me.bindings.PFD.NRST._displayNearestCOMM,    ['LEFT'], me) },
add PFD/NRST softkey
Sébastien MARQUE authored on 2020-05-16
755
                },
756
            },
softkeys are available now
Sébastien MARQUE authored on 2017-03-14
757
        },
758
        MFD : {
759
            ENGINE: {
760
                FUEL: {
761
                    UNDO: func {
762
                        pop(me.path);
763
                        me.device.display.updateSoftKeys();
764
                    },
765
                    ENTER: func {
766
                        pop(me.path);
767
                        me.device.display.updateSoftKeys();
768
                    },
769
                },
770
                ENGINE: func {
771
                    me.path = [];
772
                    me.device.display.updateSoftKeys();
773
                },
774
            },
add missing exit to MFD/CHKL...
Sébastien MARQUE authored on 2017-03-20
775
            CHKLIST : {
add checklists management
Sébastien MARQUE authored on 2020-04-30
776
                _showCheckList: func (id, selected) {
777
                    var tabulate = func (l, r, t = 3, c = '.') {
778
                        var s = '';
779
                        for (var i = 0; i < (l - r) + t; i += 1) s ~= c;
780
                        return s;
781
                    }
782

            
783
                    var groupIndex     = me.device.windows.state[id].objects[selected].groupIndex;
784
                    var checklistIndex = me.device.windows.state[id].objects[selected].checklistIndex;
785

            
786
                    if (contains(me.device.windows.state[id].objects[selected], 'pageIndex'))
787
                        pageIndex = me.device.windows.state[id].objects[selected].pageIndex;
788
                    else
789
                        pageIndex = -1;
790

            
791
                    var title = '';
792
                    if (contains(me.device.windows.state[id].objects[selected], 'checklistTitle'))
793
                        title = me.device.windows.state[id].objects[selected].checklistTitle;
794
                    else
795
                        title = me.device.windows.state[id].objects[selected].text;
796

            
797
                    me.device.windows.del(id);
798

            
799
                    if (groupIndex < 0)
800
                         checklistNode = props.globals.getNode("/sim/checklists")
801
                                    .getChild('checklist', checklistIndex);
802
                    else
803
                         checklistNode = props.globals.getNode("/sim/checklists")
804
                                    .getChild("group", groupIndex)
805
                                    .getChild('checklist', checklistIndex);
806

            
807
                    var pages = checklistNode.getChildren('page');
808

            
809
                    if (size(pages) and pageIndex == -1)
810
                        pageIndex = 0;
811

            
812
                    _previous_text = ' < PREVIOUS ';
813
                    _next_text     = ' NEXT > ';
814

            
815
                    var obj_infos = [];
816
                    var length = size(_previous_text ~ _next_text);
817
                    var length_cache = [];
818
                    if (size(pages))
819
                        checklistNode = pages[pageIndex];
820

            
821
                    append(obj_infos, {
822
                        text: sprintf('%s%s',
823
                                      title,
824
                                      size(pages) > 1 ? sprintf(' %d / %d',
825
                                                                pageIndex + 1,
826
                                                                size(pages)) : ''),
827
                        type: 'title'
828
                    });
829

            
830
                    append(obj_infos, {type: 'separator'});
831

            
832
                    forindex (var i; checklistNode.getChildren('item')) {
833
                        var l = size(checklistNode.getChild('item', i).getValue('name'));
834
                        if (checklistNode.getChild('item', i).getChild('value') != nil)
835
                            l += size(checklistNode.getChild('item', i).getValue('value'));
836
                        append(length_cache, l);
837
                        if (l > length)
838
                            length = l;
839
                    }
840

            
841
                    forindex (var i; checklistNode.getChildren('item')) {
842
                        var text = pages[pageIndex].getChild('item', i).getValue('name');
843
                        var item_val = '';
844
                        if (pages[pageIndex].getChild('item', i).getChild('value') != nil)
845
                            item_val = pages[pageIndex].getChild('item', i).getValue('value');
846
                        if (item_val != '')
847
                            text ~= tabulate(length, length_cache[i]);
848
                        text ~= item_val;
849

            
850
                        append(obj_infos, {
851
                            text: text,
852
                            groupIndex: groupIndex,
853
                            checklistIndex: checklistIndex,
854
                            pageIndex: pageIndex,
855
                            type: 'normal|end-of-line'
856
                        });
857
                    }
858

            
859
                    append(obj_infos, {type: 'separator'});
860

            
861
                    if (pageIndex and size(pages))
862
                        append(obj_infos, {
863
                                text: _previous_text,
864
                                groupIndex: groupIndex,
865
                                checklistIndex: checklistIndex,
866
                                pageIndex: pageIndex - 1,
867
                                checklistTitle: title,
868
                                type: (pageIndex + 1 < size(pages)) ? 'editable' : 'selected',
869
                                callback: func (id, selected) call(me.device.softkeys.bindings.MFD.CHKLIST._showCheckList, [id, selected], me)
870
                        });
871
                    else
872
                        append(obj_infos, {
873
                            text: tabulate(length, size(_next_text), 0, ' '),
874
                            type: 'normal'
875
                        });
876

            
877
                    if (pageIndex + 1 < size(pages)) {
878
                        if (pageIndex and size(pages))
879
                            append(obj_infos, {
880
                                text: tabulate(length, size(_previous_text ~ _next_text), 0, ' '),
881
                                type: 'normal',
882
                            });
883
                        append(obj_infos, {
884
                                text: _next_text,
885
                                groupIndex: groupIndex,
886
                                checklistIndex: checklistIndex,
887
                                pageIndex: pageIndex + 1,
888
                                checklistTitle: title,
889
                                type: 'selected|end-of-line',
890
                                callback: func (id, selected) call(me.device.softkeys.bindings.MFD.CHKLIST._showCheckList, [id, selected], me)
891
                        });
892
                    }
893

            
894
                    me.device.knobs.FmsInner = me.device.knobs.NavigateMenu;
895
                    me.device.knobs.FmsOuter = me.device.knobs.NavigateMenu;
896
                    me.device.buttons.ENT    = me.device.buttons.ValidateTMRREF;
897
                    me.device.buttons.CLR = func {
898
                        me.device.windows.del(id);
899
                        me.device.knobs.FmsOuter = func;
900
                        me.device.knobs.FmsInner = func;
901
                        foreach (var b; ['ENT', 'CLR'])
902
                            me.device.buttons[b] = func;
903
                        me.device.buttons.MENU = func;
904
                    }
905
                    me.device.windows.draw( id, {autogeom: 1}, obj_infos );
906
                },
907
                LIST: func {
908
                    # nested function as checklist lists may be organized by group
909
                    var listChecklists = func (id, selected) {
910
                        var groupIndex = me.device.windows.state[id].objects[selected].groupIndex;
911

            
912
                        me.device.windows.del(id);
913

            
914
                        var checklists = [];
915
                        var firstEntry = 1;
916
                        if (groupIndex == -1)
917
                            checklists = props.globals.getNode("/sim/checklists")
918
                                            .getChildren('checklist');
919
                        else
920
                            checklists = props.globals.getNode("/sim/checklists")
921
                                            .getChild("group", groupIndex)
922
                                            .getChildren('checklist');
923
                        var checklistsQty = size(checklists);
924
                        var obj_infos = [];
925

            
926
                        if (checklistsQty) {
927
                            forindex (var c; checklists) {
928
                                if (string.uc(checklists[c].getValue('title')) == 'EMERGENCY') {
929
                                    checklistsQty -= 1;
930
                                    continue;
931
                                }
932
                                var title = checklists[c].getValue('title');
933
                                append(obj_infos, {
934
                                    text: title,
935
                                    groupIndex: groupIndex,
936
                                    checklistIndex: c,
937
                                    checklistTitle: title,
938
                                    type: (firstEntry ? 'selected' : 'editable') ~ '|end-of-line',
939
                                    callback: func (id, selected) call(me.device.softkeys.bindings.MFD.CHKLIST._showCheckList, [id, selected], me)
940
                                });
941
                                if (checklistsQty == 1) { # see comments below for groups
942
                                    call(me.device.softkeys.bindings.MFD.CHKLIST._showCheckList, [groupIndex, 0], me);
943
                                    return;
944
                                }
945
                                elsif (checklistsQty == 0)
946
                                    return;
947
                                firstEntry = 0;
948
                            }
949
                        }
950

            
951
                        id ~= ' CHECKLISTS';
952
                        me.device.knobs.FmsInner = me.device.knobs.NavigateMenu;
953
                        me.device.knobs.FmsOuter = me.device.knobs.NavigateMenu;
954
                        me.device.buttons.ENT    = me.device.buttons.ValidateTMRREF;
955
                        me.device.buttons.CLR = func {
956
                            me.device.windows.del(id);
957
                            me.device.knobs.FmsOuter = func;
958
                            me.device.knobs.FmsInner = func;
959
                            foreach (var b; ['ENT', 'CLR'])
960
                                me.device.buttons[b] = func;
961
                            me.device.buttons.MENU = func;
962
                        }
963
                        me.device.windows.draw(id, {autogeom: 1}, obj_infos);
964
                    }
965

            
966
                    var windowId = 'CHKLIST LIST';
967
                    if (contains(me.device.windows.state, windowId))
968
                        me.device.windows.del(windowId);
969

            
970
                    var obj_infos = [];
971
                    var firstEntry = 1;
972
                    var groups = props.globals.getNode("/sim/checklists").getChildren("group");
973
                    var groupsQty = size(groups);
974

            
975
                    if (groupsQty) {
976
                        forindex (var g; groups) {
977
                            # emergency checklists are listed in their own menu
978
                            if (string.uc(groups[g].getValue('name')) == 'EMERGENCY') {
979
                                groupsQty -= 1;
980
                                continue;
981
                            }
982
                            # the key groupIndex isn't used by the display system
983
                            # we use it to keep the information of group node's index
984
                            append(obj_infos, {
985
                                text: groups[g].getValue('name'),
986
                                groupIndex: g,
987
                                type: (firstEntry ? 'selected' : 'editable') ~ '|end-of-line',
988
                                callback: func (id, selected) listChecklists(id, selected) });
989
                            firstEntry = 0;
990
                            # if there are only one group left, let display it directly
991
                            if (groupsQty == 1) {
992
                                listChecklists(windowId, 0);
993
                                return;
994
                            }
995
                            elsif (groupsQty == 0) {
996
                                return;
997
                            }
998
                        }
999
                    }
1000
                    else {
1001
                        listChecklists(windowId, -1);
1002
                        return;
1003
                    }
1004

            
1005
                    me.device.knobs.FmsInner = me.device.knobs.NavigateMenu;
1006
                    me.device.knobs.FmsOuter = me.device.knobs.NavigateMenu;
1007
                    me.device.buttons.ENT    = me.device.buttons.ValidateTMRREF;
1008
                    me.device.buttons.CLR = func {
1009
                        me.device.windows.del(windowId);
1010
                        me.device.knobs.FmsOuter = func;
1011
                        me.device.knobs.FmsInner = func;
1012
                        foreach (var b; ['ENT', 'CLR'])
1013
                            me.device.buttons[b] = func;
1014
                        me.device.buttons.MENU = func;
1015
                    }
1016
                    me.device.windows.draw(windowId, {autogeom: 1}, obj_infos);
1017
                },
1018
                EMERGCY: func {
1019
                    # nested function as checklist lists may be organized by group
1020
                    var listChecklists = func (groupIndex) {
1021
                        var checklists = [];
1022
                        var firstEntry = 1;
1023
                        if (groupIndex == -1)
1024
                            checklists = props.globals.getNode("/sim/checklists")
1025
                                            .getChildren('checklist');
1026
                        else
1027
                            checklists = props.globals.getNode("/sim/checklists")
1028
                                            .getChild("group", groupIndex)
1029
                                            .getChildren('checklist');
1030
                        var checklistsQty = size(checklists);
1031
                        var obj_infos = [];
1032
                        var firstEntry = 1;
1033

            
1034
                        if (checklistsQty) {
1035
                            forindex (var c; checklists) {
1036
                                if (groupIndex < 0 and string.uc(checklists[c].getValue('title')) != 'EMERGENCY') {
1037
                                    checklistsQty -= 1;
1038
                                    continue;
1039
                                }
1040
                                append(obj_infos, {
1041
                                    text: checklists[c].getValue('title'),
1042
                                    groupIndex: groupIndex,
1043
                                    checklistIndex: c,
1044
                                    type: (firstEntry ? 'selected' : 'editable') ~ '|end-of-line',
1045
                                    callback: func (id, selected) call(me.device.softkeys.bindings.MFD.CHKLIST._showCheckList, [id, selected], me)
1046
                                });
1047
                                firstEntry = 0;
1048
                            }
1049
                        }
1050
                        id = 'EMERGENCY CHECKLISTS';
1051
                        me.device.knobs.FmsInner = me.device.knobs.NavigateMenu;
1052
                        me.device.knobs.FmsOuter = me.device.knobs.NavigateMenu;
1053
                        me.device.buttons.ENT    = me.device.buttons.ValidateTMRREF;
1054
                        me.device.buttons.CLR = func {
1055
                            me.device.windows.del(id);
1056
                            me.device.knobs.FmsOuter = func;
1057
                            me.device.knobs.FmsInner = func;
1058
                            foreach (var b; ['ENT', 'CLR'])
1059
                                me.device.buttons[b] = func;
1060
                            me.device.buttons.MENU = func;
1061
                        }
1062
                        me.device.windows.draw(id, {autogeom: 1}, obj_infos);
1063
                        if (checklistsQty == 1) { # see comments below for groups
1064
                            call(me.device.softkeys.bindings.MFD.CHKLIST._showCheckList, [groupIndex, 0], me);
1065
                            return;
1066
                        }
1067
                        elsif (checklistsQty == 0)
1068
                            call(me.device.buttons.CLR, [0], me);
1069
                            return;
1070
                    }
1071

            
1072
                    var windowId = 'CHKLIST EMERGCY';
1073
                    if (contains(me.device.windows.state, windowId))
1074
                        me.device.windows.del(windowId);
1075

            
1076
                    var groups = props.globals.getNode("/sim/checklists").getChildren("group");
1077

            
1078
                    var emergency_group_found = 0;
1079
                    if (size(groups)) {
1080
                        forindex (var g; groups) {
1081
                            # emergency checklists are listed in their own menu
1082
                            # we support only one emergency checklists group named EMERGENCY (case insensitive)
1083
                            if (string.uc(groups[g].getValue('name')) != 'EMERGENCY')
1084
                                continue;
1085
                            listChecklists(g);
1086
                            emergency_group_found = !emergency_group_found;
1087
                            break;
1088
                        }
1089
                    }
1090

            
1091
                    if (!emergency_group_found)
1092
                        listChecklists(-1);
1093
                },
add missing exit to MFD/CHKL...
Sébastien MARQUE authored on 2017-03-20
1094
                EXIT: func {
1095
                    me.path = [];
1096
                    me.device.display.updateSoftKeys();
1097
                },
1098
            },
add TCAS
Sébastien MARQUE authored on 2017-12-21
1099
            MAP: {
1100
                TRAFFIC: func {
improve the selection of dis...
Sébastien MARQUE authored on 2017-12-30
1101
                    call(me.bindings.PFD.INSET.declutter, ['MAPTRAFFIC', 'tcas', 0], me);
1102
                },
1103
                ROUTE: func {
1104
                    call(me.bindings.PFD.INSET.declutter, ['MAPROUTE', 'route', 1], me);
1105
                },
1106
                TERRAIN: func {
1107
                    call(me.bindings.PFD.INSET.declutter, ['MAPTERRAIN', 'tiles', 3], me);
1108
                },
1109
                NAVAIDS: {
1110
                    ALL: func {
1111
                        call(me.bindings.PFD.INSET.NAVAIDS.ALL, [ 'MAPNAVAIDS' ], me);
1112
                    },
1113
                    VOR: func {
1114
                        call(me.bindings.PFD.INSET.NAVAIDS.declutter, ['MAPNAVAIDSVOR', 'VOR', 2], me);
1115
                    },
1116
                    TACAN: func {
1117
                        call(me.bindings.PFD.INSET.NAVAIDS.declutter, ['MAPNAVAIDSTACAN', 'TACAN', 3], me);
1118
                    },
1119
                    NDB: func {
1120
                        call(me.bindings.PFD.INSET.NAVAIDS.declutter, ['MAPNAVAIDSNDB', 'NDB', 4], me);
1121
                    },
1122
                    DME: func {
1123
                        call(me.bindings.PFD.INSET.NAVAIDS.declutter, ['MAPNAVAIDSDME', 'DME', 5], me);
1124
                    },
1125
                    APT: func {
1126
                        call(me.bindings.PFD.INSET.NAVAIDS.declutter, ['MAPNAVAIDSAPT', 'airport', 6], me);
1127
                    },
add TCAS
Sébastien MARQUE authored on 2017-12-21
1128
                },
1129
            },
softkeys are available now
Sébastien MARQUE authored on 2017-03-14
1130
        },
commit initial
Sébastien MARQUE authored on 2017-03-07
1131
    },
1132
};
massive code reorganisation ...
Sébastien MARQUE authored on 2017-05-01
1133

            
1134
var keyMap = {
vim folds
Sébastien MARQUE authored on 2017-12-21
1135
# softkeys map for PFD and MFD {{{1
1136
# PFD {{{2
massive code reorganisation ...
Sébastien MARQUE authored on 2017-05-01
1137
    PFD : {
1138
        first : 1,
1139
        texts : ['INSET', 'SENSOR', 'PFD', 'OBS', 'CDI', 'DME', 'XPDR', 'IDENT', 'TMR/REF', 'NRST' ],
1140
        INSET : {
improve the selection of dis...
Sébastien MARQUE authored on 2017-12-30
1141
            texts : ['OFF', '', 'TRAFFIC', 'ROUTE', 'TOPO', 'TERRAIN', 'NAVAIDS', 'METAR'],
1142
            NAVAIDS : {
1143
                first : 2,
1144
                texts : ['VOR', 'TACAN', 'NDB', 'DME', 'APT', '', 'ALL'],
1145
            },
massive code reorganisation ...
Sébastien MARQUE authored on 2017-05-01
1146
        },
1147
        SENSOR : {
1148
            first : 2,
1149
            texts : [ 'ADC1', 'ADC2', '', 'AHRS1', 'AHRS2'],
1150
        },
1151
        PFD : {
1152
            texts : [ 'SYN VIS', 'DFLTS', 'AOA/WIND', 'DME', 'BRG1', 'HSI FMT', 'BRG2', '', 'ALT UNIT', 'STD BARO' ],
1153
            'SYN VIS' : {
1154
                texts : [ 'PATHWAY', 'SYN TERR', 'HR2NHDG', 'APTSIGNS', 'FPM'],
1155
            },
1156
            'AOA/WIND' : {
1157
                first : 4,
1158
                texts : ['AOA', 'WIND'],
1159
                AOA : {
1160
                    first : 5,
1161
                    texts : ['AOA ON', 'AOA AUTO'],
1162
                },
1163
                WIND : {
1164
                    first : 2,
1165
                    texts : ['OPTN1', 'OPTN2', '', 'OFF'],
1166
                },
1167
            },
1168
            'HSI FMT' : {
1169
                first : 6,
1170
                texts : ['360 HSI', 'ARC HSI'],
1171
            },
1172
            'ALT UNIT' : {
1173
                first : 5,
1174
                texts : ['METERS', '', 'IN', 'HPA'],
1175
            },
1176
        },
1177
        XPDR : {
1178
            first : 2,
1179
            texts : ['STBY', 'ON', 'ALT', '', 'VFR', 'CODE', 'IDENT'],
1180
            CODE : {
1181
                texts : ['0', '1', '2', '3', '4', '5', '6', '7', 'IDENT', 'BKSP'],
1182
            },
1183
        },
add PFD/NRST softkey
Sébastien MARQUE authored on 2020-05-16
1184
        NRST : {
1185
            first : 4,
1186
            texts : ['OMNI', 'REAR', 'FRONT', 'LEFT', 'RIGHT', 'RANGE'],
1187
            RANGE : {
1188
                first : 7,
1189
                texts : ['MIN', 'MAX' ],
1190
                MIN : { first: 3, texts : ['0NM',   '10NM',  '30NM',  '50NM'] },
1191
                MAX : { fisrt: 3, texts : ['200NM', '150NM', '100NM', '50NM'] },
1192
            },
adds NRST/COMMS
Sébastien MARQUE authored on 2020-05-18
1193
            OMNI : { texts: ['NDB', 'FIX', 'VOR', 'APT', '', '', '', '', '', 'COMM'] }, # that will be mirrored later
add PFD/NRST softkey
Sébastien MARQUE authored on 2020-05-16
1194
        },
massive code reorganisation ...
Sébastien MARQUE authored on 2017-05-01
1195
    },
vim folds
Sébastien MARQUE authored on 2017-12-21
1196
#}}}2
1197
# MFD {{{2
massive code reorganisation ...
Sébastien MARQUE authored on 2017-05-01
1198
    MFD : {
1199
        texts : ['ENGINE', '', 'MAP', '', '', '', '', '', '', 'DCLTR', 'SHW CHRT', 'CHKLIST'],
1200
        MAP : {
improve the selection of dis...
Sébastien MARQUE authored on 2017-12-30
1201
            texts : ['TRAFFIC', 'ROUTE', 'TOPO', 'TERRAIN', 'NAVAIDS', '','', '', '', '', 'BACK'],
1202
            NAVAIDS : {
1203
                first : 2,
1204
                texts : ['VOR', 'TACAN', 'NDB', 'DME', 'APT', '', 'ALL', '', '', 'BACK' ],
1205
            },
massive code reorganisation ...
Sébastien MARQUE authored on 2017-05-01
1206
        },
1207
        CHKLIST : {
add checklists management
Sébastien MARQUE authored on 2020-04-30
1208
            texts : ['ENGINE', '', '', '', 'LIST', 'DONE', '', '', '', '', 'EXIT', 'EMERGCY'],
massive code reorganisation ...
Sébastien MARQUE authored on 2017-05-01
1209
        },
1210
        ENGINE : {
1211
            texts : ['ENGINE', 'ANTI-ICE', '', 'DCLTR', '', 'ASSIST', '', '', '', '', 'FUEL'],
1212
            'ANTI-ICE' : {
1213
                texts : ['LEFT', 'AUTO', 'RIGHT', '', '', '', '', '', '', '', '', 'BACK'],
1214
            },
1215
            FUEL : {
1216
                first : 1,
1217
                texts : ['FULL', 'TABS', '', '', '', '', '', '', '', 'UNDO', 'ENTER'],
1218
            },
1219
        },
1220
    },
vim folds
Sébastien MARQUE authored on 2017-12-21
1221
#}}}2
massive code reorganisation ...
Sébastien MARQUE authored on 2017-05-01
1222
};
1223
if (data['stall-aoa'] == 9999)
1224
    keyMap.PFD.PFD['AOA/WIND'].texts = ['', 'WIND'];
add checklists management
Sébastien MARQUE authored on 2020-04-30
1225
if (props.globals.getNode('/sim/checklists') == nil) {
1226
    keyMap.MFD.texts[11] = '';
1227
    delete(keyMap.MFD, 'CHKLIST');
1228
}
add PFD/NRST softkey
Sébastien MARQUE authored on 2020-05-16
1229
foreach (var d; ['FRONT', 'REAR', 'LEFT', 'RIGHT']) {
1230
    keyMap.PFD.NRST[d] = keyMap.PFD.NRST.OMNI;
1231
}
vim folds
Sébastien MARQUE authored on 2017-12-21
1232
#}}}1