zkv1000 / Nasal / core.nas /
Newer Older
121 lines | 4.496kb
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);
pass device pointer to displ...
Sébastien MARQUE authored on 2017-03-14
86
        m.display  = displayClass.new(m, m.role);
commit initial
Sébastien MARQUE authored on 2017-03-07
87
        m.display.showInitProgress(m.role);
softkeys are available now
Sébastien MARQUE authored on 2017-03-14
88
        m.softkeys = softkeysClass.new(m, m.node, m.role);
XPDR settings via knob or so...
Sébastien MARQUE authored on 2017-03-22
89
        m.buttons  = buttonsClass.new(m.node);
90
        m.knobs    = knobsClass.new(m);
commit initial
Sébastien MARQUE authored on 2017-03-07
91
        m.display.loadsvg();
AI disponible
Sébastien MARQUE authored on 2017-03-10
92
        m.display.loadGroup({
93
            hide : [
commit initial
Sébastien MARQUE authored on 2017-03-07
94
                'Failures',
95
                'SoftKeysTexts',
96
                'PFD-Widgets', 
97
                'COMM',
98
                'XPDR-TIME', 
99
                'NAV',
100
                'FlightInstruments', 
101
                'VDI',
102
                'OMI',
AI disponible
Sébastien MARQUE authored on 2017-03-10
103
            ],
104
            clip : 'PitchScale',
105
        });
TMR/REF window
Sébastien MARQUE authored on 2017-03-28
106
        m.windows  = pageClass.new(m);
commit initial
Sébastien MARQUE authored on 2017-03-07
107
        zkv.getNode(m.role ~ 'init').setIntValue(0);
new var organistaion (and fi...
Sébastien MARQUE authored on 2017-03-26
108
        setprop('/instrumentation/zkv1000/' ~ m.role ~ '/status', 1);
PFD+MFD allumés ensemble
Sébastien MARQUE authored on 2017-03-11
109
        msg(m.role ~ ' switched on!');
commit initial
Sébastien MARQUE authored on 2017-03-07
110
        return m;
111
    },
112
};
113

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