zkv1000 / Nasal / knobs.nas /
Sébastien MARQUE commit initial
56c0030 7 years ago
1 contributor
76 lines | 1.928kb
var knobsClass = {
    new : func (node) {
        var m = { parents: [ knobsClass ] };
        m.node = node;
        return m;
    },

    ALT : func (x) {
        fgcommand('property-adjust', props.Node.new({
            property: '/instrumentation/zkv1000/afcs/selected-alt-ft',
            step: x,
            min: 0,
            max: 16000,
            wrap: 0
        }));
    },

    HDG : func (x) {
        fgcommand('property-adjust', props.Node.new({
            property: '/instrumentation/zkv1000/afcs/heading-bug-deg',
            step: x,
            min: 0,
            max: 360,
            wrap: 1
        }));
    },

    CRS : func (x) {
        if (x) fgcommand('property-adjust', props.Node.new({
            property: '/instrumentation/zkv1000/cdi/course',
            step: x,
            min: 0,
            max: 360,
            wrap: 1
        }));
        else fgcommand('property-assign', props.Node.new({
            property: '/instrumentation/zkv1000/cdi/course',
            property: '/instrumentation/zkv1000/cdi/radial'
        }));
    },

    BARO : func (x) {
        fgcommand('property-adjust', props.Node.new({
            property: '/instrumentation/altimeter/setting-inhg',
            step: x,
            min: 28.50,
            max: 33.00,
            warp: 0
        }));
    },

    NAV : func (x) {
        fgcommand('property-adjust', props.Node.new({
            property: '/instrumentation/zkv1000/radios/nav-freq-mhz',
            step: x,
            min: 108.00,
            max: 118.00,
            wrap: 1
        }));
    },

    COM : func (x) {
        fgcommand('property-adjust', props.Node.new({
            property: '/instrumentation/zkv1000/radios/comm-freq-mhz',
            step: x,
            min: 118.00,
            max: 137.975,
            wrap: 1
        }));
    },

    VolNAV : void,
    VolCOM : void,
    FmsInner : void,
    FmsOuter : void
};