From 62c855c56f93d24f3613f9fbc0dfa2b083af2ed0 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Sat, 2 Nov 2019 16:20:08 +0000 Subject: [PATCH] Bugfix --- Nasal/ECAM/ECAM-controller.nas | 39 +++++++++++++++++++--------------- Systems/a320-adr.xml | 30 ++++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 17 deletions(-) diff --git a/Nasal/ECAM/ECAM-controller.nas b/Nasal/ECAM/ECAM-controller.nas index 6dca8883..5e9a7f90 100644 --- a/Nasal/ECAM/ECAM-controller.nas +++ b/Nasal/ECAM/ECAM-controller.nas @@ -70,31 +70,33 @@ var warning = { } }, warnlight: func() { - if (me.light > 1 or me.noRepeat == 1 or (me.active == 0 and me.wasActive == 0)) {return;} - if (me.active == 1) { - lights[me.light].setBoolValue(1); - me.noRepeat = 1; - } elsif (me.wasActive) { - print("Yesssssss"); + if (me.light > 1) { return; } + if (me.active == 0 and me.wasActive == 1) { lights[me.light].setBoolValue(0); me.wasActive = 0; } + + if (me.noRepeat == 1 or me.active == 0) { return; } + + lights[me.light].setBoolValue(1); + me.noRepeat = 1; }, sound: func() { - if (me.aural > 2 or me.noRepeat2 == 1 or (me.active == 0 and me.wasActive == 0)) {return;} - if (me.active == 1) { - if (me.aural != 0) { - aural[me.aural].setBoolValue(0); - } - me.noRepeat2 = 1; - settimer(func() { - aural[me.aural].setBoolValue(1); - }, 0.15); - } elsif (me.wasActive) { - print("Noooooooo"); + if (me.aural > 2) { return; } + if (me.active == 0 and me.wasActive == 1) { aural[me.aural].setBoolValue(0); me.wasActive = 0; } + + if (me.noRepeat2 == 1 or me.active == 0) { return; } + + if (me.aural != 0) { + aural[me.aural].setBoolValue(0); + } + me.noRepeat2 = 1; + settimer(func() { + aural[me.aural].setBoolValue(1); + }, 0.15); }, callPage: func() { if (me.sdPage == "nil" or me.hasCalled == 1) { return; } @@ -207,6 +209,9 @@ var ECAM_controller = { w.warnlight(); w.sound(); counter += 1; + } elsif (w.wasActive == 1) { + w.warnlight(); + w.sound(); } } } diff --git a/Systems/a320-adr.xml b/Systems/a320-adr.xml index 809dce00..da76fd00 100644 --- a/Systems/a320-adr.xml +++ b/Systems/a320-adr.xml @@ -729,6 +729,36 @@ 1 + + /systems/navigation/adr/computation/baro-alt-corrected-1-capt + 1 + + + + /systems/navigation/adr/computation/baro-alt-corrected-2-capt + 1 + + + + /systems/navigation/adr/computation/baro-alt-corrected-3-capt + 1 + + + + /systems/navigation/adr/computation/baro-alt-corrected-1-fo + 1 + + + + /systems/navigation/adr/computation/baro-alt-corrected-2-fo + 1 + + + + /systems/navigation/adr/computation/baro-alt-corrected-3-fo + 1 + + /systems/navigation/adr/computation/cas-1 1