zkv1000 / Nasal / buttons.nas /
Newer Older
52 lines | 2.003kb
commit initial
Sébastien MARQUE authored on 2017-03-07
1
var buttonsClass = {
2
    new : func (node) {
3
        var m = { parents: [ buttonsClass ] };
4
        m.node = node;
5
        return m;
6
    },
7

            
8
    PAN : func (xdir = 0, ydir = 0) {
9
    },
10

            
11
    AsSwitchNAV : func {
12
        var n = getprop('/instrumentation/zkv1000/radios/nav-tune');
13
        var tmp = getprop('/instrumentation/nav[' ~ n ~ ']/frequencies/selected-mhz');
14
        setprop('/instrumentation/nav[' ~ n ~ ']/frequencies/selected-mhz', getprop('/instrumentation/nav[' ~ n ~ ']/frequencies/standby-mhz'));
15
        setprop('/instrumentation/nav[' ~ n ~ ']/frequencies/standby-mhz', tmp);
NAV disponible (hors CDI)
Sébastien MARQUE authored on 2017-03-11
16
        device[0].display.updateNAV({refresh: n+1});
17
        device[1].display.updateNAV({refresh: n+1});
commit initial
Sébastien MARQUE authored on 2017-03-07
18
    },
19

            
ajout de l'animation des bou...
Sébastien MARQUE authored on 2017-03-08
20
    AsSwitchCOM : func (x) {
commit initial
Sébastien MARQUE authored on 2017-03-07
21
        if (x) {
ajout de l'animation des bou...
Sébastien MARQUE authored on 2017-03-08
22
            me.AsSwitchCOM_pushed = getprop('/sim/time/elapsed-sec');
commit initial
Sébastien MARQUE authored on 2017-03-07
23
        }
ajout de l'animation des bou...
Sébastien MARQUE authored on 2017-03-08
24
        else {
25
            var pressed = getprop('/sim/time/elapsed-sec') - me.AsSwitchCOM_pushed;
26
            if (pressed > 2) {
27
                setprop('/instrumentation/comm/frequencies/selected-mhz', 121.500);
28
                setprop('/instrumentation/zkv1000/radios/comm1-selected', 1);
29
                setprop('/instrumentation/zkv1000/radios/comm2-selected', 0);
30
            }
31
            else {
32
                var c = getprop('/instrumentation/zkv1000/radios/comm-tune');
33
                var tmp = getprop('/instrumentation/comm[' ~ c ~ ']/frequencies/selected-mhz');
34
                setprop('/instrumentation/comm[' ~ c ~ ']/frequencies/selected-mhz', getprop('/instrumentation/comm[' ~ c ~ ']/frequencies/standby-mhz'));
35
                setprop('/instrumentation/comm[' ~ c ~ ']/frequencies/standby-mhz', tmp);
36
            }
commit initial
Sébastien MARQUE authored on 2017-03-07
37
        }
38
    },
39

            
ajout de l'animation des bou...
Sébastien MARQUE authored on 2017-03-08
40
    ALT : func () {
41
        var alt = getprop('instrumentation/altimeter/indicated-altitude-ft');
42
        setprop('/instrumentation/zkv1000/afcs/selected-alt-ft', math.round(alt, 10));
commit initial
Sébastien MARQUE authored on 2017-03-07
43
    },
44

            
45
    DirectTo : void,
46
    MENU : void,
47
    FPL : void,
48
    PROC : void,
49
    CLR : void,
50
    ENT : void,
51
    FMS : void,
52
};