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

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

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

            
778
                    var groupIndex     = me.device.windows.state[id].objects[selected].groupIndex;
779
                    var checklistIndex = me.device.windows.state[id].objects[selected].checklistIndex;
780

            
781
                    if (contains(me.device.windows.state[id].objects[selected], 'pageIndex'))
782
                        pageIndex = me.device.windows.state[id].objects[selected].pageIndex;
783
                    else
784
                        pageIndex = -1;
785

            
786
                    var title = '';
787
                    if (contains(me.device.windows.state[id].objects[selected], 'checklistTitle'))
788
                        title = me.device.windows.state[id].objects[selected].checklistTitle;
789
                    else
790
                        title = me.device.windows.state[id].objects[selected].text;
791

            
792
                    me.device.windows.del(id);
793

            
794
                    if (groupIndex < 0)
795
                         checklistNode = props.globals.getNode("/sim/checklists")
796
                                    .getChild('checklist', checklistIndex);
797
                    else
798
                         checklistNode = props.globals.getNode("/sim/checklists")
799
                                    .getChild("group", groupIndex)
800
                                    .getChild('checklist', checklistIndex);
801

            
802
                    var pages = checklistNode.getChildren('page');
803

            
804
                    if (size(pages) and pageIndex == -1)
805
                        pageIndex = 0;
806

            
807
                    _previous_text = ' < PREVIOUS ';
808
                    _next_text     = ' NEXT > ';
809

            
810
                    var obj_infos = [];
811
                    var length = size(_previous_text ~ _next_text);
812
                    var length_cache = [];
813
                    if (size(pages))
814
                        checklistNode = pages[pageIndex];
815

            
816
                    append(obj_infos, {
817
                        text: sprintf('%s%s',
818
                                      title,
819
                                      size(pages) > 1 ? sprintf(' %d / %d',
820
                                                                pageIndex + 1,
821
                                                                size(pages)) : ''),
822
                        type: 'title'
823
                    });
824

            
825
                    append(obj_infos, {type: 'separator'});
826

            
827
                    forindex (var i; checklistNode.getChildren('item')) {
828
                        var l = size(checklistNode.getChild('item', i).getValue('name'));
829
                        if (checklistNode.getChild('item', i).getChild('value') != nil)
830
                            l += size(checklistNode.getChild('item', i).getValue('value'));
831
                        append(length_cache, l);
832
                        if (l > length)
833
                            length = l;
834
                    }
835

            
836
                    forindex (var i; checklistNode.getChildren('item')) {
837
                        var text = pages[pageIndex].getChild('item', i).getValue('name');
838
                        var item_val = '';
839
                        if (pages[pageIndex].getChild('item', i).getChild('value') != nil)
840
                            item_val = pages[pageIndex].getChild('item', i).getValue('value');
841
                        if (item_val != '')
842
                            text ~= tabulate(length, length_cache[i]);
843
                        text ~= item_val;
844

            
845
                        append(obj_infos, {
846
                            text: text,
847
                            groupIndex: groupIndex,
848
                            checklistIndex: checklistIndex,
849
                            pageIndex: pageIndex,
850
                            type: 'normal|end-of-line'
851
                        });
852
                    }
853

            
854
                    append(obj_infos, {type: 'separator'});
855

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

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

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

            
907
                        me.device.windows.del(id);
908

            
909
                        var checklists = [];
910
                        var firstEntry = 1;
911
                        if (groupIndex == -1)
912
                            checklists = props.globals.getNode("/sim/checklists")
913
                                            .getChildren('checklist');
914
                        else
915
                            checklists = props.globals.getNode("/sim/checklists")
916
                                            .getChild("group", groupIndex)
917
                                            .getChildren('checklist');
918
                        var checklistsQty = size(checklists);
919
                        var obj_infos = [];
920

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

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

            
961
                    var windowId = 'CHKLIST LIST';
962
                    if (contains(me.device.windows.state, windowId))
963
                        me.device.windows.del(windowId);
964

            
965
                    var obj_infos = [];
966
                    var firstEntry = 1;
967
                    var groups = props.globals.getNode("/sim/checklists").getChildren("group");
968
                    var groupsQty = size(groups);
969

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

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

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

            
1067
                    var windowId = 'CHKLIST EMERGCY';
1068
                    if (contains(me.device.windows.state, windowId))
1069
                        me.device.windows.del(windowId);
1070

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

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

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

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