From 2f4e5cf5d91fc6ff0703c3bb10cdb8393a7f8775 Mon Sep 17 00:00:00 2001 From: Jonathan Redpath Date: Tue, 12 Feb 2019 15:16:23 +0000 Subject: [PATCH] continue clear logic --- Nasal/ECAM/ECAM-controller.nas | 3 --- Nasal/ECAM/ECAM-logic.nas | 7 ++++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/Nasal/ECAM/ECAM-controller.nas b/Nasal/ECAM/ECAM-controller.nas index 9cb878ef..c6fd3dfb 100644 --- a/Nasal/ECAM/ECAM-controller.nas +++ b/Nasal/ECAM/ECAM-controller.nas @@ -233,8 +233,6 @@ var ECAM_controller = { clear: func() { foreach (var w; warnings.vector) { if (w.active == 1) { - w.active = 0; # todo: need to hit CLR to clear condition, not automatic - w.noRepeat = 0; # should warning only clear if condition is not true? w.clearFlag = 1; break; } @@ -243,7 +241,6 @@ var ECAM_controller = { recall: func() { foreach (var w; warnings.vector) { if (w.clearFlag == 1) { - w.active = 1; w.noRepeat = 1; w.clearFlag = 0; break; diff --git a/Nasal/ECAM/ECAM-logic.nas b/Nasal/ECAM/ECAM-logic.nas index 6dba9943..b5eadebe 100644 --- a/Nasal/ECAM/ECAM-logic.nas +++ b/Nasal/ECAM/ECAM-logic.nas @@ -4,15 +4,16 @@ var messages_priority_3 = func { # FCTL - if (getprop("/ECAM/warning-phase") == 6 and getprop("/controls/flight/flap-lever") != 0 and getprop("/instrumentation/altimeter/indicated-altitude-ft") > 22000) { + if ((flap_not_zero.clearFlag == 0) and getprop("/ECAM/warning-phase") == 6 and getprop("/controls/flight/flap-lever") != 0 and getprop("/instrumentation/altimeter/indicated-altitude-ft") > 22000) { flap_not_zero.active = 1; } else { flap_not_zero.active = 0; flap_not_zero.noRepeat = 0; + flap_not_zero.clearFlag = 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) { + if ((slats_config.clearFlag == 0) and (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 { @@ -22,7 +23,7 @@ var messages_priority_3 = func { 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) { + if ((flaps_config.clearFlag == 0) and (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 {