Add flap lever not zero warning

This commit is contained in:
Jonathan Redpath 2019-02-08 19:57:48 +00:00
parent d15cbcfb50
commit 56f1890a7c
3 changed files with 16 additions and 50 deletions

View file

@ -138,10 +138,10 @@ var ECAM_controller = {
loop: func() { loop: func() {
# check active messages # check active messages
# config_warnings(); # config_warnings();
# messages_priority_3(); messages_priority_3();
messages_priority_2(); messages_priority_2();
# messages_priority_1(); messages_priority_1();
# messages_priority_0(); messages_priority_0();
messages_memo(); messages_memo();
messages_right_memo(); messages_right_memo();
@ -219,6 +219,9 @@ var ECAM_controller = {
} }
} }
}, },
clear: func() {
print("Clear!");
},
}; };
setlistener("/systems/electrical/bus/dc-ess", func { setlistener("/systems/electrical/bus/dc-ess", func {

View file

@ -3,17 +3,15 @@
# Copyright (c) 2019 Jonathan Redpath (legoboyvdlp) # Copyright (c) 2019 Jonathan Redpath (legoboyvdlp)
var messages_priority_3 = func { var messages_priority_3 = func {
if ((getprop("/position/gear-agl-ft") < 750 and getprop("/gear/gear[1]/position-norm") != 1 and (getprop("/ECAM/warning-phase") <= 3 and getprop("/ECAM/warning-phase") >= 5)) and ((((getprop("/engines/engine[0]/n1-actual") < 75.0 and getprop("/engines/engine[1]/n1-actual") < 75.0)) or ((getprop("/engines/engine[0]/n1-actual") < 77.0 and getprop("/controls/engines/engine[1]/cutoff-switch") == 0) or (getprop("/engines/engine[1]/n1-actual") < 77.0 and getprop("/controls/engines/engine[0]/cutoff-switch") == 0))) or getprop("/controls/flight/flap-pos") > 1)) { # FCTL
lg_not_dn.active = 1; if (getprop("/ECAM/warning-phase") == 6 and getprop("/controls/flight/flap-lever") != 0 and getprop("/instrumentation/altimeter/indicated-altitude-ft") > 22000) {
setprop("/systems/gear/landing-gear-warning-light", 1); flap_not_zero.active = 1;
} else { } else {
lg_not_dn.active = 0; flap_not_zero.active = 0;
lg_not_dn.noRepeat = 0; flap_not_zero.noRepeat = 0;
setprop("/systems/gear/landing-gear-warning-light", 0);
} }
}
# AUTOFLT
var messages_priority_2 = func {
if (getprop("/it-autoflight/output/ap-warning") == 2) { if (getprop("/it-autoflight/output/ap-warning") == 2) {
ap_offw.active = 1; ap_offw.active = 1;
} else { } else {
@ -52,43 +50,7 @@ var messages_priority_2 = func {
} }
} }
var messages_priority_2_old = func { var messages_priority_2 = func {}
if ((((getprop("/ECAM/warning-phase") >= 1 and getprop("/ECAM/warning-phase") <= 2) or (getprop("/ECAM/warning-phase") >= 9 and getprop("/ECAM/warning-phase") <= 10) and (wow and getprop("/engines/engine[0]/state") == 3)) or getprop("/ECAM/warning-phase") == 6) and getprop("/systems/failures/pack1") == 1) {
pack1_fault.active = 1;
} else {
pack1_fault.active = 0;
pack1_fault.noRepeat = 0;
}
if (pack1_fault.active == 1 and getprop("/controls/pneumatic/switches/pack1") == 1) {
pack1_fault_subwarn_1.active = 1;
} else {
pack1_fault_subwarn_1.active = 0;
pack1_fault_subwarn_1.noRepeat = 0;
}
if ((((getprop("/ECAM/warning-phase") >= 1 and getprop("/ECAM/warning-phase") <= 2) or (getprop("/ECAM/warning-phase") >= 9 and getprop("/ECAM/warning-phase") <= 10) and (wow and getprop("/engines/engine[1]/state") == 3)) or getprop("/ECAM/warning-phase") == 6) and getprop("/systems/failures/pack2") == 1) {
pack2_fault.active = 1;
} else {
pack2_fault.active = 0;
pack2_fault.noRepeat = 0;
}
if (pack2_fault.active == 1 and getprop("/controls/pneumatic/switches/pack2") == 1) {
pack2_fault_subwarn_1.active = 1;
} else {
pack2_fault_subwarn_1.active = 0;
pack2_fault_subwarn_1.noRepeat = 0;
}
if (getprop("/controls/gear/brake-parking") and (getprop("/ECAM/warning-phase") >= 6 and getprop("/ECAM/warning-phase") <= 7)) {
park_brk_on.active = 1;
} else {
park_brk_on.active = 0;
park_brk_on.noRepeat = 0;
}
}
var messages_priority_1 = func {} var messages_priority_1 = func {}
var messages_priority_0 = func {} var messages_priority_0 = func {}

View file

@ -15,13 +15,14 @@ var warningsOld = std.Vector.new([
]); ]);
var warnings = std.Vector.new([ var warnings = std.Vector.new([
var flap_not_zero = warning.new(msg: "F/CTL FLAP LVR NOT ZERO", active: 0, colour: "r", aural: "crc", light: "warning", noRepeat: 0),
var ap_offw = warning.new(msg: "AUTO FLT AP OFF", active: 0, colour: "r", aural: "calv", light: "warning", noRepeat: 0), var ap_offw = warning.new(msg: "AUTO FLT AP OFF", active: 0, colour: "r", aural: "calv", light: "warning", noRepeat: 0),
var athr_offw = warning.new(msg: "AUTO FLT A/THR OFF", active: 0, colour: "a", aural: "chime", light: "caution", noRepeat: 0), var athr_offw = warning.new(msg: "AUTO FLT A/THR OFF", active: 0, colour: "a", aural: "chime", light: "caution", noRepeat: 0),
var athr_offw_1 = warning.new(msg: "-THR LEVERS........MOVE", active: 0, colour: "b", aural: "none", light: "none", noRepeat: 0), var athr_offw_1 = warning.new(msg: "-THR LEVERS........MOVE", active: 0, colour: "b", aural: "none", light: "none", noRepeat: 0),
var athr_lock = warning.new(msg: "ENG THRUST LOCKED", active: 0, colour: "a", aural: "chime", light: "caution", noRepeat: 0), var athr_lock = warning.new(msg: "ENG THRUST LOCKED", active: 0, colour: "a", aural: "chime", light: "caution", noRepeat: 0),
var athr_lock_1 = warning.new(msg: "-THR LEVERS........MOVE", active: 0, colour: "b", aural: "none", light: "none", noRepeat: 0), var athr_lock_1 = warning.new(msg: "-THR LEVERS........MOVE", active: 0, colour: "b", aural: "none", light: "none", noRepeat: 0),
var athr_lim = warning.new(msg: "AUTO FLT A/THR LIMITED", active: 0, colour: "a", aural: "chime", light: "caution", noRepeat: 0), var athr_lim = warning.new(msg: "AUTO FLT A/THR LIMITED", active: 0, colour: "a", aural: "chime", light: "caution", noRepeat: 0),
var athr_lim_1 = warning.new(msg: "-THR LEVERS........MOVE", active: 0, colour: "b", aural: "none", light: "none", noRepeat: 0), var athr_lim_1 = warning.new(msg: "-THR LEVERS........MOVE", active: 0, colour: "b", aural: "none", light: "none", noRepeat: 0)
]); ]);
var leftmemos = std.Vector.new([ var leftmemos = std.Vector.new([