From 8dde947a2754cc60abe1cd6ba735e2e0548af52d Mon Sep 17 00:00:00 2001 From: Jonathan Redpath Date: Fri, 8 Feb 2019 20:05:54 +0000 Subject: [PATCH] CLR logic WIP --- Nasal/ECAM.nas | 4 ++++ Nasal/ECAM/ECAM-controller.nas | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Nasal/ECAM.nas b/Nasal/ECAM.nas index 98d3590e..1147fcb8 100644 --- a/Nasal/ECAM.nas +++ b/Nasal/ECAM.nas @@ -313,6 +313,10 @@ var LowerECAM = { return; } + if (b == "clr" and getprop("/ECAM/Lower/man-select") == 0 and getprop("/ECAM/Lower/fault-select") == 0) { + ecam.ECAM_controller.clear(); + } + if (getprop("/ECAM/Lower/fault-select") == 0) { if (b != "clr") { if (!man_sel) { diff --git a/Nasal/ECAM/ECAM-controller.nas b/Nasal/ECAM/ECAM-controller.nas index 84b8c8c6..ebd6df96 100644 --- a/Nasal/ECAM/ECAM-controller.nas +++ b/Nasal/ECAM/ECAM-controller.nas @@ -220,7 +220,13 @@ var ECAM_controller = { } }, clear: func() { - print("Clear!"); + 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? + break; + } + } }, };