zkv1000 / Nasal / core.nas /
Newer Older
126 lines | 4.677kb
new var organistaion (and fi...
Sébastien MARQUE authored on 2017-03-26
1
var PFD = nil;
2
var MFD = nil;
commit initial
Sébastien MARQUE authored on 2017-03-07
3

            
NAV disponible (hors CDI)
Sébastien MARQUE authored on 2017-03-11
4
# les listeners triggent en permanence sur les fréquences...
5
var setListeners = func {
6
    setlistener('/instrumentation/nav/nav-id',
correction listeners
Sébastien MARQUE authored on 2017-03-12
7
            func (n) {
8
                var val = n.getValue();
new var organistaion (and fi...
Sébastien MARQUE authored on 2017-03-26
9
                if (PFD != nil)
10
                    PFD.display.updateNAV({'nav-id': 1, val: val});
11
                if (MFD != nil)
12
                    MFD.display.updateNAV({'nav-id': 1, val: val});
NAV disponible (hors CDI)
Sébastien MARQUE authored on 2017-03-11
13
            }, 1, 2);
14
    setlistener('/instrumentation/nav[1]/nav-id',
correction listeners
Sébastien MARQUE authored on 2017-03-12
15
            func (n) {
16
                var val = n.getValue();
new var organistaion (and fi...
Sébastien MARQUE authored on 2017-03-26
17
                if (PFD != nil)
18
                    PFD.display.updateNAV({'nav-id': 2, val: val});
19
                if (MFD != nil)
20
                    MFD.display.updateNAV({'nav-id': 2, val: val});
NAV disponible (hors CDI)
Sébastien MARQUE authored on 2017-03-11
21
            }, 1, 2);
Correction swap NAV tuning
Sébastien MARQUE authored on 2017-03-12
22
    setlistener('/instrumentation/zkv1000/radios/nav-tune',
correction listeners
Sébastien MARQUE authored on 2017-03-12
23
            func (n) {
24
                var val = n.getValue();
Correction swap NAV tuning
Sébastien MARQUE authored on 2017-03-12
25
                setNavTune();
new var organistaion (and fi...
Sébastien MARQUE authored on 2017-03-26
26
                if (PFD != nil)
27
                    PFD.display.updateNAV({tune: val});
28
                if (MFD != nil)
29
                    MFD.display.updateNAV({tune: val});
correction listeners
Sébastien MARQUE authored on 2017-03-12
30
            }, 1, 2);
31
    setlistener('/instrumentation/zkv1000/radios/comm-tune',
32
            func (n) {
33
                var val = n.getValue();
34
                setCommTune();
new var organistaion (and fi...
Sébastien MARQUE authored on 2017-03-26
35
                if (PFD != nil)
36
                    PFD.display.updateCOMM({tune: val});
37
                if (MFD != nil)
38
                    MFD.display.updateCOMM({tune: val});
Correction swap NAV tuning
Sébastien MARQUE authored on 2017-03-12
39
            }, 1, 2);
animation HDG bug
Sébastien MARQUE authored on 2017-03-13
40
    setlistener('/instrumentation/zkv1000/afcs/heading-bug-deg',
41
            func (n) {
42
                var val = n.getValue();
43
                if (val != nil) {
new var organistaion (and fi...
Sébastien MARQUE authored on 2017-03-26
44
                    if (PFD != nil)
45
                        PFD.display.updateHDG(val);
46
                    if (MFD != nil)
47
                        MFD.display.updateHDG(val);
animation HDG bug
Sébastien MARQUE authored on 2017-03-13
48
                }
49
            }, 0, 2);
new var organistaion (and fi...
Sébastien MARQUE authored on 2017-03-26
50
    setlistener('/instrumentation/zkv1000/PFD/knobs/CRS',
anime CRS
Sébastien MARQUE authored on 2017-03-13
51
            func (n) {
52
                var val = n.getValue();
53
                if (val != nil) {
new var organistaion (and fi...
Sébastien MARQUE authored on 2017-03-26
54
                    if (PFD != nil)
55
                        PFD.display.updateCRS();
56
                    if (MFD != nil)
57
                        MFD.display.updateCRS();
anime CRS
Sébastien MARQUE authored on 2017-03-13
58
                }
59
            }, 0, 2);
adds OAT, TAS, GSPD, WindDat...
Sébastien MARQUE authored on 2017-03-15
60
    setlistener('/instrumentation/zkv1000/afcs/selected-alt-ft',
61
            func (n) {
62
                var val = n.getValue();
new var organistaion (and fi...
Sébastien MARQUE authored on 2017-03-26
63
                if (val != nil  and PFD != nil) {
64
                    if (! PFD.display.screenElements['SelectedALT'].getVisible()) {
65
                        PFD.display.screenElements['SelectedALT'].show();
66
                        PFD.display.screenElements['SelectedALT-text'].show();
67
                        PFD.display.screenElements['SelectedALT-symbol'].show();
68
                        PFD.display.screenElements['SelectedALT-bug'].show();
69
                        PFD.display.screenElements['SelectedALT-bg'].show();
fix Selected Altitude displa...
Sébastien MARQUE authored on 2017-03-18
70
                    }
new var organistaion (and fi...
Sébastien MARQUE authored on 2017-03-26
71
                    PFD.display.updateSelectedALT();
adds OAT, TAS, GSPD, WindDat...
Sébastien MARQUE authored on 2017-03-15
72
                }
73
            }, 0, 2);
adds transponder
Sébastien MARQUE authored on 2017-03-17
74
    setlistener('/gear/gear/wow',
new var organistaion (and fi...
Sébastien MARQUE authored on 2017-03-26
75
            func if (PFD != nil) PFD.display.updateXPDR(),
adds transponder
Sébastien MARQUE authored on 2017-03-17
76
            0, 0);
adds BARO settings
Sébastien MARQUE authored on 2017-03-20
77
    setlistener('/instrumentation/altimeter/setting-inhg',
new var organistaion (and fi...
Sébastien MARQUE authored on 2017-03-26
78
            func if (PFD != nil) PFD.display.updateBARO(), 0, 2);
NAV disponible (hors CDI)
Sébastien MARQUE authored on 2017-03-11
79
}
80

            
commit initial
Sébastien MARQUE authored on 2017-03-07
81
var deviceClass = {
new var organistaion (and fi...
Sébastien MARQUE authored on 2017-03-26
82
    new: func (role) {
commit initial
Sébastien MARQUE authored on 2017-03-07
83
        var m = { parents: [ deviceClass ] };
new var organistaion (and fi...
Sébastien MARQUE authored on 2017-03-26
84
        m.role = role;
85
        m.node = zkv.getNode(role, 1);
add V-speeds bugs
Sébastien MARQUE authored on 2017-04-04
86
        m.data = {};
87
        foreach (var v; ['Vx', 'Vy', 'Vr', 'Vglide']) {
88
            m.data[v] = alerts.getNode(v).getValue();
89
            m.data[v ~ '-visible'] = 1;
90
        }
pass device pointer to displ...
Sébastien MARQUE authored on 2017-03-14
91
        m.display  = displayClass.new(m, m.role);
commit initial
Sébastien MARQUE authored on 2017-03-07
92
        m.display.showInitProgress(m.role);
softkeys are available now
Sébastien MARQUE authored on 2017-03-14
93
        m.softkeys = softkeysClass.new(m, m.node, m.role);
XPDR settings via knob or so...
Sébastien MARQUE authored on 2017-03-22
94
        m.buttons  = buttonsClass.new(m.node);
95
        m.knobs    = knobsClass.new(m);
commit initial
Sébastien MARQUE authored on 2017-03-07
96
        m.display.loadsvg();
AI disponible
Sébastien MARQUE authored on 2017-03-10
97
        m.display.loadGroup({
98
            hide : [
commit initial
Sébastien MARQUE authored on 2017-03-07
99
                'Failures',
100
                'SoftKeysTexts',
101
                'PFD-Widgets', 
102
                'COMM',
103
                'XPDR-TIME', 
104
                'NAV',
105
                'FlightInstruments', 
106
                'VDI',
107
                'OMI',
AI disponible
Sébastien MARQUE authored on 2017-03-10
108
            ],
109
            clip : 'PitchScale',
110
        });
TMR/REF window
Sébastien MARQUE authored on 2017-03-28
111
        m.windows  = pageClass.new(m);
commit initial
Sébastien MARQUE authored on 2017-03-07
112
        zkv.getNode(m.role ~ 'init').setIntValue(0);
new var organistaion (and fi...
Sébastien MARQUE authored on 2017-03-26
113
        setprop('/instrumentation/zkv1000/' ~ m.role ~ '/status', 1);
PFD+MFD allumés ensemble
Sébastien MARQUE authored on 2017-03-11
114
        msg(m.role ~ ' switched on!');
commit initial
Sébastien MARQUE authored on 2017-03-07
115
        return m;
116
    },
117
};
118

            
PFD+MFD allumés ensemble
Sébastien MARQUE authored on 2017-03-11
119
var powerOn = func {
new var organistaion (and fi...
Sébastien MARQUE authored on 2017-03-26
120
    foreach (var role; ['PFD', 'MFD'])
121
        if (zkv.getNode(role) != nil)
122
#            thread.newthread(func {
123
                zkv1000[role] = deviceClass.new(role);
124
#            });
correction listeners
Sébastien MARQUE authored on 2017-03-12
125
    settimer(setListeners, 5);
commit initial
Sébastien MARQUE authored on 2017-03-07
126
}