zkv1000 / Nasal / core.nas /
Newer Older
91 lines | 3.69kb
NAV disponible (hors CDI)
Sébastien MARQUE authored on 2017-03-11
1
var setListeners = func {
2
    setlistener('/instrumentation/nav/nav-id',
correction listeners
Sébastien MARQUE authored on 2017-03-12
3
            func (n) {
4
                var val = n.getValue();
creates flightdeck hash to p...
Sébastien MARQUE authored on 2017-04-07
5
                foreach (var c; keys(flightdeck))
removes unecessary listeners
Sébastien MARQUE authored on 2017-04-08
6
                    flightdeck[c].display.updateNAV({'nav-id': 1, val: val});
NAV disponible (hors CDI)
Sébastien MARQUE authored on 2017-03-11
7
            }, 1, 2);
8
    setlistener('/instrumentation/nav[1]/nav-id',
correction listeners
Sébastien MARQUE authored on 2017-03-12
9
            func (n) {
10
                var val = n.getValue();
creates flightdeck hash to p...
Sébastien MARQUE authored on 2017-04-07
11
                foreach (var c; keys(flightdeck))
removes unecessary listeners
Sébastien MARQUE authored on 2017-04-08
12
                    flightdeck[c].display.updateNAV({'nav-id': 2, val: val});
NAV disponible (hors CDI)
Sébastien MARQUE authored on 2017-03-11
13
            }, 1, 2);
removes unecessary listeners
Sébastien MARQUE authored on 2017-04-08
14
   # keep this listener as long as the code is to heavy to be modified in multiple places
adds OAT, TAS, GSPD, WindDat...
Sébastien MARQUE authored on 2017-03-15
15
    setlistener('/instrumentation/zkv1000/afcs/selected-alt-ft',
16
            func (n) {
17
                var val = n.getValue();
creates flightdeck hash to p...
Sébastien MARQUE authored on 2017-04-07
18
                if (val != nil)
19
                    foreach (var c; keys(flightdeck))
removes unecessary listeners
Sébastien MARQUE authored on 2017-04-08
20
                        if (flightdeck[c].role == 'PFD') {
creates flightdeck hash to p...
Sébastien MARQUE authored on 2017-04-07
21
                            if (! flightdeck[c].display.screenElements['SelectedALT'].getVisible()) {
22
                                flightdeck[c].display.screenElements['SelectedALT'].show();
23
                                flightdeck[c].display.screenElements['SelectedALT-text'].show();
24
                                flightdeck[c].display.screenElements['SelectedALT-symbol'].show();
25
                                flightdeck[c].display.screenElements['SelectedALT-bug'].show();
26
                                flightdeck[c].display.screenElements['SelectedALT-bg'].show();
27
                            }
28
                            flightdeck[c].display.updateSelectedALT();
29
                        }
adds OAT, TAS, GSPD, WindDat...
Sébastien MARQUE authored on 2017-03-15
30
            }, 0, 2);
adds transponder
Sébastien MARQUE authored on 2017-03-17
31
    setlistener('/gear/gear/wow',
creates flightdeck hash to p...
Sébastien MARQUE authored on 2017-04-07
32
            func foreach (var c; keys(flightdeck))
removes unecessary listeners
Sébastien MARQUE authored on 2017-04-08
33
                if (flightdeck[c].role == 'PFD')
creates flightdeck hash to p...
Sébastien MARQUE authored on 2017-04-07
34
                    flightdeck[c].display.updateXPDR(),
adds transponder
Sébastien MARQUE authored on 2017-03-17
35
            0, 0);
adds BARO settings
Sébastien MARQUE authored on 2017-03-20
36
    setlistener('/instrumentation/altimeter/setting-inhg',
creates flightdeck hash to p...
Sébastien MARQUE authored on 2017-04-07
37
            func foreach (var c; keys(flightdeck))
removes unecessary listeners
Sébastien MARQUE authored on 2017-04-08
38
                if (flightdeck[c].role == 'PFD')
creates flightdeck hash to p...
Sébastien MARQUE authored on 2017-04-07
39
                    flightdeck[c].display.updateBARO(), 0, 2);
NAV disponible (hors CDI)
Sébastien MARQUE authored on 2017-03-11
40
}
41

            
commit initial
Sébastien MARQUE authored on 2017-03-07
42
var deviceClass = {
improves role/name variables...
Sébastien MARQUE authored on 2017-04-08
43
    new: func (name) {
commit initial
Sébastien MARQUE authored on 2017-03-07
44
        var m = { parents: [ deviceClass ] };
improves role/name variables...
Sébastien MARQUE authored on 2017-04-08
45
        m.name = name;
46
        m.role = substr(name, 0, 3);
47
        m.node = zkv.getNode(name, 1);
add V-speeds bugs
Sébastien MARQUE authored on 2017-04-04
48
        m.data = {};
put Vspeeds in common data s...
Sébastien MARQUE authored on 2017-04-11
49
        foreach (var v; ['Vx', 'Vy', 'Vr', 'Vglide'])
add V-speeds bugs
Sébastien MARQUE authored on 2017-04-04
50
            m.data[v ~ '-visible'] = 1;
configurable display size, v...
Sébastien MARQUE authored on 2017-04-15
51
        foreach (var v; ['screen-object', 'screen-view', 'screen-size'])
52
            m.data[v] = getprop('/instrumentation/zkv1000/' ~ name ~ '/' ~ v);
improves role/name variables...
Sébastien MARQUE authored on 2017-04-08
53
        m.display  = displayClass.new(m);
54
        m.display.showInitProgress(m.name);
55
        m.softkeys = softkeysClass.new(m);
56
        m.buttons  = buttonsClass.new(m);
XPDR settings via knob or so...
Sébastien MARQUE authored on 2017-03-22
57
        m.knobs    = knobsClass.new(m);
commit initial
Sébastien MARQUE authored on 2017-03-07
58
        m.display.loadsvg();
AI disponible
Sébastien MARQUE authored on 2017-03-10
59
        m.display.loadGroup({
60
            hide : [
commit initial
Sébastien MARQUE authored on 2017-03-07
61
                'Failures',
62
                'SoftKeysTexts',
63
                'PFD-Widgets', 
64
                'COMM',
65
                'XPDR-TIME', 
66
                'NAV',
67
                'FlightInstruments', 
68
                'VDI',
69
                'OMI',
AI disponible
Sébastien MARQUE authored on 2017-03-10
70
            ],
71
            clip : 'PitchScale',
72
        });
TMR/REF window
Sébastien MARQUE authored on 2017-03-28
73
        m.windows  = pageClass.new(m);
improves role/name variables...
Sébastien MARQUE authored on 2017-04-08
74
        zkv.getNode(m.name ~ '-init').setIntValue(0);
75
        setprop('/instrumentation/zkv1000/' ~ m.name ~ '/status', 1);
76
        msg(m.name ~ ' switched on!');
commit initial
Sébastien MARQUE authored on 2017-03-07
77
        return m;
78
    },
79
};
80

            
PFD+MFD allumés ensemble
Sébastien MARQUE authored on 2017-03-11
81
var powerOn = func {
global timers started at pow...
Sébastien MARQUE authored on 2017-04-12
82
    foreach (var freq; keys(data.timers))
83
        data.timers[freq].start();
84

            
improves role/name variables...
Sébastien MARQUE authored on 2017-04-08
85
    foreach (var name; keys(flightdeck))
86
        if (zkv.getNode(name) != nil)
new var organistaion (and fi...
Sébastien MARQUE authored on 2017-03-26
87
#            thread.newthread(func {
improves role/name variables...
Sébastien MARQUE authored on 2017-04-08
88
                flightdeck[name] = deviceClass.new(name);
new var organistaion (and fi...
Sébastien MARQUE authored on 2017-03-26
89
#            });
correction listeners
Sébastien MARQUE authored on 2017-03-12
90
    settimer(setListeners, 5);
commit initial
Sébastien MARQUE authored on 2017-03-07
91
}