Config warnings

This commit is contained in:
Jonathan Redpath 2019-02-11 12:21:53 +00:00
parent 8dde947a27
commit 4327f3dcc9
2 changed files with 73 additions and 0 deletions

View file

@ -11,6 +11,64 @@ var messages_priority_3 = func {
flap_not_zero.noRepeat = 0;
}
# CONFIG
if ((getprop("/controls/flight/flap-lever") == 0 or getprop("/controls/flight/flap-lever")) == 4 and getprop("/ECAM/warning-phase") >= 3 and getprop("/ECAM/warning-phase") <= 4) {
slats_config.active = 1;
slats_config_1.active = 1;
} else {
slats_config.active = 0;
slats_config.noRepeat = 0;
slats_config_1.active = 0;
slats_config_1.noRepeat = 0;
}
if ((getprop("/controls/flight/flap-lever") == 0 or getprop("/controls/flight/flap-lever") == 4) and getprop("/ECAM/warning-phase") >= 3 and getprop("/ECAM/warning-phase") <= 4) {
flaps_config.active = 1;
flaps_config_1.active = 1;
} else {
flaps_config.active = 0;
flaps_config.noRepeat = 0;
flaps_config_1.active = 0;
flaps_config_1.noRepeat = 0;
}
if (getprop("/controls/flight/speedbrake") != 0 and getprop("/ECAM/warning-phase") >= 3 and getprop("/ECAM/warning-phase") <= 4) {
spd_brk_config.active = 1;
spd_brk_config_1.active = 1;
} else {
spd_brk_config.active = 0;
spd_brk_config.noRepeat = 0;
spd_brk_config_1.active = 0;
spd_brk_config_1.noRepeat = 0;
}
if ((getprop("/fdm/jsbsim/hydraulics/elevator-trim/final-deg") > 1.75 or getprop("/fdm/jsbsim/hydraulics/elevator-trim/final-deg") < -3.65) and getprop("/ECAM/warning-phase") >= 3 and getprop("/ECAM/warning-phase") <= 4) {
pitch_trim_config.active = 1;
pitch_trim_config_1.active = 1;
} else {
pitch_trim_config.active = 0;
pitch_trim_config.noRepeat = 0;
pitch_trim_config_1.active = 0;
pitch_trim_config_1.noRepeat = 0;
}
if ((getprop("/fdm/jsbsim/hydraulics/rudder/trim-cmd-deg") < -3.55 or getprop("/fdm/jsbsim/hydraulics/rudder/trim-cmd-deg") > 3.55) and getprop("/ECAM/warning-phase") >= 3 and getprop("/ECAM/warning-phase") <= 4) {
rud_trim_config.active = 1;
rud_trim_config_1.active = 1;
} else {
rud_trim_config.active = 0;
rud_trim_config.noRepeat = 0;
rud_trim_config_1.active = 0;
rud_trim_config_1.noRepeat = 0;
}
if (getprop("/controls/gear/brake-parking") == 1 and getprop("/ECAM/warning-phase") >= 3 and getprop("/ECAM/warning-phase") <= 4) {
park_brk_config.active = 1;
} else {
park_brk_config.active = 0;
park_brk_config.noRepeat = 0;
}
# AUTOFLT
if (getprop("/it-autoflight/output/ap-warning") == 2) {
ap_offw.active = 1;

View file

@ -16,6 +16,21 @@ var warningsOld = 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),
# Config
var slats_config = warning.new(msg: "CONFIG", active: 0, colour: "r", aural: "crc", light: "warning", noRepeat: 0),
var slats_config_1 = warning.new(msg: "SLATS NOT IN T.O. CONFIG", active: 0, colour: "r", aural: "crc", light: "warning", noRepeat: 0),
var flaps_config = warning.new(msg: "CONFIG", active: 0, colour: "r", aural: "crc", light: "warning", noRepeat: 0),
var flaps_config_1 = warning.new(msg: "FLAPS NOT IN T.O. CONFIG", active: 0, colour: "r", aural: "crc", light: "warning", noRepeat: 0),
var spd_brk_config = warning.new(msg: "CONFIG", active: 0, colour: "r", aural: "crc", light: "warning", noRepeat: 0),
var spd_brk_config_1 = warning.new(msg: "SPD BRK NOT RETRACTED", active: 0, colour: "r", aural: "crc", light: "warning", noRepeat: 0),
var pitch_trim_config = warning.new(msg: "CONFIG PITCH TRIM", active: 0, colour: "r", aural: "crc", light: "warning", noRepeat: 0),
var pitch_trim_config_1 = warning.new(msg: " NOT IN T.O. RANGE", active: 0, colour: "r", aural: "crc", light: "warning", noRepeat: 0),
var rud_trim_config = warning.new(msg: "CONFIG RUD TRIM", active: 0, colour: "r", aural: "crc", light: "warning", noRepeat: 0),
var rud_trim_config_1 = warning.new(msg: " NOT IN T.O. RANGE", active: 0, colour: "r", aural: "crc", light: "warning", noRepeat: 0),
var park_brk_config = warning.new(msg: "CONFIG PARK BRK ON", active: 0, colour: "r", aural: "crc", light: "warning", noRepeat: 0),
# Autopilot
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_1 = warning.new(msg: "-THR LEVERS........MOVE", active: 0, colour: "b", aural: "none", light: "none", noRepeat: 0),