zkv1000 / Nasal / afcs.nas /
Newer Older
424 lines | 19.613kb
add vim zip-markers
Sébastien MARQUE authored on 2023-08-05
1
# vim: set foldmethod=marker foldmarker={{{,}}} :
adds AFCS
Sébastien MARQUE authored on 2020-05-06
2
var APClass = {
3
    new : func {
4
        var m = { parents: [ APClass ] };
5

            
6
        m.system = 'none';
7
        var ap_systems = { # described AP systems to search, if it returns true system is set
autopilot S-TEC 55X integrat...
Sébastien MARQUE authored on 2020-05-06
8
            STEC55X: func contains(stec55x, 'ITAF'),
creates entry point for GFC7...
Sébastien MARQUE authored on 2020-05-16
9
            GFC700: func props.globals.getNode('/autopilot/GFC700/FSM/lateral').getPath(),
add KAP140 to afcs
Sébastien MARQUE authored on 2021-03-24
10
            KAP140: func contains(kap140, 'apButton'),
adds AFCS
Sébastien MARQUE authored on 2020-05-06
11
        };
12
        foreach (var s; sort(keys(ap_systems), func(a,b) cmp(a,b))) {
13
            call(ap_systems[s], [], nil, nil, var errors = []);
14
            if (!size(errors)) {
15
                msg('found autopilot system: ' ~ s);
16
                m.system = s;
17
                break;
18
            }
19
        }
add message if no autopilot ...
Sébastien MARQUE authored on 2023-08-05
20
        if (m.system == 'none')
21
            msg('no autopilot system found');
adds AFCS
Sébastien MARQUE authored on 2020-05-06
22

            
23
        m.engaged = 0;
24

            
25
        if (! contains(data.timers, 'updateAP')) {
26
            data.timers.updateAP = maketimer(1, m, m.systems[m.system].updateDisplay);
27
            data.timers.updateAP.start();
28
        }
29

            
autopilot status with separa...
Sébastien MARQUE authored on 2020-05-08
30
        var ap_annun = [
31
            'LATMOD-Armed-text',  'LATMOD-Active-text',
32
            'AP-Status-text',     'YD-Status-text',
33
            'VERMOD-Active-text', 'VERMOD-Reference-text', 'VERMOD-Armed-text'
34
        ];
show AP infos on MFDs if the...
Sébastien MARQUE authored on 2021-03-22
35

            
36
        var terminal_count = { PFD: 0, MFD: 0 };
37
        m.terminals = [];
38
        foreach (var name; keys(flightdeck)) {
39
            terminal_count[flightdeck[name].role] += 1;
40
            if (flightdeck[name].role == 'PFD')
41
                append(m.terminals, name);
42
        }
43

            
44
        if (terminal_count.PFD == 0 and terminal_count.MFD > 0) {
45
            foreach (var name; keys(flightdeck)) {
fix AP visibility on MFD
Sébastien MARQUE authored on 2021-03-28
46
                flightdeck[name].display.loadGroup({show: 'PFD-navbox'});
show AP infos on MFDs if the...
Sébastien MARQUE authored on 2021-03-22
47
                if (flightdeck[name].role == 'MFD') {
48
                    append(m.terminals, name);
49
                    flightdeck[name].display.loadGroup({text: ap_annun});
50
                }
51
            }
52
        }
53

            
54
        foreach (var terminal; m.terminals) {
55
            foreach (var elem; ap_annun) {
56
                var color = (elem == 'LATMOD-Armed-text' or elem == 'VERMOD-Armed-text') ? 'white' : 'green';
57
                flightdeck[terminal].display.screenElements[elem]
58
                    .setColor(flightdeck[terminal].display.colors[color])
59
                    .setVisible(0);
60
            }
61
            foreach (var ap; [ 'AP', 'YD' ])
62
                flightdeck[terminal].display.screenElements[ap ~ '-Status-text']
63
                    .setDrawMode(canvas.Text.TEXT + canvas.Text.FILLEDBOUNDINGBOX)
64
                    .setColorFill(flightdeck[terminal].display.colors.black)
65
                    .setText(ap);
autopilot status with separa...
Sébastien MARQUE authored on 2020-05-08
66
        }
67

            
68
        ap_annun = nil;
69
        ap_systems = nil;
show AP infos on MFDs if the...
Sébastien MARQUE authored on 2021-03-22
70
        terminal_count = nil;
delete unused afcs systems
Sébastien MARQUE authored on 2020-05-16
71
        # delete unused systems
72
        foreach (var e; keys(m.systems))
73
            if (e != m.system)
74
                delete(m.systems, e);
autopilot status with separa...
Sébastien MARQUE authored on 2020-05-08
75

            
adds AFCS
Sébastien MARQUE authored on 2020-05-06
76
        if (contains(m.systems[m.system], 'hook') and typeof(m.systems[m.system].hook) == 'func')
show AP infos on MFDs if the...
Sébastien MARQUE authored on 2021-03-22
77
            m.systems[m.system].hook();
adds AFCS
Sébastien MARQUE authored on 2020-05-06
78

            
79
        return m;
80
    },
81
    softkey: func (side, row, a) {
little fixes
Sébastien MARQUE authored on 2020-05-11
82
        if (a)
adds AFCS
Sébastien MARQUE authored on 2020-05-06
83
            return;
afcs improvements
Sébastien MARQUE authored on 2020-05-17
84
        call(me.systems[me.system][side][row], [], autopilot.parents[0].systems[me.system]);
adds AFCS
Sébastien MARQUE authored on 2020-05-06
85
    },
86
    systems : {
87
        # L: AP FD  NAV ALT VS FLC
88
        # R: YD HDG APR VNV UP DN
89
        none: {
90
            updateDisplay: func,
91
            hook: func,
92
            L: [ func, func, func, func, func, func ],
93
            R: [ func, func, func, func, func, func ],
94
        },
creates entry point for GFC7...
Sébastien MARQUE authored on 2020-05-16
95
        GFC700: {
add vim zip-markers
Sébastien MARQUE authored on 2023-08-05
96
# {{{
integration of GFC700 capabi...
Sébastien MARQUE authored on 2020-05-17
97
# Many thanks to the great work on the FG1000
98
            _blink_count: 0,
99
            updateDisplay: func {
improve and fix afcs for mul...
Sébastien MARQUE authored on 2021-03-24
100
                var annunciator = props.globals.getNode('/autopilot/annunciator');
101
                var ap_enabled  = annunciator.getValue('autopilot-enabled');
102

            
103
                var latmod         = annunciator.getValue('lateral-mode');
104
                var latmod_armed   = annunciator.getValue('lateral-mode-armed');
105
                var vertmod        = annunciator.getValue('vertical-mode');
106
                var vertmod_armed  = annunciator.getValue('vertical-mode-armed');
107
                var vertmod_target = annunciator.getValue('vertical-mode-target');
108
                if (vertmod_target != nil) {
109
                    vertmod_target = string.replace(vertmod_target, '+', utf8.chstr(9650));
110
                    vertmod_target = string.replace(vertmod_target, '-', utf8.chstr(9660));
111
                }
show AP infos on MFDs if the...
Sébastien MARQUE authored on 2021-03-22
112
                foreach (var terminal; me.terminals) {
113
                    var se = flightdeck[terminal].display.screenElements;
integration of GFC700 capabi...
Sébastien MARQUE authored on 2020-05-17
114

            
show AP infos on MFDs if the...
Sébastien MARQUE authored on 2021-03-22
115
                    se['LATMOD-Active-text'].setVisible(latmod != nil and ap_enabled).setText(latmod);
116
                    se['LATMOD-Armed-text'].setVisible(latmod_armed != nil and ap_enabled).setText(latmod_armed);
117
                    se['VERMOD-Active-text'].setVisible(vertmod != nil and ap_enabled).setText(vertmod);
118
                    se['VERMOD-Reference-text'].setVisible(vertmod_target != nil and ap_enabled).setText(vertmod_target);
119
                    se['VERMOD-Armed-text'].setVisible(vertmod_armed != nil and ap_enabled).setText(vertmod_armed);
120

            
121
                    if (se['AP-Status-text'].getVisible() and !ap_enabled) {
122
                        if (math.mod(me._blink_count,2))
123
                            se['AP-Status-text']
124
                                .setDrawMode(canvas.Text.TEXT + canvas.Text.FILLEDBOUNDINGBOX)
125
                                .setColorFill(flightdeck[terminal].display.colors.yellow)
126
                                .setColor(flightdeck[terminal].display.colors.black);
127
                        else
128
                            se['AP-Status-text']
129
                                .setDrawMode(canvas.Text.TEXT + canvas.Text.FILLEDBOUNDINGBOX)
130
                                .setColorFill(flightdeck[terminal].display.colors.black)
131
                                .setColor(flightdeck[terminal].display.colors.yellow);
132
                        me._blink_count += 1;
133
                        if (me._blink_count == 5) {
134
                            se['AP-Status-text']
135
                                .setColor(flightdeck[terminal].display.colors.green)
136
                                .setVisible(0);
137
                            me._blink_count = 0;
138
                        }
139
                        return;
140
                    }
141
                    else {
142
                        se['AP-Status-text'].setVisible(ap_enabled);
integration of GFC700 capabi...
Sébastien MARQUE authored on 2020-05-17
143
                        me._blink_count = 0;
144
                    }
145
                }
146
            },
147
            hook: func {
148
                me._vertical_mode = globals.props.getNode("/autopilot/annunciator/vertical-mode", 1);
149
                me._pitch_setting = globals.props.getNode("/autopilot/settings/target-pitch-deg", 1);
150
                me._climb_setting = globals.props.getNode("/autopilot/settings/vertical-speed-fpm", 1);
151
                me._speed_setting = globals.props.getNode("/autopilot/settings/target-speed-kt", 1);
152
                me._vertical_mode_button = globals.props.getNode("/autopilot/vertical-mode-button", 1);
153
                me._lateral_mode_button = globals.props.getNode("/autopilot/lateral-mode-button", 1);
154
                me._ap_mode_button = globals.props.getNode("/autopilot/AP-mode-button", 1);
155
                me._ap_enabled = globals.props.getNode("/autopilot/annunciator/autopilot-enabled", 1);;
156
                me._fd_enabled = globals.props.getNode("/autopilot/annunciator/flight-director-enabled", 1);;
157

            
158
            },
159
            sendModeChange: func (value) {
160
                me._vertical_mode_button.setValue(value);
161
                me._lateral_mode_button.setValue(value);
162
                if (value == "AP") {
163
                    me._ap_mode_button.setValue(value);
164
                }
165
            },
166
            handleNoseUpDown : func(value) {
167
                var vertical_mode = me._vertical_mode.getValue();
168

            
169
                if (vertical_mode == "PIT")
170
                    me._pitch_setting.setValue(me._pitch_setting.getValue() + (value * 1));
171

            
172
                if (vertical_mode == "VS") {
173
                    me._climb_setting.setValue(me._climb_setting.getValue() + (value * 100));
174
                    setprop("/autopilot/annunciator/vertical-mode-target",
175
                        sprintf("%+ifpm", me._climb_setting.getValue())
176
                    );
177
                }
178

            
179
                if (vertical_mode == "FLC") {
180
                    me._speed_setting.setValue(me._speed_setting.getValue() - (value * 1));
181
                    setprop("/autopilot/annunciator/vertical-mode-target",
182
                        sprintf("%i kt", me._speed_setting.getValue())
183
                    );
184
                }
185
            },
nothing interesting
Sébastien MARQUE authored on 2020-05-17
186
            L: [
integration of GFC700 capabi...
Sébastien MARQUE authored on 2020-05-17
187
               func { me.sendModeChange('AP');  },
188
               func { me.sendModeChange('FD');  },
fix issue with AP/NAV
Sébastien MARQUE authored on 2020-09-27
189
               func { setprop('/autopilot/settings/nav-mode-source', cdi.getValue('source')); me.sendModeChange('NAV'); },
integration of GFC700 capabi...
Sébastien MARQUE authored on 2020-05-17
190
               func { me.sendModeChange('ALT'); },
191
               func { me.sendModeChange('VS');  },
192
               func { me.sendModeChange('FLC'); },
193
            ],
nothing interesting
Sébastien MARQUE authored on 2020-05-17
194
            R: [
integration of GFC700 capabi...
Sébastien MARQUE authored on 2020-05-17
195
               func { me.sendModeChange('YD');  },
196
               func { me.sendModeChange('HDG'); },
197
               func { me.sendModeChange('APR'); },
198
               func { me.sendModeChange('VNV'); },
199
               func { me.handleNoseUpDown(1);   },
200
               func { me.handleNoseUpDown(-1);  },
201
            ],
creates entry point for GFC7...
Sébastien MARQUE authored on 2020-05-16
202
        },
add vim zip-markers
Sébastien MARQUE authored on 2023-08-05
203
# }}}
autopilot S-TEC 55X integrat...
Sébastien MARQUE authored on 2020-05-06
204
        STEC55X: {
add vim zip-markers
Sébastien MARQUE authored on 2023-08-05
205
# {{{
code more clear
Sébastien MARQUE authored on 2020-05-16
206
            _aliases: {
207
                hdg:          afcs.getNode('heading-bug-deg'),
208
                NAVCourse:    cdi.getNode('course'),
209
                OBSNAVNeedle: cdi.getNode('course-deflection'),
210
            },
improve S-TEC55X support
Sébastien MARQUE authored on 2023-08-06
211
            ap_annun_color: {
212
                rdy: "white",
213
                fail: "red",
214
            },
autopilot status with separa...
Sébastien MARQUE authored on 2020-05-08
215
            hook : func {
216
                me.trimTarget = 0;
code more clear
Sébastien MARQUE authored on 2020-05-16
217
                foreach (var a; keys(me._aliases)) stec55x[a].alias(me._aliases[a]);
stec55x integration (suite)
Sébastien MARQUE authored on 2020-05-11
218
                setprop('/it-stec55x/input/ap-master-sw', 1);
autopilot status with separa...
Sébastien MARQUE authored on 2020-05-08
219
            },
autopilot S-TEC 55X integrat...
Sébastien MARQUE authored on 2020-05-06
220
            updateDisplay: func {
it-stec55x: fix error "activ...
Sébastien MARQUE authored on 2023-08-05
221
                var armed     = '';
222
                var active    = '';
223
                var reference = '';
improve S-TEC55X support
Sébastien MARQUE authored on 2023-08-06
224
                if (stec55x.ALT_annun.getBoolValue()) {
225
                    active    = 'ALT';
226
                    reference = sprintf('%5d ft', abs(data.alt - afcs.getValue('selected-alt-ft')) < 150 ? afcs.getValue('selected-alt-ft') : math.round(data.alt, 10));
227
                    armed     = sprintf('%.2f inHg', stec55x.alt.getValue());
improve and fix afcs for mul...
Sébastien MARQUE authored on 2021-03-24
228
                }
improve S-TEC55X support
Sébastien MARQUE authored on 2023-08-06
229
                elsif (stec55x.VS_annun.getBoolValue()) {
230
                    active    = 'VS';
231
                    reference = sprintf('%s%4d fpm',
232
                                    utf8.chstr(stec55x.vs.getValue() > 0 ? 9650 : 9660),
233
                                    math.abs(math.round(stec55x.vs.getValue(), 10)));
234
                }
235
                elsif (stec55x.GSArmed.getBoolValue()) {
236
                    armed  = 'VPATH';
237
                    active = 'GS';
238
                }
239

            
240
                var ap_state = [];
241
                if (stec55x.RDY_annun.getBoolValue())
242
                    ap_state = ["RDY", "white", "black"];
243
                elsif (stec55x.FAIL_annun.getBoolValue())
244
                    ap_state = ["FAIL", "black", "red"];
245
                elsif (stec55x.systemAlive.getBoolValue())
246
                    ap_state = ["AP", "black", "green"];
247
                else
248
                    ap_state = ["", "black", "black"];
improve and fix afcs for mul...
Sébastien MARQUE authored on 2021-03-24
249

            
250
                foreach (var terminal; me.terminals) {
it-stec55x: fix error on dis...
Sébastien MARQUE authored on 2023-08-05
251
                    var se = flightdeck[terminal].display.screenElements;
autopilot status with separa...
Sébastien MARQUE authored on 2020-05-08
252
                    se['VERMOD-Active-text'].setVisible(size(active)).setText(active);
253
                    se['VERMOD-Armed-text'].setVisible(size(armed)).setText(armed);
254
                    se['VERMOD-Reference-text'].setVisible(size(reference)).setText(reference);
improve S-TEC55X support
Sébastien MARQUE authored on 2023-08-06
255
                    se['AP-Status-text'].setColorFill(flightdeck[terminal].display.colors[ap_state[2]])
256
                                        .setColor(ap_state[1])
257
                                        .setVisible(size(ap_state[0]))
258
                                        .setText(ap_state[0]);
improve and fix afcs for mul...
Sébastien MARQUE authored on 2021-03-24
259
                    se['YD-Status-text'].setVisible(stec55x.yaw.getValue() != -1);
260
                    if (stec55x.rollMode  != -1) {
261
                        se['LATMOD-Active-text'].setVisible(1).setText('ROL');
262
                        var armed = '';
263
                        foreach (var m; [ 'NAV', 'CNAV', 'REV', 'CREV' ])
264
                            if (stec55x[m]) armed = m;
265
                        if (stec55x.roll.getValue() == 0) armed = 'HDG';
266
                        elsif (stec55x.roll.getValue() == 2) armed = 'GPS';
improve S-TEC55X support
Sébastien MARQUE authored on 2023-08-06
267
                        elsif (stec55x.APR_annun.getValue()) armed = 'LOC';
improve and fix afcs for mul...
Sébastien MARQUE authored on 2021-03-24
268
                        se['LATMOD-Armed-text']
269
                            .setVisible(size(armed))
270
                            .setText(armed);
271
                    }
272
                    else {
273
                        se['LATMOD-Active-text'].setVisible(0);
274
                        se['LATMOD-Armed-text'].setVisible(0);
275
                    }
autopilot status with separa...
Sébastien MARQUE authored on 2020-05-08
276
                }
improve and fix afcs for mul...
Sébastien MARQUE authored on 2021-03-24
277

            
autopilot S-TEC 55X integrat...
Sébastien MARQUE authored on 2020-05-06
278
            },
279
            L: [
280
                func {
improve S-TEC55X support
Sébastien MARQUE authored on 2023-08-06
281
                    var ap_master_sw = '/it-stec55x/input/ap-master-sw';
282
                    setprop(ap_master_sw, !getprop(ap_master_sw));
283
                },
284
                func {
285
                    var apfd_master_sw = '/it-stec55x/input/apfd-master-sw';
286
                    setprop(apfd_master_sw, !getprop(apfd_master_sw));
autopilot S-TEC 55X integrat...
Sébastien MARQUE authored on 2020-05-06
287
                },
288
                func {
add STEC55X GPS roll mode
Sébastien MARQUE authored on 2020-05-11
289
                    var _roll = stec55x.roll.getValue();
290
                    if (_roll == 1 or _roll == 2 or _roll == 4)
291
                        stec55x.roll.setValue(-1);
292
                    else {
293
                        stec55x.roll.setValue(1);
294
                        call(stec55x.button.NAV, [], nil, stec55x);
295
                    }
autopilot S-TEC 55X integrat...
Sébastien MARQUE authored on 2020-05-06
296
                },
297
                func {
improve S-TEC55X support
Sébastien MARQUE authored on 2023-08-06
298
                    call(stec55x.button.ALT, [], nil, stec55x);
autopilot S-TEC 55X integrat...
Sébastien MARQUE authored on 2020-05-06
299
                },
300
                func {
improve S-TEC55X support
Sébastien MARQUE authored on 2023-08-06
301
                    stec55x.vs.setValue(math.round(data.vsi, 100));
302
                    call(stec55x.button.VS, [], nil, stec55x);
autopilot S-TEC 55X integrat...
Sébastien MARQUE authored on 2020-05-06
303
                },
304
                func,
305
            ],
306
            R: [
307
                func {
improve S-TEC55X support
Sébastien MARQUE authored on 2023-08-06
308
                    var yaw_dumper_sw = '/it-stec55x/input/yaw-damper-sw';
309
                    setprop(yaw_dumper_sw, !getprop(yaw_dumper_sw));
autopilot S-TEC 55X integrat...
Sébastien MARQUE authored on 2020-05-06
310
                },
311
                func {
only HDG roll mode is availa...
Sébastien MARQUE authored on 2020-05-11
312
                    if (stec55x.roll.getValue() == 0)
313
                        stec55x.roll.setValue(-1);
314
                    else
315
                        call(stec55x.button.HDG, [], nil, stec55x);
autopilot S-TEC 55X integrat...
Sébastien MARQUE authored on 2020-05-06
316
                },
317
                func {
improve S-TEC55X support
Sébastien MARQUE authored on 2023-08-06
318
                    call(stec55x.button.APR, [], nil, stec55x);
autopilot S-TEC 55X integrat...
Sébastien MARQUE authored on 2020-05-06
319
                },
320
                func,
321
                func { # UP (trim)
improve S-TEC55X support
Sébastien MARQUE authored on 2023-08-06
322
                    call(stec55x.button.Knob, [1], nil, stec55x);
autopilot S-TEC 55X integrat...
Sébastien MARQUE authored on 2020-05-06
323
                },
324
                func { # DN (trim)
improve S-TEC55X support
Sébastien MARQUE authored on 2023-08-06
325
                    call(func{stec55x.button.Knob(-1)}, [], nil, stec55x);
autopilot S-TEC 55X integrat...
Sébastien MARQUE authored on 2020-05-06
326
                },
327
            ],
add KAP140 to afcs
Sébastien MARQUE authored on 2021-03-24
328
        },
add vim zip-markers
Sébastien MARQUE authored on 2023-08-05
329
# }}}
add KAP140 to afcs
Sébastien MARQUE authored on 2021-03-24
330
        KAP140: {
add vim zip-markers
Sébastien MARQUE authored on 2023-08-05
331
# {{{
add KAP140 to afcs
Sébastien MARQUE authored on 2021-03-24
332
            _blink_count: 0,
333
            updateDisplay: func {
334
                var latmod = latmod_armed = vertmod = vertmod_armed = "";
335
                var vertmod_target = 0;
fix syntax error
Sébastien MARQUE authored on 2021-03-24
336
                var ap_enabled = kap140.lockRollMode.getValue() != kap140.rollModes["OFF"]
337
                              or kap140.lockPitchMode.getValue() != kap140.pitchModes["OFF"];
add KAP140 to afcs
Sébastien MARQUE authored on 2021-03-24
338

            
339
                if (ap_enabled) {
340
                    foreach (var mode; keys(kap140.rollModes))
341
                        if (kap140.lockRollMode.getValue() == kap140.rollModes[mode]) {
342
                            latmod = mode;
343
                            break;
344
                        }
345

            
346
                    foreach (var mode; keys(kap140.rollArmModes))
347
                        if (kap140.lockRollArm.getValue() == kap140.rollArmModes[mode]) {
348
                            latmod_armed = mode;
349
                            break;
350
                        }
351

            
352
                    foreach (var mode; keys(kap140.pitchModes))
353
                        if (kap140.lockPitchMode.getValue() == kap140.pitchModes[mode]) {
354
                            vertmod = mode;
355
                            break;
356
                        }
357

            
358
                    foreach (var mode; keys(kap140.pitchArmModes))
359
                        if (kap140.lockPitchArm.getValue() == kap140.pitchArmModes[mode]) {
360
                            vertmod_armed = mode;
361
                            break;
362
                        }
363

            
364
                    vertmod_target = kap140.settingTargetPressureRate.getValue() * 58000;
fix missing namespace
Sébastien MARQUE authored on 2021-03-28
365
                    if (kap140.lockPitchMode.getValue() == kap140.pitchModes["VS"]
366
                    or kap140.lockPitchArm.getValue() == kap140.pitchArmModes["VS"])
add KAP140 to afcs
Sébastien MARQUE authored on 2021-03-24
367
                        vertmod_target = sprintf('%s%4d fpm',
368
                                utf8.chstr(vertmod_target > 0 ? 9650 : 9660),
369
                                math.abs(math.round(vertmod_target, 10)));
370
                }
371

            
372
                foreach (var terminal; me.terminals) {
373
                    var se = flightdeck[terminal].display.screenElements;
374
                    if (se['AP-Status-text'].getVisible() and !ap_enabled) {
375
                        if (math.mod(me._blink_count,2))
376
                            se['AP-Status-text']
377
                                .setDrawMode(canvas.Text.TEXT + canvas.Text.FILLEDBOUNDINGBOX)
378
                                .setColorFill(flightdeck[terminal].display.colors.yellow)
379
                                .setColor(flightdeck[terminal].display.colors.black);
380
                        else
381
                            se['AP-Status-text']
382
                                .setDrawMode(canvas.Text.TEXT + canvas.Text.FILLEDBOUNDINGBOX)
383
                                .setColorFill(flightdeck[terminal].display.colors.black)
384
                                .setColor(flightdeck[terminal].display.colors.yellow);
385
                        me._blink_count += 1;
386
                        if (me._blink_count == 5) {
387
                            se['AP-Status-text']
388
                                .setColor(flightdeck[terminal].display.colors.green)
389
                                .setVisible(0);
390
                            me._blink_count = 0;
391
                        }
392
                        return;
393
                    }
394
                    else {
395
                        se['AP-Status-text'].setVisible(ap_enabled);
396
                        me._blink_count = 0;
397
                        se['LATMOD-Active-text'].setVisible(ap_enabled).setText(latmod);
398
                        se['LATMOD-Armed-text'].setVisible(ap_enabled).setText(latmod_armed);
399
                        se['VERMOD-Active-text'].setVisible(ap_enabled).setText(vertmod);
400
                        se['VERMOD-Reference-text'].setVisible(ap_enabled).setText(vertmod_target);
401
                        se['VERMOD-Armed-text'].setVisible(ap_enabled).setText(vertmod_armed);
402
                    }
403
                }
404
            },
405
            L: [
406
                func { kap140.apButton(); },
407
                func,
408
                func { kap140.navButton(); },
409
                func { kap140.altButton(); },
410
                func,
411
                func,
412
            ],
413
            R: [
414
                func,
415
                func { kap140.hdgButton(); },
416
                func { kap140.aprButton(); },
417
                func,
418
                func { kap140.upButton(); },
419
                func { kap140.downButton(); }
420
            ],
421
        },
adds AFCS
Sébastien MARQUE authored on 2020-05-06
422
    }
add vim zip-markers
Sébastien MARQUE authored on 2023-08-05
423
# }}}
adds AFCS
Sébastien MARQUE authored on 2020-05-06
424
};