zkv1000 / Nasal / display.nas /
Newer Older
1239 lines | 46.258kb
comment on the folds
Sébastien MARQUE authored on 2017-03-13
1
# vim: set foldmethod=marker foldmarker={{{,}}} :
commit initial
Sébastien MARQUE authored on 2017-03-07
2
var displayClass = {
pass device pointer to displ...
Sébastien MARQUE authored on 2017-03-14
3
    new: func(device, role) {
add new vim folds
Sébastien MARQUE authored on 2017-03-15
4
# the contructor {{{
commit initial
Sébastien MARQUE authored on 2017-03-07
5
        var m = { parents: [ displayClass ] };
cosmétique: folding pour les...
Sébastien MARQUE authored on 2017-03-13
6

            
commit initial
Sébastien MARQUE authored on 2017-03-07
7
        m.display = canvas.new({
8
                "name"      : role,
9
                "size"      : [1024, 768],
10
                "view"      : [1024, 768],
11
                "mipmapping": 1
12
        });
13
        m.display.addPlacement({
14
                "node": "Screen",
15
                "parent": role
16
        });
17
        m.display.setColorBackground(0,0,0);
adds the avaibility to have ...
Sébastien MARQUE authored on 2017-04-07
18
        m.role = substr(role, 0, 3);
pass device pointer to displ...
Sébastien MARQUE authored on 2017-03-14
19
        m.device = device;
écriture du wrapper pour le ...
Sébastien MARQUE authored on 2017-03-10
20
        m.screenElements = {};
commit initial
Sébastien MARQUE authored on 2017-03-07
21

            
Softkeys revert to the previ...
Sébastien MARQUE authored on 2017-03-21
22
        m.timers2 = {}; # tho old timer implementation use already a named timer hash
23
        # Softkeys revert to the previous level after 45 seconds of inactivity.
24
        m.softkeys_inactivity_delay = 45;
25

            
adds Map on MFD
Sébastien MARQUE authored on 2017-03-20
26
        if (role == 'MFD') {
27
            m.MFDMapTiles = MapTiles.new(m.display);
28
            m.MFDMapNavDisplay = MapNavDisplay.new(m.display);
EIS can be aircraft specific
Sébastien MARQUE authored on 2017-04-04
29
            var eis_dir = getprop('/sim/fg-aircraft') ~ '/Instruments-3d/zkv1000/Nasal/EIS/';
30
            var eis_type = getprop('/instrumentation/zkv1000/eis/type');
31
            if (eis_type == nil or
32
                    (io.stat(eis_dir ~ eis_type ~ '.nas') == nil
33
                     and print(eis_type ~ ' not found')))
34
                eis_type = 'none';
35
            io.load_nasal(eis_dir ~ eis_type ~ '.nas', 'zkv1000');
adds Map on MFD
Sébastien MARQUE authored on 2017-03-20
36
        }
37

            
add Vne Vspeed specific to a...
Sébastien MARQUE authored on 2017-04-04
38
        m._ias_vne = getprop('/instrumentation/zkv1000/alerts/Vne');
39

            
commit initial
Sébastien MARQUE authored on 2017-03-07
40
        return m;
41
    },
add new vim folds
Sébastien MARQUE authored on 2017-03-15
42
#}}}
commit initial
Sébastien MARQUE authored on 2017-03-07
43

            
add new vim folds
Sébastien MARQUE authored on 2017-03-15
44
# timers stuff {{{
ajoute un timer pour cacher ...
Sébastien MARQUE authored on 2017-03-13
45
    timers : {},
46

            
47
    timerTrigger : func {
48
        var now = systime();
49
        foreach (var id; keys(me.timers)) {
50
            if (me.timers[id] < now) {
51
                me.screenElements[id].hide();
52
                delete(me.timers, id);
53
            }
54
        }
55
        settimer(func me.timerTrigger(), 1);
56
    },
57

            
58
    addTimer : func (duration, element) {
59
        if (typeof(element) == 'scalar')
60
            element = [ element ];
61
        var end = systime() + duration;
62
        foreach (var e; element)
63
            me.timers[e] = end;
64
    },
add new vim folds
Sébastien MARQUE authored on 2017-03-15
65
#}}}
ajoute un timer pour cacher ...
Sébastien MARQUE authored on 2017-03-13
66

            
commit initial
Sébastien MARQUE authored on 2017-03-07
67
    loadsvg : func () {
68
        me.screen = me.display.createGroup();
69
        me.screen.hide();
70
        canvas.parsesvg(me.screen, "Aircraft/Instruments-3d/zkv1000/Systems/screen.svg");
71
    },
72

            
73
    _showInitProgress : func (p,t) {
cosmétique: folding pour les...
Sébastien MARQUE authored on 2017-03-13
74
#{{{
commit initial
Sébastien MARQUE authored on 2017-03-07
75
        p.setText(t);
adds the avaibility to have ...
Sébastien MARQUE authored on 2017-04-07
76
        if (zkv.getNode(me.device.role ~ 'init').getValue() != 0) {
commit initial
Sébastien MARQUE authored on 2017-03-07
77
            if (size(t) >= 10) t = '';
78
            settimer(func { me._showInitProgress(p, t ~ '.'); }, 0.1);
79
        }
80
        else {
81
            me.progress.hide();
82
            me.screen.show();
séparation configuration PFD...
Sébastien MARQUE authored on 2017-03-12
83
            var groups = {
animation VSI
Sébastien MARQUE authored on 2017-03-10
84
                show : [
makes header visible on MFD ...
Sébastien MARQUE authored on 2017-03-18
85
                    'Header',
commit initial
Sébastien MARQUE authored on 2017-03-07
86
                    'SoftKeysTexts', 
87
                    'COMM', 
88
                    'NAV', 
ajout COMM, et factorisation...
Sébastien MARQUE authored on 2017-03-12
89
                    'nav-freq-switch',
90
                    'comm-freq-switch',
séparation configuration PFD...
Sébastien MARQUE authored on 2017-03-12
91
                ],
92
                text: [
93
                    'nav1-standby-freq', 'nav1-selected-freq', 'nav1-id',
94
                    'nav2-standby-freq', 'nav2-selected-freq', 'nav2-id',
ajout COMM, et factorisation...
Sébastien MARQUE authored on 2017-03-12
95
                    'comm1-standby-freq', 'comm1-selected-freq',
96
                    'comm2-standby-freq', 'comm2-selected-freq',
séparation configuration PFD...
Sébastien MARQUE authored on 2017-03-12
97
                ],
ajout COMM, et factorisation...
Sébastien MARQUE authored on 2017-03-12
98
                hide : [ ],
séparation configuration PFD...
Sébastien MARQUE authored on 2017-03-12
99
                clip: [ ],
100
            };
softkeys are available now
Sébastien MARQUE authored on 2017-03-14
101

            
add softkeys colors
Sébastien MARQUE authored on 2017-03-21
102
            for (var k = 0; k < 12; k += 1) {
softkeys are available now
Sébastien MARQUE authored on 2017-03-14
103
                append(groups.text, sprintf("SoftKey%02i-text", k));
add softkeys colors
Sébastien MARQUE authored on 2017-03-21
104
                append(groups.show, sprintf("SoftKey%02i-bg", k));
105
            }
softkeys are available now
Sébastien MARQUE authored on 2017-03-14
106

            
séparation configuration PFD...
Sébastien MARQUE authored on 2017-03-12
107
            if (me.role == 'PFD') {
108
                append(groups.show,
commit initial
Sébastien MARQUE authored on 2017-03-07
109
                    'XPDR-TIME', 
AI disponible
Sébastien MARQUE authored on 2017-03-10
110
                    'FlightInstruments',
111
                    'Horizon',
AI disponible, avec bankPoin...
Sébastien MARQUE authored on 2017-03-10
112
                    'bankPointer',
animation VSI
Sébastien MARQUE authored on 2017-03-10
113
                    'VSI',
animation HSI
Sébastien MARQUE authored on 2017-03-11
114
                    'Rose',
animation HDG bug
Sébastien MARQUE authored on 2017-03-13
115
                    'Heading-bug',
116
                    'PFD-Widgets',
trends animation
Sébastien MARQUE authored on 2017-03-13
117
                    'Trends',
118
                    'Airspeed-Trend-Indicator',
119
                    'Altitude-Trend-Indicator',
adds OAT, TAS, GSPD, WindDat...
Sébastien MARQUE authored on 2017-03-15
120
                    'OAT',
121
                    'IAS-bg',
122
                    'TAS',
123
                    'GSPD',
adds BARO settings
Sébastien MARQUE authored on 2017-03-20
124
                    'BARO-bg',
adds slipskid animation
Sébastien MARQUE authored on 2017-03-24
125
                    'SlipSkid',
add V-speeds bugs
Sébastien MARQUE authored on 2017-04-04
126
                    'IAS-Vx', 'IAS-Vy', 'IAS-Vr', 'IAS-Vglide',
séparation configuration PFD...
Sébastien MARQUE authored on 2017-03-12
127
                );
128
                append(groups.hide,
adds EIS
Sébastien MARQUE authored on 2017-03-18
129
                    'EIS',
NAV disponible (hors CDI)
Sébastien MARQUE authored on 2017-03-11
130
                    'CDI',
adds OMI to PFD
Sébastien MARQUE authored on 2017-03-23
131
                    'OMI', 'MarkerBG', 'MarkerText',
adds CDI
Sébastien MARQUE authored on 2017-03-18
132
                    'NAV1-pointer', 'NAV1-CDI', 'NAV1-FROM', 'NAV1-TO',
133
                    'NAV2-pointer', 'NAV2-CDI', 'NAV2-FROM', 'NAV2-TO',
134
                    'GPS-pointer', 'GPS-CDI', 'GPS-CTI', 'GPS-CTI-diamond', 'GPS-FROM', 'GPS-TO',
adds BRG1/2 animation
Sébastien MARQUE authored on 2017-03-16
135
                    'BRG1-pointer',
136
                    'BRG2-pointer',
animation HDG bug
Sébastien MARQUE authored on 2017-03-13
137
                    'SelectedHDG-bg',
138
                    'SelectedHDG-bgtext',
139
                    'SelectedHDG-text',
140
                    'SelectedCRS-bg',
141
                    'SelectedCRS-bgtext',
142
                    'SelectedCRS-text',
fix Selected Altitude displa...
Sébastien MARQUE authored on 2017-03-18
143
                    'SelectedALT', 'SelectedALT-bug', 'SelectedALT-bg', 'SelectedALT-symbol',
animation HDG bug
Sébastien MARQUE authored on 2017-03-13
144
                    'TAS',
145
                    'GSPD',
146
                    'WindData',
147
                    'Reversionnary',
148
                    'Annunciation',
149
                    'Comparator',
150
                    'BRG1',
151
                    'BRG2',
152
                    'DME1',
153
                    'PFD-Map',
adds OAT, TAS, GSPD, WindDat...
Sébastien MARQUE authored on 2017-03-15
154
                    'PFD-Multilines',
improves WindData display
Sébastien MARQUE authored on 2017-03-16
155
                    'WindData', 'WindData-OPTN1', 'WindData-OPTN2', 'WindData-OPTN1-HDG', 'WindData-OPTN2-symbol', 'WindData-OPTN2-headwind', 'WindData-OPTN2-crosswind', 'WindData-NODATA',
séparation configuration PFD...
Sébastien MARQUE authored on 2017-03-12
156
                );
157
                append(groups.clip,
animation IAS
Sébastien MARQUE authored on 2017-03-10
158
                    'SpeedLint1',
animation ALT
Sébastien MARQUE authored on 2017-03-11
159
                    'SpeedTape',
160
                    'LintAlt',
161
                    'AltLint00011'
162
                );
séparation configuration PFD...
Sébastien MARQUE authored on 2017-03-12
163
                append(groups.text,
fix Selected Altitude displa...
Sébastien MARQUE authored on 2017-03-18
164
                    'SelectedALT-text',
adds OAT, TAS, GSPD, WindDat...
Sébastien MARQUE authored on 2017-03-15
165
                    'TAS-text',
166
                    'GSPD-text',
anime time display
Sébastien MARQUE authored on 2017-03-13
167
                    'TIME-text',
adds OAT, TAS, GSPD, WindDat...
Sébastien MARQUE authored on 2017-03-15
168
                    'OAT-text',
séparation configuration PFD...
Sébastien MARQUE authored on 2017-03-12
169
                    'VSIText',
170
                    'Speed110',
171
                    'Alt11100',
172
                    'HDG-text',
adds BARO settings
Sébastien MARQUE authored on 2017-03-20
173
                    'BARO-text',
adds CDI
Sébastien MARQUE authored on 2017-03-18
174
                    'CDI-SRC-text', 'CDI-GPS-ANN-text', 'CDI-GPS-XTK-text',
adds BRG1/2 animation
Sébastien MARQUE authored on 2017-03-16
175
                    'BRG1-pointer', 'BRG1-SRC-text', 'BRG1-DST-text', 'BRG1-WPID-text',
176
                    'BRG2-pointer', 'BRG2-SRC-text', 'BRG2-DST-text', 'BRG2-WPID-text',
adds OAT, TAS, GSPD, WindDat...
Sébastien MARQUE authored on 2017-03-15
177
                    'WindData-OPTN1-HDG-text', 'WindData-OPTN1-SPD-text',
178
                    'WindData-OPTN2-crosswind-text', 'WindData-OPTN2-headwind-text',
adds transponder
Sébastien MARQUE authored on 2017-03-17
179
                    'XPDR-MODE-text', 'XPDR-DIGIT-3-text', 'XPDR-DIGIT-2-text', 'XPDR-DIGIT-1-text', 'XPDR-DIGIT-0-text',
séparation configuration PFD...
Sébastien MARQUE authored on 2017-03-12
180
                    'AltBigC', 'AltSmallC'
181
                );
182
                for (var place = 1; place <= 6; place +=1) {
183
                    append(groups.text,
184
                        'AltBigU' ~ place,
185
                        'AltSmallU' ~ place,
186
                        'AltBigD' ~ place,
187
                        'AltSmallD' ~ place
188
                    );
189
                }
animation ALT
Sébastien MARQUE authored on 2017-03-11
190
            }
adds EIS
Sébastien MARQUE authored on 2017-03-18
191
            else {
EIS can be aircraft specific
Sébastien MARQUE authored on 2017-04-04
192
                if (contains(me.parents[0], 'showEIS'))
193
                    me.showEIS(groups);
adds EIS
Sébastien MARQUE authored on 2017-03-18
194
            }
séparation configuration PFD...
Sébastien MARQUE authored on 2017-03-12
195

            
196
            me.loadGroup(groups);
animation ALT
Sébastien MARQUE authored on 2017-03-11
197

            
make some data common to all...
Sébastien MARQUE authored on 2017-04-07
198
            foreach (var freq; keys(data.timers))
199
                data.timers[freq].start();
200

            
séparation configuration PFD...
Sébastien MARQUE authored on 2017-03-12
201
            if (me.role == 'PFD') {
adds OAT, TAS, GSPD, WindDat...
Sébastien MARQUE authored on 2017-03-15
202
                me.updateAI();
203
                me.updateVSI();
204
                me.updateIAS();
205
                me.updateALT();
206
                me.updateHSI();
anime time display
Sébastien MARQUE authored on 2017-03-13
207
                me.updateTIME();
adds OAT, TAS, GSPD, WindDat...
Sébastien MARQUE authored on 2017-03-15
208
                me.updateOAT();
209
                me.updateTAS();
adds BRG1/2 animation
Sébastien MARQUE authored on 2017-03-16
210
                me.updateBRG();
adds transponder
Sébastien MARQUE authored on 2017-03-17
211
                me.updateXPDR();
adds BARO settings
Sébastien MARQUE authored on 2017-03-20
212
                me.updateBARO();
adds OMI to PFD
Sébastien MARQUE authored on 2017-03-23
213
                me.updateOMI();
ajoute un timer pour cacher ...
Sébastien MARQUE authored on 2017-03-13
214
                me.timerTrigger();
séparation configuration PFD...
Sébastien MARQUE authored on 2017-03-12
215
            }
animation texts EIS + power ...
Sébastien MARQUE authored on 2017-03-19
216
            else {
217
                me.updateEIS();
adds Map on MFD
Sébastien MARQUE authored on 2017-03-20
218
                me.MFDMapNavDisplay.showMap();
219
                me.MFDMapTiles.initialize_grid();
220
                me.MFDMapTiles.update_timer.start();
animation texts EIS + power ...
Sébastien MARQUE authored on 2017-03-19
221
            }
ajout COMM, et factorisation...
Sébastien MARQUE authored on 2017-03-12
222
            me._updateRadio({auto:'nav'});
223
            me._updateRadio({auto:'comm'});
Softkeys revert to the previ...
Sébastien MARQUE authored on 2017-03-21
224
            me.softkeys_inactivity();
softkeys are available now
Sébastien MARQUE authored on 2017-03-14
225
            me.updateSoftKeys();
commit initial
Sébastien MARQUE authored on 2017-03-07
226
            me.progress.removeAllChildren();
227
            me.progress = nil;
228
            me.showInitProgress = nil;
229
            me._showInitProgress = nil;
230
            zkv.removeChild(me.role ~ 'init');
231
        }
232
    },
cosmétique: folding pour les...
Sébastien MARQUE authored on 2017-03-13
233
#}}}
commit initial
Sébastien MARQUE authored on 2017-03-07
234

            
235
    showInitProgress : func (role) {
cosmétique: folding pour les...
Sébastien MARQUE authored on 2017-03-13
236
#{{{
commit initial
Sébastien MARQUE authored on 2017-03-07
237
        me.progress = me.display.createGroup();
238
        me.progress.show();
239
        me.progress.createChild("text", role ~ " title")
240
            .setTranslation(512, 384)
241
            .setAlignment("center-center")
242
            .setFont("LiberationFonts/LiberationSans-Italic.ttf")
243
            .setFontSize(64, 1)
244
            .setColor(1,1,1)
245
            .setText("ZKV1000 " ~ role ~ " init");
246

            
247
        zkv.getNode(role ~ 'init',1).setIntValue(1);
248

            
249
        me._showInitProgress(me.progress.createChild("text", role ~ "progress")
250
            .setTranslation(512, 484)
251
            .setAlignment("center-center")
252
            .setFont("LiberationFonts/LiberationSans-Bold.ttf")
253
            .setFontSize(128, 1)
254
            .setColor(1,0,0), '.');
255
    },
cosmétique: folding pour les...
Sébastien MARQUE authored on 2017-03-13
256
#}}}
commit initial
Sébastien MARQUE authored on 2017-03-07
257

            
some added comments
Sébastien MARQUE authored on 2017-03-18
258
    colors : {
259
# set of predefined colors {{{
260
        green : [0, 1, 0],
261
        white : [1, 1, 1],
262
        black : [0, 0, 0],
263
        lightblue : [0, 1, 1],
264
        darkblue : [0, 0, 1],
265
        red : [1, 0, 0],
adds CDI
Sébastien MARQUE authored on 2017-03-18
266
        magenta : [1, 0, 1],
some added comments
Sébastien MARQUE authored on 2017-03-18
267
    },
268
#}}}
269

            
écriture du wrapper pour le ...
Sébastien MARQUE authored on 2017-03-10
270
    loadGroup : func (h) {
cosmétique: folding pour les...
Sébastien MARQUE authored on 2017-03-13
271
#{{{
écriture du wrapper pour le ...
Sébastien MARQUE authored on 2017-03-10
272
        if (typeof(h) != 'hash') {
273
            msg_dbg(sprintf("%s need a hash, but get a %s from %s",
274
                    caller(0)[0],
275
                    typeof(h),
276
                    caller(1)[0]));
277
            return;
commit initial
Sébastien MARQUE authored on 2017-03-07
278
        }
écriture du wrapper pour le ...
Sébastien MARQUE authored on 2017-03-10
279
        var setMethod = func (e, t) {
280
            if (t == 'hide')
281
                me.screenElements[e].hide();
282
            elsif (t == 'show')
283
                me.screenElements[e].show();
AI disponible
Sébastien MARQUE authored on 2017-03-10
284
            elsif (t == 'rot' or t == 'trans') {
285
                if (! contains(me.screenElements[e], t))
286
                    me.screenElements[e][t] = me.screenElements[e].createTransform();
287
            }
288
            elsif (t == 'clip') {
289
                if (contains(me.clips, e))
290
                    me.screenElements[e].set("clip", me.clips[e]);
291
                else
printlog with adapted level ...
Sébastien MARQUE authored on 2017-03-20
292
                    printlog('warn', 'no defined clip for ' ~ e);
AI disponible
Sébastien MARQUE authored on 2017-03-10
293
            }
animation VSI
Sébastien MARQUE authored on 2017-03-10
294
            elsif (t == 'text') {
295
                if (contains(me.texts, e)) {
296
                    if (contains(me.texts[e], 'alignment'))
297
                        me.screenElements[e].setAlignment(me.texts[e].alignment);
298
                    if (contains(me.texts[e], 'default'))
299
                        me.screenElements[e].setText(me.texts[e].default);
NAV disponible (hors CDI)
Sébastien MARQUE authored on 2017-03-11
300
                    if (contains(me.texts[e], 'color'))
301
                        me.screenElements[e].setColor(me.texts[e].color);
adds CDI
Sébastien MARQUE authored on 2017-03-18
302
                    if (contains(me.texts[e], 'visible'))
303
                        me.screenElements[e].setVisible(me.texts[e].visible);
animation VSI
Sébastien MARQUE authored on 2017-03-10
304
                }
printlog with adapted level ...
Sébastien MARQUE authored on 2017-03-20
305
                else
306
                    printlog('debug', 'no text format for ' ~ e);
animation VSI
Sébastien MARQUE authored on 2017-03-10
307
            }
commit initial
Sébastien MARQUE authored on 2017-03-07
308
            else
printlog with adapted level ...
Sébastien MARQUE authored on 2017-03-20
309
                printlog('warn', 'unknown method ' ~ t);
écriture du wrapper pour le ...
Sébastien MARQUE authored on 2017-03-10
310
        };
311
        foreach (var todo; keys(h)) {
312
            if (typeof(h[todo]) != 'vector') h[todo] = [ h[todo] ];
313
            foreach (var id; h[todo]) {
314
                if (! contains(me.screenElements, id)) {
315
                    me.screenElements[id] = me.screen.getElementById(id);
316
                    if (me.screenElements[id] != nil)
317
                        setMethod(id, todo);
318
                    else
printlog with adapted level ...
Sébastien MARQUE authored on 2017-03-20
319
                        printlog('warn', 'SVG ID ' ~ id ~ ' not found');
écriture du wrapper pour le ...
Sébastien MARQUE authored on 2017-03-10
320
                }
321
                else
322
                    setMethod(id, todo);
323
            }
commit initial
Sébastien MARQUE authored on 2017-03-07
324
        }
325
    },
cosmétique: folding pour les...
Sébastien MARQUE authored on 2017-03-13
326
#}}}
AI disponible
Sébastien MARQUE authored on 2017-03-10
327

            
328
    clips : {
cosmétique: folding pour les...
Sébastien MARQUE authored on 2017-03-13
329
#{{{
clean pre-merge
Sébastien MARQUE authored on 2017-03-11
330
        PitchScale   : "rect(70,664,370,256)",
331
        SpeedLint1   : "rect(252,226,318,204)",
332
        SpeedTape    : "rect(115,239,455,156)",
333
        LintAlt      : "rect(115,808,455,704)",
animation ALT
Sébastien MARQUE authored on 2017-03-11
334
        AltLint00011 : "rect(252,804,318,771)",
AI disponible
Sébastien MARQUE authored on 2017-03-10
335
    },
cosmétique: folding pour les...
Sébastien MARQUE authored on 2017-03-13
336
#}}}
AI disponible
Sébastien MARQUE authored on 2017-03-10
337

            
animation VSI
Sébastien MARQUE authored on 2017-03-10
338
    texts : {
cosmétique: folding pour les...
Sébastien MARQUE authored on 2017-03-13
339
#{{{
animation VSI
Sébastien MARQUE authored on 2017-03-10
340
        VSIText : {
341
            alignment: "right-bottom", default : num('0'),
342
        },
animation IAS
Sébastien MARQUE authored on 2017-03-10
343
        Speed110 : {
NAV disponible (hors CDI)
Sébastien MARQUE authored on 2017-03-11
344
            alignment : 'left-bottom'
animation IAS
Sébastien MARQUE authored on 2017-03-10
345
        },
animation ALT (2)
Sébastien MARQUE authored on 2017-03-11
346
        Alt11100 : {
NAV disponible (hors CDI)
Sébastien MARQUE authored on 2017-03-11
347
            alignment:'left-bottom'
animation ALT (2)
Sébastien MARQUE authored on 2017-03-11
348
        },
clean pre-merge
Sébastien MARQUE authored on 2017-03-11
349
        "HDG-text" : {
350
            default: '---°'
351
        },
NAV disponible (hors CDI)
Sébastien MARQUE authored on 2017-03-11
352
        'nav1-standby-freq' : {
353
            color: [0, 1, 1],
354
        },
355
        'nav1-id' : {
356
            default: ''
357
        },
358
        'nav2-id' : {
359
            default: ''
360
        },
adds CDI
Sébastien MARQUE authored on 2017-03-18
361
        'CDI-GPS-ANN-text' : {
362
            visible : 0
363
        },
364
        'CDI-GPS-XTK-text' : {
365
            visible : 0
366
        },
367
        'CDI-SRC-text' : {
368
            visible : 0
369
        },
adds BARO settings
Sébastien MARQUE authored on 2017-03-20
370
        'BARO-text' : {
371
            alignment : 'left-bottom',
372
        }
some added comments
Sébastien MARQUE authored on 2017-03-18
373
#        'TAS-text' : {
374
#            alignment : 'right-bottom',
375
#        },
376
#        'GSPD-text' : {
377
#            alignment : 'right-bottom',
378
#        },
animation VSI
Sébastien MARQUE authored on 2017-03-10
379
    },
cosmétique: folding pour les...
Sébastien MARQUE authored on 2017-03-13
380
#}}}
animation VSI
Sébastien MARQUE authored on 2017-03-10
381

            
Softkeys revert to the previ...
Sébastien MARQUE authored on 2017-03-21
382
    softkeys_inactivity : func {
383
# automagically back to previous level after some delay {{{
384
        me.timers2.softkeys_inactivity = maketimer (
385
            me.softkeys_inactivity_delay,
386
            func {
387
                pop(me.device.softkeys.path);
388
                me.updateSoftKeys();
389
            }, me);
390
        me.timers2.softkeys_inactivity.singleShot = 1;
391
    },
392
#}}}
393

            
add softkeys colors
Sébastien MARQUE authored on 2017-03-21
394
    setSoftKeyColor : func (n, active, alert = 0) {
395
# set colors for active softkeys {{{
396
        var sftk = sprintf('SoftKey%02i-', n);
397
        if (active) {
398
            var bg = alert ? 1 : 0.5;
399
            me.screenElements[sftk ~ 'bg']
400
                .setColorFill(bg,bg,bg);
401
            me.screenElements[sftk ~ 'text']
402
                .setColor(0,0,0);
403
        }
404
        else {
405
            me.screenElements[sftk ~ 'bg']
406
                .setColorFill(0,0,0);
407
            me.screenElements[sftk ~ 'text']
408
                .setColor(1,1,1);
409
        }
410
    },
411
#}}}
412

            
softkeys are available now
Sébastien MARQUE authored on 2017-03-14
413
    updateSoftKeys : func {
414
# update SoftKeys boxes {{{
415
        # on PFD the last boxes are always BACK and ALERTS
416
        if (me.role == 'PFD') {
417
            me.screenElements[sprintf("SoftKey%02i-text", 11)]
418
                .setText('ALERTS');
419
            if (size(me.device.softkeys.path) != 0)
420
                me.screenElements[sprintf("SoftKey%02i-text", 10)]
421
                    .setText('BACK');
422
        }
423

            
424
        var path = keyMap[me.role];
425
        foreach (var p; me.device.softkeys.path)
426
            path = path[p];
427

            
428
        # feeding with empty menus the first boxes
429
        var start = (contains(path, 'first')) ? path.first : 0;
430
        for (var k = 0; k < start; k+=1) {
431
            me.screenElements[sprintf("SoftKey%02i-text", k)]
432
                .setText('');
433
        }
434
        # filling with the content the next boxes
435
        forindex (var k; path.texts) {
436
            var i = k + start;
437
            me.screenElements[sprintf("SoftKey%02i-text", i)]
438
                .setText(path.texts[k]);
439
        }
440
        # feeding the last boxes with empty string
441
        var end = (me.role == 'PFD') ? 10 : 12;
442
        if (size(path.texts) + start < end) {
443
            start = size(path.texts) + start;
444
            for (var k = start; k < end; k += 1)
445
                me.screenElements[sprintf("SoftKey%02i-text", k)]
446
                    .setText('');
447
        }
Softkeys revert to the previ...
Sébastien MARQUE authored on 2017-03-21
448

            
449
        if (size(me.device.softkeys.path))
450
            me.timers2.softkeys_inactivity.restart(me.softkeys_inactivity_delay);
451
        else
452
            me.timers2.softkeys_inactivity.stop();
softkeys are available now
Sébastien MARQUE authored on 2017-03-14
453
    },
454
#}}}
455

            
adds OAT, TAS, GSPD, WindDat...
Sébastien MARQUE authored on 2017-03-15
456
    updateAI: func(){
cosmétique: folding pour les...
Sébastien MARQUE authored on 2017-03-13
457
#{{{
make some data common to all...
Sébastien MARQUE authored on 2017-04-07
458
        var pitch = data.pitch;
459
        var roll = data.roll;
AI disponible
Sébastien MARQUE authored on 2017-03-10
460
        if (pitch > 80)
461
            pitch = 80;
clean pre-merge
Sébastien MARQUE authored on 2017-03-11
462
        elsif (pitch < -80)
AI disponible
Sébastien MARQUE authored on 2017-03-10
463
            pitch = -80;
464
        me.screenElements.Horizon
fix AI animation
Sébastien MARQUE authored on 2017-03-19
465
            .setCenter(459, 282.8 - 6.849 * pitch)
AI disponible
Sébastien MARQUE authored on 2017-03-10
466
            .setRotation(-roll * D2R)
fix AI animation
Sébastien MARQUE authored on 2017-03-19
467
            .setTranslation(0, pitch * 6.849);
AI disponible, avec bankPoin...
Sébastien MARQUE authored on 2017-03-10
468
        me.screenElements.bankPointer
469
            .setRotation(-roll * D2R);
adds slipskid animation
Sébastien MARQUE authored on 2017-03-24
470
        me.screenElements['SlipSkid']
471
            .setTranslation(getprop("/instrumentation/slip-skid-ball/indicated-slip-skid") * 10, 0);
adds OAT, TAS, GSPD, WindDat...
Sébastien MARQUE authored on 2017-03-15
472
        settimer(func me.updateAI(), 0.1);
AI disponible
Sébastien MARQUE authored on 2017-03-10
473
    },
cosmétique: folding pour les...
Sébastien MARQUE authored on 2017-03-13
474
#}}}
animation VSI
Sébastien MARQUE authored on 2017-03-10
475

            
adds OAT, TAS, GSPD, WindDat...
Sébastien MARQUE authored on 2017-03-15
476
    updateVSI: func () {
comment on the folds
Sébastien MARQUE authored on 2017-03-13
477
# animate VSI {{{
make some data common to all...
Sébastien MARQUE authored on 2017-04-07
478
        var vsi = data.vsi;
animation VSI
Sébastien MARQUE authored on 2017-03-10
479
        me.screenElements.VSIText
480
            .setText(num(math.round(vsi, 10)));
481
        if (vsi > 4500)
482
            vsi = 4500;
483
        elsif (vsi < -4500)
484
            vsi = -4500;
485
        me.screenElements.VSI
486
            .setTranslation(0, vsi * -0.03465);
adds OAT, TAS, GSPD, WindDat...
Sébastien MARQUE authored on 2017-03-15
487
        settimer(func me.updateVSI(), 0.1);
animation VSI
Sébastien MARQUE authored on 2017-03-10
488
    },
cosmétique: folding pour les...
Sébastien MARQUE authored on 2017-03-13
489
#}}}
animation IAS
Sébastien MARQUE authored on 2017-03-10
490

            
adds OAT, TAS, GSPD, WindDat...
Sébastien MARQUE authored on 2017-03-15
491
    updateIAS: func () {
comment on the folds
Sébastien MARQUE authored on 2017-03-13
492
# animates the IAS lint (PFD) {{{
make some data common to all...
Sébastien MARQUE authored on 2017-04-07
493
        var ias = data.ias;
animation IAS
Sébastien MARQUE authored on 2017-03-10
494
        if (ias >= 10)
495
            me.screenElements.Speed110
496
                .setText(sprintf("% 2u",num(math.floor(ias/10))));
497
        else
498
            me.screenElements.Speed110
499
                .setText('');
500
        me.screenElements.SpeedLint1
501
            .setTranslation(0,(math.mod(ias,10) + (ias >= 10)*10) * 36);
502
        me.screenElements.SpeedTape
503
            .setTranslation(0,ias * 5.711);
adds OAT, TAS, GSPD, WindDat...
Sébastien MARQUE authored on 2017-03-15
504
        if (ias > me._ias_vne and ! me._ias_already_exceeded) { # easier than .getColorFill
505
            me._ias_already_exceeded = 1;
506
            me.screenElements['IAS-bg']
507
                .setColorFill(1,0,0);
508
        }
509
        elsif (ias < me._ias_vne and me._ias_already_exceeded) { # easier than .getColorFill
510
            me._ias_already_exceeded = 0;
511
            me.screenElements['IAS-bg']
512
                .setColorFill(0,0,0);
513
        }
add V-speeds bugs
Sébastien MARQUE authored on 2017-04-04
514
        foreach (var v; ['Vx', 'Vy', 'Vr', 'Vglide']) {
515
            if (me.device.data[v ~ '-visible'] and abs(me.device.data[v] - ias) < 30)
516
                me.screenElements['IAS-' ~ v]
517
                    .setTranslation(0, (ias - me.device.data[v]) * 5.711)
518
                    .show();
519
            else
520
                me.screenElements['IAS-' ~ v]
521
                    .hide();
522
        }
523

            
trends animation
Sébastien MARQUE authored on 2017-03-13
524
        var now = systime();
525
        # estimated speed in 6s
526
        var Sy = 6 * (ias - me._last_ias_kt) / (now - me._last_ias_s);
527
        if (abs(Sy) > 30)
528
            Sy = 30 * abs(Sy)/Sy; # = -30 or 30
529
        me.screenElements['Airspeed-Trend-Indicator']
530
            .setScale(1,Sy)
531
            .setTranslation(0, -284.5 * (Sy - 1));
532
        me._last_ias_kt = ias;
533
        me._last_ias_s = now;
adds OAT, TAS, GSPD, WindDat...
Sébastien MARQUE authored on 2017-03-15
534
        settimer(func me.updateIAS(), 0.1);
animation IAS
Sébastien MARQUE authored on 2017-03-10
535
    },
trends animation
Sébastien MARQUE authored on 2017-03-13
536
    _last_ias_kt : 0,
537
    _last_ias_s : systime(),
adds OAT, TAS, GSPD, WindDat...
Sébastien MARQUE authored on 2017-03-15
538
    _ias_already_exceeded : 0,
cosmétique: folding pour les...
Sébastien MARQUE authored on 2017-03-13
539
#}}}
animation ALT
Sébastien MARQUE authored on 2017-03-11
540

            
adds OAT, TAS, GSPD, WindDat...
Sébastien MARQUE authored on 2017-03-15
541
    updateTAS: func {
542
# updates the True Airspeed and GroundSpeed indicators {{{
543
        me.screenElements['TAS-text']
544
            .setText(sprintf('%iKT', getprop('/instrumentation/airspeed-indicator/true-speed-kt')));
545
        me.screenElements['GSPD-text']
546
            .setText(sprintf('%iKT', getprop('/velocities/groundspeed-kt')));
547
        settimer(func me.updateTAS(), 0.5);
548
    },
549
#}}}
550

            
551
    updateALT: func () {
552
# animates the altitude lint (PFD) {{{
make some data common to all...
Sébastien MARQUE authored on 2017-04-07
553
        var alt = data.alt;
animation ALT
Sébastien MARQUE authored on 2017-03-11
554
        if (alt < 0)
555
            me.screenElements.Alt11100
556
                .setText(sprintf("% 3i",math.ceil(alt/100)));
557
        elsif (alt < 100)
558
            me.screenElements.Alt11100
559
                .setText('');
560
        else
561
            me.screenElements.Alt11100
562
                .setText(sprintf("% 3i",math.floor(alt/100)));
563
        me.screenElements.AltLint00011
564
            .setTranslation(0,math.fmod(alt,100) * 1.24);
565

            
566
        # From Farmin/G1000 http://wiki.flightgear.org/Project_Farmin/FG1000
567
        if (alt> -1000 and alt< 1000000) {
568
            var Offset10 = 0;
569
            var Offset100 = 0;
570
            var Offset1000 = 0;
571
            if (alt< 0) {
572
                var Ne = 1;
573
                var alt= -alt;
574
            }
575
            else
576
                var Ne = 0;
577

            
578
            var Alt10       = math.mod(alt,100);
579
            var Alt100      = int(math.mod(alt/100,10));
580
            var Alt1000     = int(math.mod(alt/1000,10));
581
            var Alt10000    = int(math.mod(alt/10000,10));
582
            var Alt20       = math.mod(Alt10,20)/20;
583
            if (Alt10 >= 80)
584
                var Alt100 += Alt20;
585

            
586
            if (Alt10 >= 80 and Alt100 >= 9)
587
                var Alt1000 += Alt20;
588

            
589
            if (Alt10 >= 80 and Alt100 >= 9 and Alt1000 >= 9)
590
                var Alt10000 += Alt20;
591

            
592
            if (alt> 100)
593
                var Offset10 = 100;
594

            
595
            if (alt> 1000)
596
                var Offset100 = 10;
597

            
598
            if (alt> 10000)
599
                var Offset1000 = 10;
600

            
601
            if (!Ne) {
602
                me.screenElements.LintAlt.setTranslation(0,(math.mod(alt,100))*0.57375);
603
                var altCentral = (int(alt/100)*100);
604
            }
605
            elsif (Ne) {
606
                me.screenElements.LintAlt.setTranslation(0,(math.mod(alt,100))*-0.57375);
607
                var altCentral = -(int(alt/100)*100);
608
            }
609
            me.screenElements["AltBigC"].setText("");
610
            me.screenElements["AltSmallC"].setText("");
611
            for (var place = 1; place <= 6; place += 1) {
612
                var altUP = altCentral + (place*100);
613
                var offset = -30.078;
614
                if (altUP < 0) {
615
                    var altUP = -altUP;
616
                    var prefix = "-";
617
                    var offset += 15.039;
618
                }
619
                else
620
                    var prefix = "";
621

            
622
                if (altUP == 0) {
623
                    var AltBigUP    = "";
624
                    var AltSmallUP  = "0";
625

            
626
                }
627
                elsif (math.mod(altUP,500) == 0 and altUP != 0) {
628
                    var AltBigUP    = sprintf(prefix~"%1d", altUP);
629
                    var AltSmallUP  = "";
630
                }
631
                elsif (altUP < 1000 and (math.mod(altUP,500))) {
632
                    var AltBigUP    = "";
633
                    var AltSmallUP  = sprintf(prefix~"%1d", int(math.mod(altUP,1000)));
634
                    var offset = -30.078;
635
                }
636
                elsif ((altUP < 10000) and (altUP >= 1000) and (math.mod(altUP,500))) {
637
                    var AltBigUP    = sprintf(prefix~"%1d", int(altUP/1000));
638
                    var AltSmallUP  = sprintf("%1d", int(math.mod(altUP,1000)));
639
                    var offset += 15.039;
640
                }
641
                else {
642
                    var AltBigUP    = sprintf(prefix~"%1d", int(altUP/1000));
643
                    var mod = int(math.mod(altUP,1000));
644
                    var AltSmallUP  = sprintf("%1d", mod);
645
                    var offset += 30.078;
646
                }
647

            
648
                me.screenElements["AltBigU"~place].setText(AltBigUP);
649
                me.screenElements["AltSmallU"~place].setText(AltSmallUP);
650
                me.screenElements["AltSmallU"~place].setTranslation(offset,0);
651
                var altDOWN = altCentral - (place*100);
652
                var offset = -30.078;
653
                if (altDOWN < 0) {
654
                    var altDOWN = -altDOWN;
655
                    var prefix = "-";
656
                    var offset += 15.039;
657
                }
658
                else
659
                    var prefix = "";
660

            
661
                if (altDOWN == 0) {
662
                    var AltBigDOWN  = "";
663
                    var AltSmallDOWN    = "0";
664
                }
665
                elsif (math.mod(altDOWN,500) == 0 and altDOWN != 0) {
666
                    var AltBigDOWN  = sprintf(prefix~"%1d", altDOWN);
667
                    var AltSmallDOWN    = "";
668
                }
669
                elsif (altDOWN < 1000 and (math.mod(altDOWN,500))) {
670
                    var AltBigDOWN  = "";
671
                    var AltSmallDOWN    = sprintf(prefix~"%1d", int(math.mod(altDOWN,1000)));
672
                    var offset = -30.078;
673
                }
674
                elsif ((altDOWN < 10000) and (altDOWN >= 1000) and (math.mod(altDOWN,500))) {
675
                    var AltBigDOWN  = sprintf(prefix~"%1d", int(altDOWN/1000));
676
                    var AltSmallDOWN    = sprintf("%1d", int(math.mod(altDOWN,1000)));
677
                    var offset += 15.039;
678
                }
679
                else {
680
                    var AltBigDOWN  = sprintf(prefix~"%1d", int(altDOWN/1000));
681
                    var mod = int(math.mod(altDOWN,1000));
682
                    var AltSmallDOWN    = sprintf("%1d", mod);
683
                    var offset += 30.078;
684
                }
685
                me.screenElements["AltBigD"~place].setText(AltBigDOWN);
686
                me.screenElements["AltSmallD"~place].setText(AltSmallDOWN);
687
                me.screenElements["AltSmallD"~place].setTranslation(offset,0);
688
            }
689
        }
adds OAT, TAS, GSPD, WindDat...
Sébastien MARQUE authored on 2017-03-15
690
        me.updateSelectedALT();
trends animation
Sébastien MARQUE authored on 2017-03-13
691
        var now = systime();
692
        # altitude in 6s
693
        var Sy = .3 * (alt - me._last_alt_ft) / (now - me._last_alt_s); # scale = 1/20ft
694
        if (abs(Sy) > 15)
695
            Sy = 15 * abs(Sy)/Sy; # = -15 or 15
696
        me.screenElements['Altitude-Trend-Indicator']
697
            .setScale(1,Sy)
698
            .setTranslation(0, -284.5 * (Sy - 1));
699
        me._last_alt_ft = alt;
700
        me._last_alt_s = now;
adds OAT, TAS, GSPD, WindDat...
Sébastien MARQUE authored on 2017-03-15
701
        settimer(func me.updateALT(), 0.2);
animation ALT
Sébastien MARQUE authored on 2017-03-11
702
    },
trends animation
Sébastien MARQUE authored on 2017-03-13
703
    _last_alt_ft : 0,
704
    _last_alt_s  : systime(),
cosmétique: folding pour les...
Sébastien MARQUE authored on 2017-03-13
705
#}}}
animation HSI
Sébastien MARQUE authored on 2017-03-11
706

            
adds BARO settings
Sébastien MARQUE authored on 2017-03-20
707
    updateBARO : func () {
708
# update BARO widget {{{
709
        var fmt = me._baro_unit == 'inhg' ? '%.2f%s' : '%i%s';
710
        me.screenElements['BARO-text']
711
            .setText(sprintf(fmt,
712
                        getprop('/instrumentation/altimeter/setting-' ~ me._baro_unit),
713
                        me._baro_unit == 'inhg' ? 'in' : 'hPa')
714
                );
715
    },
716
    _baro_unit : 'inhg',
717
#}}}
718

            
adds OAT, TAS, GSPD, WindDat...
Sébastien MARQUE authored on 2017-03-15
719
    updateHSI : func () {
comment on the folds
Sébastien MARQUE authored on 2017-03-13
720
# rotates the compass (PFD) {{{
make some data common to all...
Sébastien MARQUE authored on 2017-04-07
721
        var hdg = data.hdg;
animation HSI
Sébastien MARQUE authored on 2017-03-11
722
        me.screenElements.Rose
723
            .setRotation(-hdg * D2R);
724
        me.screenElements['HDG-text']
725
            .setText(sprintf("%03u°", hdg));
adds OAT, TAS, GSPD, WindDat...
Sébastien MARQUE authored on 2017-03-15
726
        settimer(func me.updateHSI(), 0.1);
animation HSI
Sébastien MARQUE authored on 2017-03-11
727
    },
cosmétique: folding pour les...
Sébastien MARQUE authored on 2017-03-13
728
#}}}
NAV disponible (hors CDI)
Sébastien MARQUE authored on 2017-03-11
729

            
animation HDG bug
Sébastien MARQUE authored on 2017-03-13
730
    updateHDG : func (hdg) {
comment on the folds
Sébastien MARQUE authored on 2017-03-13
731
# moves the heading bug and display heading-deg for 3 seconds (PFD) {{{
animation HDG bug
Sébastien MARQUE authored on 2017-03-13
732
        if (me.role == 'MFD')
733
            return;
734
        me.screenElements['Heading-bug']
735
            .setRotation(hdg * D2R);
736
        me.screenElements['SelectedHDG-bg']
737
            .show();
738
        me.screenElements['SelectedHDG-bgtext']
739
            .show();
740
        me.screenElements['SelectedHDG-text']
741
            .setText(sprintf('%03d°%s', hdg, ''))
742
            .show();
743
        me.addTimer(3, ['SelectedHDG-text', 'SelectedHDG-bgtext', 'SelectedHDG-bg']);
744
    },
cosmétique: folding pour les...
Sébastien MARQUE authored on 2017-03-13
745
#}}}
animation HDG bug
Sébastien MARQUE authored on 2017-03-13
746

            
adds CDI
Sébastien MARQUE authored on 2017-03-18
747
    updateCRS : func () {
anime CRS
Sébastien MARQUE authored on 2017-03-13
748
# TODO: update display for NAV/GPS/BRG courses {{{
749
        if (me.role == 'MFD')
750
            return;
adds CDI
Sébastien MARQUE authored on 2017-03-18
751
        var source = getprop('/instrumentation/zkv1000/cdi/source');
752
        if (source == 'OFF')
753
            return;
754
        var crs = getprop('/instrumentation/zkv1000/cdi/course');
755
        if (crs == nil)
756
            return;
anime CRS
Sébastien MARQUE authored on 2017-03-13
757
        me.screenElements['SelectedCRS-bg']
758
            .show();
759
        me.screenElements['SelectedCRS-bgtext']
760
            .show();
761
        me.screenElements['SelectedCRS-text']
762
            .setText(sprintf('%03d°%s', crs, ''))
adds CDI
Sébastien MARQUE authored on 2017-03-18
763
            .setColor(source == 'GPS' ? me.colors.magenta : me.colors.green)
anime CRS
Sébastien MARQUE authored on 2017-03-13
764
            .show();
765
        me.addTimer(3, ['SelectedCRS-text', 'SelectedCRS-bgtext', 'SelectedCRS-bg']);
766
    },
767
#}}}
768

            
adds OAT, TAS, GSPD, WindDat...
Sébastien MARQUE authored on 2017-03-15
769
    updateSelectedALT : func {
770
# animation for altitude section, called via updatedALT {{{
creates flightdeck hash to p...
Sébastien MARQUE authored on 2017-04-07
771
        if (! me.screenElements['SelectedALT'].getVisible())
fix Selected Altitude displa...
Sébastien MARQUE authored on 2017-03-18
772
            return;
adds OAT, TAS, GSPD, WindDat...
Sébastien MARQUE authored on 2017-03-15
773
        var selected_alt = getprop('/instrumentation/zkv1000/afcs/selected-alt-ft');
make some data common to all...
Sébastien MARQUE authored on 2017-04-07
774
        var delta_alt = data.alt - selected_alt;
adds OAT, TAS, GSPD, WindDat...
Sébastien MARQUE authored on 2017-03-15
775
        if (abs(delta_alt) > 300)
776
            delta_alt = 300 * abs(delta_alt)/delta_alt;
fix Selected Altitude displa...
Sébastien MARQUE authored on 2017-03-18
777
        me.screenElements['SelectedALT-symbol']
778
            .setVisible(abs(delta_alt) > 100);
779
        me.screenElements['SelectedALT-bg']
780
            .setVisible(abs(delta_alt) > 100);
781
        me.screenElements['SelectedALT-text']
782
            .setText(sprintf("%i", selected_alt))
adds OAT, TAS, GSPD, WindDat...
Sébastien MARQUE authored on 2017-03-15
783
            .setVisible(abs(delta_alt) > 100);
fix Selected Altitude displa...
Sébastien MARQUE authored on 2017-03-18
784
        me.screenElements['SelectedALT-bug']
adds OAT, TAS, GSPD, WindDat...
Sébastien MARQUE authored on 2017-03-15
785
            .setTranslation(0, delta_alt * 0.567); # 170/300 = 0.567
786
    },
787
#}}}
788

            
adds CDI
Sébastien MARQUE authored on 2017-03-18
789
    updateCDI : func {
790
# animation for CDI {{{
791
        var source = getprop('/instrumentation/zkv1000/cdi/source');
792
        if (source == 'OFF') {
793
            foreach (var s; ['GPS', 'NAV1', 'NAV2'])
794
                foreach (var t; ['pointer', 'CDI'])
795
                    me.screenElements[s ~ '-' ~ t].hide();
796
            me.screenElements['CDI-GPS-ANN-text'].hide();
797
            me.screenElements['CDI-GPS-XTK-text'].hide();
798
            me.screenElements['CDI-SRC-text'].hide();
799
            me.screenElements['CDI'].hide();
800
        }
801
        else {
802
            var course = getprop('/instrumentation/zkv1000/cdi/course');
make some data common to all...
Sébastien MARQUE authored on 2017-04-07
803
            var rot = (course - data.hdg) * D2R;
adds CDI
Sébastien MARQUE authored on 2017-03-18
804
            me.screenElements['CDI']
makes the CDI available
Sébastien MARQUE authored on 2017-03-23
805
                .setRotation(rot)
adds CDI
Sébastien MARQUE authored on 2017-03-18
806
                .show();
807
            me.screenElements['GPS-CTI']
animates GPS-CTI
Sébastien MARQUE authored on 2017-03-24
808
                .setVisible(getprop('/instrumentation/gps/wp/wp[1]/valid'))
809
                .setRotation(getprop('/instrumentation/gps/wp/wp[1]/course-deviation-deg') * D2R);
adds CDI
Sébastien MARQUE authored on 2017-03-18
810
            me.screenElements['GPS-CTI-diamond']
animates GPS-CTI
Sébastien MARQUE authored on 2017-03-24
811
                .setVisible(getprop('/instrumentation/gps/wp/wp[1]/valid'))
812
                .setRotation(getprop('/instrumentation/gps/wp/wp[1]/course-deviation-deg') * D2R);
adds CDI
Sébastien MARQUE authored on 2017-03-18
813
            foreach (var s; ['GPS', 'NAV1', 'NAV2']) {
814
                me.screenElements[s ~ '-pointer']
815
                    .setRotation(rot)
816
                    .setVisible(source == s);
817
                me.screenElements[s ~ '-CDI']
818
                    .setVisible(source == s);
819
                foreach (var f; ['FROM', 'TO'])
820
                    me.screenElements[s ~ '-' ~ f]
makes the CDI available
Sébastien MARQUE authored on 2017-03-23
821
                        .setVisible(s == source and getprop('/instrumentation/zkv1000/cdi/' ~ f ~ '-flag'));
adds CDI
Sébastien MARQUE authored on 2017-03-18
822
                me.screenElements['CDI-SRC-text']
823
                    .setText(source)
824
                    .setColor(source == 'GPS' ? me.colors.magenta : me.colors.green)
825
                    .show();
826
            }
makes the CDI available
Sébastien MARQUE authored on 2017-03-23
827
            var deflection = getprop('/instrumentation/zkv1000/cdi/course-deflection');
828
            if (left(source, 3) == 'NAV')
829
                var scale = deflection / 4;
830
            else { # GPS
831
                # TODO: deviation depending of the flight phase
832
                # for now fixed 1 dot = 1 nm course error
833
                var abs_deflection = abs(deflection);
834
                me.screenElements['CDI-GPS-XTK-text']
835
                    .setText(sprintf('XTK %iNM', abs_deflection))
836
                    .setVisible(abs_deflection > 2.4);
837
                var scale = deflection / 2;
838
            }
839
            scale = (abs(scale) > 1.2) ? 1.2 : scale;
840
            me.screenElements[source ~ '-CDI']
841
                .setTranslation(65 * scale, 0);
842
            settimer(func me.updateCDI(), 0.3);
adds CDI
Sébastien MARQUE authored on 2017-03-18
843
        }
844
    },
845
#}}}
846

            
ajout COMM, et factorisation...
Sébastien MARQUE authored on 2017-03-12
847
    _updateRadio: func {
comment on the folds
Sébastien MARQUE authored on 2017-03-13
848
# common parts for NAV/LOC/COMM radios{{{
ajout COMM, et factorisation...
Sébastien MARQUE authored on 2017-03-12
849
        # arg[0]._r = <comm|nav>
850
        if (contains(arg[0], "active")) {
851
            if (arg[0]['active'] == 'none') {
852
                me.screenElements[arg[0]._r ~ '1-selected-freq']
853
                    .setColor(1,1,1);
854
                me.screenElements[arg[0]._r ~ '2-selected-freq']
855
                    .setColor(1,1,1);
856
            }
857
            else {
858
                me.screenElements[arg[0]._r ~ arg[0]['active'] ~ '-selected-freq']
859
                    .setColor(0,1,0);
860
                me.screenElements[arg[0]._r ~ arg[0].inactive ~ '-selected-freq']
861
                    .setColor(1,1,1);
862
            }
863
        }
864
        if (contains(arg[0], 'tune')) {
865
            # n = 0 -> NAV1/COMM1
866
            # n = 1 -> NAV1/COMM2
867
            me.screenElements[arg[0]._r ~ '-freq-switch']
868
                .setTranslation(0, arg[0].tune * 25);
869
            me.screenElements[arg[0]._r ~ (arg[0].tune + 1) ~ '-standby-freq']
870
                .setColor(0,1,1);
871
            me.screenElements[arg[0]._r ~ ((arg[0].tune == 0) + 1) ~ '-standby-freq']
872
                .setColor(1,1,1);
873
        }
874
        if (contains(arg[0], 'refresh')) {
small stuff
Sébastien MARQUE authored on 2017-03-22
875
            # refresh only one line: NAV1/COMM1 or NAV2/COMM2
ajout COMM, et factorisation...
Sébastien MARQUE authored on 2017-03-12
876
            var fmt = (arg[0]._r == 'nav') ? '%.2f' : '%.3f';
877
            me.screenElements[arg[0]._r ~ arg[0].refresh ~ '-selected-freq']
878
                .setText(sprintf(fmt, getprop('/instrumentation/'
879
                               ~ arg[0]._r ~ '[' ~ (arg[0].refresh - 1) ~ ']/frequencies/selected-mhz')));
880
            me.screenElements[arg[0]._r ~ arg[0].refresh ~ '-standby-freq']
881
                .setText(sprintf(fmt, getprop('/instrumentation/'
882
                               ~ arg[0]._r ~ '[' ~ (arg[0].refresh - 1) ~ ']/frequencies/standby-mhz')));
883
        }
884
        if (contains(arg[0], 'set')) {
885
            # positionne la valeur modifiée, les listeners "trigguent" en permanence ces propriétés, donc exit
886
            var n = getprop('/instrumentation/zkv1000/radios/' ~ arg[0]._r ~ '-tune');
887
            var fmt = (arg[0]._r == 'nav') ? '%.2f' : '%.3f';
888
            me.screenElements[arg[0]._r ~ (n + 1) ~ '-standby-freq']
fix freq display while setti...
Sébastien MARQUE authored on 2017-03-16
889
                .setText(sprintf(fmt, getprop('/instrumentation/' ~ arg[0]._r ~ '[' ~ n ~ ']/frequencies/standby-mhz')));
ajout COMM, et factorisation...
Sébastien MARQUE authored on 2017-03-12
890
        }
891
        if (contains(arg[0], 'auto')) {
892
            # pour rafraichir automagiquement, toutes les deux secondes un refresh pour un NAV
893
            var radio = arg[0].auto;
894
            me._updateRadio({refresh: 1, _r: radio});
895
            settimer(func me._updateRadio({refresh: 2, _r: radio}), 1);
896
            settimer(func me._updateRadio({auto: radio}), 2);
897
        }
898
    },
cosmétique: folding pour les...
Sébastien MARQUE authored on 2017-03-13
899
#}}}
ajout COMM, et factorisation...
Sébastien MARQUE authored on 2017-03-12
900

            
NAV disponible (hors CDI)
Sébastien MARQUE authored on 2017-03-11
901
    updateNAV : func {
comment on the folds
Sébastien MARQUE authored on 2017-03-13
902
# update NAV/LOC rodios display upper left (PFD/MFD){{{
NAV disponible (hors CDI)
Sébastien MARQUE authored on 2017-03-11
903
        # made active via menu
904
        if (contains(arg[0], "active")) {
adds CDI
Sébastien MARQUE authored on 2017-03-18
905
            arg[0]._r = 'nav';
NAV disponible (hors CDI)
Sébastien MARQUE authored on 2017-03-11
906
            if (arg[0]['active'] == 'none') {
ajout COMM, et factorisation...
Sébastien MARQUE authored on 2017-03-12
907
                me._updateRadio(arg[0]);
NAV disponible (hors CDI)
Sébastien MARQUE authored on 2017-03-11
908
                me.screenElements['nav1-id']
909
                    .setColor(1,1,1);
910
                me.screenElements['nav2-id']
911
                    .setColor(1,1,1);
912
                me.screenElements['NAV1-pointer']
913
                    .hide();
914
                me.screenElements['NAV2-pointer']
915
                    .hide();
916
            }
917
            else {
ajout COMM, et factorisation...
Sébastien MARQUE authored on 2017-03-12
918
                arg[0].inactive = (arg[0]['active'] == 1) + 1;
919
                me._updateRadio(arg[0]);
NAV disponible (hors CDI)
Sébastien MARQUE authored on 2017-03-11
920
                me.screenElements['nav' ~ arg[0]['active'] ~ '-id']
921
                    .setColor(0,1,0);
922
                me.screenElements['NAV' ~ arg[0]['active'] ~ '-pointer']
923
                    .show();
ajout COMM, et factorisation...
Sébastien MARQUE authored on 2017-03-12
924
                me.screenElements['nav' ~ arg[0].inactive ~ '-id']
925
                    .setColor(1,1,1);
NAV disponible (hors CDI)
Sébastien MARQUE authored on 2017-03-11
926
#                me.screenElements['HDI']
927
#                    .setRotation();
928
#                me.screenElements['NAV' ~ inactive ~ '-pointer']
929
#                    .hide();
930
#                foreach (var e; [ 'FROM', 'TO', 'CDI' ])
931
#                    me.screenElements['NAV' ~ inactive ~ '-' ~ e]
932
#                        .hide();
933
            }
934
        }
ajout COMM, et factorisation...
Sébastien MARQUE authored on 2017-03-12
935
        elsif (contains(arg[0], 'nav-id')) {
Correction swap NAV tuning
Sébastien MARQUE authored on 2017-03-12
936
            # TODO: récupérer la valeur via les paramètres transmis du listener
ajout COMM, et factorisation...
Sébastien MARQUE authored on 2017-03-12
937
            if (arg[0].val == nil)
938
                arg[0].val = '';
NAV disponible (hors CDI)
Sébastien MARQUE authored on 2017-03-11
939
            me.screenElements["nav" ~ arg[0]['nav-id'] ~ "-id"]
ajout COMM, et factorisation...
Sébastien MARQUE authored on 2017-03-12
940
                    .setText(arg[0].val);
NAV disponible (hors CDI)
Sébastien MARQUE authored on 2017-03-11
941
        }
ajout COMM, et factorisation...
Sébastien MARQUE authored on 2017-03-12
942
        else {
943
            arg[0]._r = 'nav';
944
            me._updateRadio(arg[0]);
NAV disponible (hors CDI)
Sébastien MARQUE authored on 2017-03-11
945
        }
946
    },
cosmétique: folding pour les...
Sébastien MARQUE authored on 2017-03-13
947
#}}}
ajout COMM, et factorisation...
Sébastien MARQUE authored on 2017-03-12
948

            
949
    updateCOMM: func {
comment on the folds
Sébastien MARQUE authored on 2017-03-13
950
# update COMM radios display upper right (PFD/MFD){{{
ajout COMM, et factorisation...
Sébastien MARQUE authored on 2017-03-12
951
        arg[0]._r = 'comm';
952
        me._updateRadio(arg[0]);
953
    },
cosmétique: folding pour les...
Sébastien MARQUE authored on 2017-03-13
954
#}}}
anime time display
Sébastien MARQUE authored on 2017-03-13
955

            
956
    updateTIME : func {
957
# updates the displayed time botoom left {{{
958
        me.screenElements['TIME-text']
959
            .setText(getprop('/sim/time/gmt-string'));
960
        settimer(func me.updateTIME(), 1);
961
    },
962
#}}}
adds OAT, TAS, GSPD, WindDat...
Sébastien MARQUE authored on 2017-03-15
963

            
adds transponder
Sébastien MARQUE authored on 2017-03-17
964
    updateXPDR : func {
965
# updates transponder display {{{
966
        for (var d = 0; d < 4; d+=1)
967
            me.screenElements['XPDR-DIGIT-' ~ d ~ '-text']
968
                .setText(sprintf('%i', getprop('/instrumentation/transponder/inputs/digit[' ~ d ~ ']')));
969
        var tuning = getprop('/instrumentation/zkv1000/radios/xpdr-tuning-digit');
XPDR settings via knob or so...
Sébastien MARQUE authored on 2017-03-22
970
        var fms = getprop('/instrumentation/zkv1000/radios/xpdr-tuning-fms-method');
971
        for (var d = 0; d < 4; d+=1)
972
            me.screenElements['XPDR-DIGIT-' ~ d ~ '-text']
973
                .setColor(1,1,1);
974
        if (tuning != nil) {
975
            me.screenElements['XPDR-DIGIT-' ~ tuning ~ '-text']
976
                .setColor(0,1,1);
977
            if (fms)
978
                me.screenElements['XPDR-DIGIT-' ~ (tuning - 1) ~ '-text']
979
                    .setColor(0,1,1);
980
        }
adds transponder
Sébastien MARQUE authored on 2017-03-17
981
        else {
982
            if (getprop('/instrumentation/transponder/ident'))
983
                var mode = 'IDENT';
984
            else
985
                var mode = getprop('/instrumentation/zkv1000/radio/xpdr-mode');
986
            var wow = getprop('/gear/gear/wow');
987
            if (! wow and mode != 'STBY')
988
                var color = [0, 1, 0];
989
            else
990
                var color = [1, 1, 1];
991
            for (var d = 0; d < 4; d+=1)
992
                me.screenElements['XPDR-DIGIT-' ~ d ~ '-text']
993
                    .setColor(color);
994
            me.screenElements['XPDR-MODE-text']
995
                .setColor(color)
996
                .setText(mode);
997
        }
XPDR settings via knob or so...
Sébastien MARQUE authored on 2017-03-22
998
    },
adds transponder
Sébastien MARQUE authored on 2017-03-17
999
#}}}
1000

            
adds OAT, TAS, GSPD, WindDat...
Sébastien MARQUE authored on 2017-03-15
1001
    updateOAT : func {
1002
# update OAT display on normal and reversionnary modes (every 3s) {{{
1003
        var tmp = getprop('/environment/temperature-deg' ~ me._oat_unit);
1004
        me.screenElements['OAT-text']
1005
            .setText(sprintf((abs(tmp) < 10) ? "%.1f %s" : "%i %s", tmp, (me._oat_unit == 'c') ? '°C' : 'F'));
1006
        settimer(func me.updateOAT(), 3);
1007
    },
1008
    _oat_unit : 'c',
1009
#}}}
1010

            
1011
    updateWindData : func {
1012
# update the window text and arrows for OPTN1/2 {{{
1013
        if (me._winddata_optn == 0)
1014
            return;
make some data common to all...
Sébastien MARQUE authored on 2017-04-07
1015
        if (data.ias < 30) {
improves WindData display
Sébastien MARQUE authored on 2017-03-16
1016
            me.screenElements['WindData-NODATA']
1017
                .hide();
1018
            var wind_hdg = getprop('/environment/wind-from-heading-deg');
1019
            var wind_spd = getprop('/environment/wind-speed-kt');
make some data common to all...
Sébastien MARQUE authored on 2017-04-07
1020
            var alpha = wind_hdg - data.hdg;
improves WindData display
Sébastien MARQUE authored on 2017-03-16
1021
            if (me._winddata_optn == 1) {
1022
                me.screenElements['WindData-OPTN1-HDG']
1023
                    .setRotation((alpha + 180) * D2R)
1024
                    .show();
1025
                me.screenElements['WindData-OPTN1-HDG-text']
1026
                    .setText(sprintf("%03i°", wind_hdg))
1027
                    .show();
1028
                me.screenElements['WindData-OPTN1-SPD-text']
1029
                    .setText(int(wind_spd) ~ 'KT')
1030
                    .show();
adds OAT, TAS, GSPD, WindDat...
Sébastien MARQUE authored on 2017-03-15
1031
            }
improves WindData display
Sébastien MARQUE authored on 2017-03-16
1032
            else { # me._winddata_optn == 2
1033
                alpha *= D2R;
1034
                var Vt = wind_spd * math.sin(alpha);
1035
                var Ve = wind_spd * math.cos(alpha);
1036
                if (Vt != 0) {
1037
                    me.screenElements['WindData-OPTN2-crosswind-text']
1038
                        .setText(sprintf('%i', abs(Vt)))
1039
                        .show();
1040
                    me.screenElements['WindData-OPTN2-crosswind']
1041
                        .setScale(-abs(Vt)/Vt, 1)
1042
                        .setTranslation(-35 * (abs(Vt)/Vt + 1), 0)
1043
                        .show();
1044
                }
1045
                if (Ve != 0) {
1046
                    me.screenElements['WindData-OPTN2-headwind-text']
1047
                        .setText(sprintf('%i', abs(Ve)))
1048
                        .show();
1049
                    me.screenElements['WindData-OPTN2-headwind']
1050
                        .setScale(1, abs(Ve)/Ve)
1051
                        .setTranslation(0, 515 * (1 - abs(Ve)/Ve))
1052
                        .show();
1053
                }
adds OAT, TAS, GSPD, WindDat...
Sébastien MARQUE authored on 2017-03-15
1054
            }
1055
        }
improves WindData display
Sébastien MARQUE authored on 2017-03-16
1056
        else {
1057
            foreach (var e; [
1058
                    'WindData-OPTN1-HDG',
1059
                    'WindData-OPTN1-HDG-text',
1060
                    'WindData-OPTN1-SPD-text',
1061
                    'WindData-OPTN2-crosswind-text',
1062
                    'WindData-OPTN2-crosswind',
1063
                    'WindData-OPTN2-headwind-text',
1064
                    'WindData-OPTN2-headwind'
1065
            ])
1066
                me.screenElements[e].hide();
1067
            me.screenElements['WindData-NODATA'].show();
1068
        }
adds OAT, TAS, GSPD, WindDat...
Sébastien MARQUE authored on 2017-03-15
1069
        settimer(func me.updateWindData(), 0.5);
1070
    },
1071
    _winddata_optn : 0,
1072
#}}}
adds BRG1/2 animation
Sébastien MARQUE authored on 2017-03-16
1073

            
1074
    updateBRG : func {
some added comments
Sébastien MARQUE authored on 2017-03-18
1075
# displays and update BRG1/2 {{{
adds BRG1/2 animation
Sébastien MARQUE authored on 2017-03-16
1076
        foreach (var brg; [1, 2]) {
1077
            var source = 'brg' ~ brg ~ '-source';
1078

            
1079
            var dev = radios.getNode(source).getValue();
1080
            var el  = 'BRG' ~ brg;
1081
            if (dev != 'OFF') {
colorize BRG1/2 when needed,...
Sébastien MARQUE authored on 2017-03-21
1082
                if (size(me.device.softkeys.path) == 1 and me.device.softkeys.path[0] == 'PFD')
1083
                    me.setSoftKeyColor(brg == 1 ? 4 : 6, 1);
1084
                else
1085
                    me.setSoftKeyColor(brg == 1 ? 4 : 6, 0);
adds BRG1/2 animation
Sébastien MARQUE authored on 2017-03-16
1086
                var info = {
1087
                    pointer : nil,
1088
                    id : 'NO DATA',
1089
                    hdg : nil,
1090
                    dst : '--.-NM'
1091
                };
1092
                if (left(dev, 3) == 'NAV') {
1093
                    info.pointer = getprop('/instrumentation/nav[' ~ (brg - 1) ~ ']/in-range');
1094
                    if (info.pointer) {
1095
                        info.id  = getprop('/instrumentation/nav[' ~ (brg - 1) ~ ']/nav-id');
1096
                        info.hdg = getprop('/instrumentation/nav[' ~ (brg - 1) ~ ']/heading-deg');
1097
                        info.dst = sprintf('%.1d', getprop('/instrumentation/nav[' ~ (brg - 1) ~ ']/nav-distance') / 1852); # m -> /1852
1098
                    }
1099
                }
1100
                elsif (dev == 'GPS') {
1101
                    info.pointer = props.getNode('/instrumentation/gps/wp').getChild('wp[1])');
1102
                    if (info.pointer) {
1103
                        info.id  = getprop('/instrumentation/gps/wp/wp[1]/ID');
1104
                        info.hdg = getprop('/instrumentation/gps/wp/wp[1]/bearing-mag-deg');
1105
                        info.dst = sprintf('%.1d', getprop('/instrumentation/gps/wp/wp[1]/distance-nm'));
1106
                    }
1107
                }
1108
                else { # there are 2 available ADF in FG, but instrument manage only 1
1109
                    info.pointer = getprop('/instrumentation/adf/in-range');
1110
                    if (info.pointer) {
1111
                        info.id  = getprop('/instrumentation/adf/ident');
1112
                        info.hdg = getprop('/instrumentation/adf/indicated-bearing-deg');
1113
                    }
1114
                }
1115

            
1116
                if (info.pointer)
1117
                    me.screenElements[el ~ '-pointer']
make some data common to all...
Sébastien MARQUE authored on 2017-04-07
1118
                        .setRotation(-info.hdg - data.hdg * D2R)
adds BRG1/2 animation
Sébastien MARQUE authored on 2017-03-16
1119
                        .show();
1120
                else
1121
                    me.screenElements[el ~ '-pointer']
1122
                        .hide();
1123
                me.screenElements[el ~ '-SRC-text']
1124
                    .setText(dev);
1125
                me.screenElements[el ~ '-DST-text']
1126
                    .setText(info.dst);
1127
                me.screenElements[el ~ '-WPID-text']
1128
                    .setText(info.id);
1129
                me.screenElements['BRG' ~ brg]
1130
                    .show();
1131
            }
1132
            else {
colorize BRG1/2 when needed,...
Sébastien MARQUE authored on 2017-03-21
1133
                me.setSoftKeyColor(brg == 1 ? 4 : 6, 0);
adds BRG1/2 animation
Sébastien MARQUE authored on 2017-03-16
1134
                me.screenElements['BRG' ~ brg]
1135
                    .hide();
1136
            }
1137
        }
colorize BRG1/2 when needed,...
Sébastien MARQUE authored on 2017-03-21
1138
        settimer(func me.updateBRG(), 0.5);
adds BRG1/2 animation
Sébastien MARQUE authored on 2017-03-16
1139
    },
some added comments
Sébastien MARQUE authored on 2017-03-18
1140
#}}}
softkeys are available now
Sébastien MARQUE authored on 2017-03-14
1141

            
adds OMI to PFD
Sébastien MARQUE authored on 2017-03-23
1142
    updateOMI : func {
1143
# display marker baecon Outer, Middle, Inner {{{
1144
        var marker = nil;
1145
        foreach (var m; ['outer', 'middle', 'inner'])
1146
            if (getprop('/instrumentation/marker-beacon/' ~ m)) {
1147
                marker = m;
1148
                me.screenElements['OMI']
1149
                    .show();
1150
                break;
1151
            }
1152
        if (marker != nil) {
1153
            me.screenElements['MarkerText']
1154
                .setText(me._omi_data[marker].t)
1155
                .show();
1156
            me.screenElements['MarkerBG']
1157
                .setColorFill(me._omi_data[marker].bg)
1158
                .show();
1159
        }
1160
        else
1161
            me.screenElements['OMI']
1162
                .hide();
1163
        settimer(func me.updateOMI(), 1);
1164
    },
1165
    _omi_data : {
1166
        'outer':  {t: 'O', bg: [0,1,1]},
1167
        'middle': {t: 'M', bg: [1,1,1]},
1168
        'inner':  {t: 'I', bg: [1,1,0]},
1169
    },
1170
#}}}
animation texts EIS + power ...
Sébastien MARQUE authored on 2017-03-19
1171
};
1172

            
softkeys are available now
Sébastien MARQUE authored on 2017-03-14
1173
var keyMap = {
add new vim folds
Sébastien MARQUE authored on 2017-03-15
1174
# softkeys map for PFD and MFD {{{
softkeys are available now
Sébastien MARQUE authored on 2017-03-14
1175
    PFD : {
1176
        first : 1,
1177
        texts : ['INSET', 'SENSOR', 'PFD', 'OBS', 'CDI', 'DME', 'XPDR', 'IDENT', 'TMR/REF', 'NRST' ],
1178
        INSET : {
1179
            texts : ['OFF', 'DCLTR', 'WXLGND', 'TRAFFIC', 'TOPO', 'TERRAIN', 'STRMSCP', 'NEXRAD-C', 'XM LTNG', 'METAR'],
1180
        },
1181
        SENSOR : {
1182
            first : 2,
1183
            texts : [ 'ADC1', 'ADC2', '', 'AHRS1', 'AHRS2'],
1184
        },
1185
        PFD : {
adds BRG1/2 animation
Sébastien MARQUE authored on 2017-03-16
1186
            texts : [ 'SYN VIS', 'DFLTS', 'AOA/WIND', 'DME', 'BRG1', 'HSI FMT', 'BRG2', '', 'ALT UNIT', 'STD BARO' ],
softkeys are available now
Sébastien MARQUE authored on 2017-03-14
1187
            'SYN VIS' : {
1188
                texts : [ 'PATHWAY', 'SYN TERR', 'HR2NHDG', 'APTSIGNS', 'FPM'],
1189
            },
1190
            'AOA/WIND' : {
1191
                first : 4,
1192
                texts : ['AOA', 'WIND'],
1193
                AOA : {
1194
                    first : 5,
1195
                    texts : ['AOA ON', 'AOA AUTO'],
1196
                },
1197
                WIND : {
1198
                    first : 2,
1199
                    texts : ['OPTN1', 'OPTN2', '', 'OFF'],
1200
                },
1201
            },
1202
            'HSI FMT' : {
1203
                first : 6,
1204
                texts : ['360 HSI', 'ARC HSI'],
1205
            },
1206
            'ALT UNIT' : {
1207
                first : 5,
1208
                texts : ['METERS', '', 'IN', 'HPA'],
1209
            },
1210
        },
1211
        XPDR : {
1212
            first : 2,
1213
            texts : ['STBY', 'ON', 'ALT', '', 'VFR', 'CODE', 'IDENT'],
1214
            CODE : {
1215
                texts : ['0', '1', '2', '3', '4', '5', '6', '7', 'IDENT', 'BKSP'],
1216
            },
1217
        },
1218
    },
1219
    MFD : {
1220
        texts : ['ENGINE', '', 'MAP', '', '', '', '', '', '', 'DCLTR', 'SHW CHRT', 'CHKLIST'],
1221
        MAP : {
1222
            texts: ['TRAFFIC', 'PROFILE', 'TOPO', 'TERRAIN', 'AIRWAYS', 'STRMSCP','NEXRAD-C', 'XM LTNG', 'METAR', 'LEGEND', 'BACK'],
1223
        },
1224
        CHKLIST : {
1225
            texts : ['ENGINE', '', '', '', '', 'DONE', '', '', '', '', 'EXIT', 'EMERGCY'],
1226
        },
1227
        ENGINE : {
1228
            texts : ['ENGINE', 'ANTI-ICE', '', 'DCLTR', '', 'ASSIST', '', '', '', '', 'FUEL'],
1229
            'ANTI-ICE' : {
1230
                texts : ['LEFT', 'AUTO', 'RIGHT', '', '', '', '', '', '', '', '', 'BACK'],
1231
            },
1232
            FUEL : {
1233
                first : 1,
1234
                texts : ['FULL', 'TABS', '', '', '', '', '', '', '', 'UNDO', 'ENTER'],
1235
            },
1236
        },
1237
    },
1238
};
add new vim folds
Sébastien MARQUE authored on 2017-03-15
1239
#}}}