From 655762a4618b9468ff50139b724017950cba3f2a Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Thu, 2 May 2019 16:03:57 +0100 Subject: [PATCH] Bugfixes --- Nasal/ECAM/ECAM-controller.nas | 19 +++++-------------- Nasal/ECAM/ECAM-logic.nas | 32 ++++++++++++++++---------------- Nasal/fire.nas | 8 ++++---- 3 files changed, 25 insertions(+), 34 deletions(-) diff --git a/Nasal/ECAM/ECAM-controller.nas b/Nasal/ECAM/ECAM-controller.nas index 0293d105..dfb9e85b 100644 --- a/Nasal/ECAM/ECAM-controller.nas +++ b/Nasal/ECAM/ECAM-controller.nas @@ -73,7 +73,9 @@ var warning = { }, sound: func() { if (me.aural > 1 or me.noRepeat2 == 1 or me.active == 0) {return;} - aural[me.aural].setBoolValue(0); + if (me.aural != 0) { + aural[me.aural].setBoolValue(0); + } me.noRepeat2 = 1; settimer(func() { aural[me.aural].setBoolValue(1); @@ -174,23 +176,12 @@ var ECAM_controller = { if (counter >= 9) { break; } if (w.active == 1) { w.write(); + w.warnlight(); + w.sound(); counter += 1; } } - foreach (var w2; warnings.vector) { - if (w2.active == 1) { - if (w2.noRepeat == 0) { - w2.warnlight(); - } - if (w2.noRepeat2 == 0) { - w2.sound(); - } - w2.callPage(); - break - } - } - if (lines[0].getValue() == "" and flash == 0) { # disable left memos if a warning exists. Warnings are processed first, so this stops leftmemos if line1 is not empty foreach (var l; leftmemos.vector) { l.write(); diff --git a/Nasal/ECAM/ECAM-logic.nas b/Nasal/ECAM/ECAM-logic.nas index 11afb03f..41d442d4 100644 --- a/Nasal/ECAM/ECAM-logic.nas +++ b/Nasal/ECAM/ECAM-logic.nas @@ -424,35 +424,35 @@ var messages_priority_3 = func { if (eng2Fire.active == 1) { if (phaseVar >= 5 and phaseVar <= 7) { - if (eng2FireFllever.clearFlag == 0 and getprop("/fdm/jsbsim/fcs/throttle-lever[0]") > 0.01) { + if (eng2FireFllever.clearFlag == 0 and getprop("/fdm/jsbsim/fcs/throttle-lever[1]") > 0.01) { eng2FireFllever.active = 1; } else { ECAM_controller.warningReset(eng2FireFllever); } - if (eng2FireFlmaster.clearFlag == 0 and getprop("/controls/engines/engine[0]/cutoff-switch") == 0) { + if (eng2FireFlmaster.clearFlag == 0 and getprop("/controls/engines/engine[1]/cutoff-switch") == 0) { eng2FireFlmaster.active = 1; } else { ECAM_controller.warningReset(eng2FireFlmaster); } - if (eng2FireFlPB.clearFlag == 0 and getprop("/controls/engines/engine[0]/fire-btn") == 0) { + if (eng2FireFlPB.clearFlag == 0 and getprop("/controls/engines/engine[1]/fire-btn") == 0) { eng2FireFlPB.active = 1; } else { ECAM_controller.warningReset(eng2FireFlPB); } - if (getprop("/systems/fire/engine1/agent1-timer") != 0 and getprop("/systems/fire/engine1/agent1-timer") != 99) { - eng2FireFlAgent1Timer.msg = " -AGENT AFT " ~ getprop("/systems/fire/engine1/agent1-timer") ~ " S...DISCH"; + if (getprop("/systems/fire/engine2/agent1-timer") != 0 and getprop("/systems/fire/engine2/agent1-timer") != 99) { + eng2FireFlAgent1Timer.msg = " -AGENT AFT " ~ getprop("/systems/fire/engine2/agent1-timer") ~ " S...DISCH"; } - if (eng2FireFlAgent1.clearFlag == 0 and getprop("/controls/engines/engine[0]/fire-btn") == 1 and !getprop("/systems/fire/engine1/disch1") and getprop("/systems/fire/engine1/agent1-timer") != 0 and getprop("/systems/fire/engine1/agent1-timer") != 99) { + if (eng2FireFlAgent1.clearFlag == 0 and getprop("/controls/engines/engine[1]/fire-btn") == 1 and !getprop("/systems/fire/engine2/disch1") and getprop("/systems/fire/engine2agent1-timer") != 0 and getprop("/systems/fire/engine2/agent1-timer") != 99) { eng2FireFlAgent1Timer.active = 1; } else { ECAM_controller.warningReset(eng2FireFlAgent1Timer); } - if (eng2FireFlAgent1.clearFlag == 0 and !getprop("/systems/fire/engine1/disch1") and (getprop("/systems/fire/engine1/agent1-timer") == 0 or getprop("/systems/fire/engine1/agent1-timer") == 99)) { + if (eng2FireFlAgent1.clearFlag == 0 and !getprop("/systems/fire/engine2/disch1") and (getprop("/systems/fire/engine2/agent1-timer") == 0 or getprop("/systems/fire/engine2/agent1-timer") == 99)) { eng2FireFlAgent1.active = 1; } else { ECAM_controller.warningReset(eng2FireFlAgent1); @@ -464,17 +464,17 @@ var messages_priority_3 = func { ECAM_controller.warningReset(eng2FireFlATC); } - if (getprop("/systems/fire/engine1/agent2-timer") != 0 and getprop("/systems/fire/engine1/agent2-timer") != 99) { - eng2FireFl30Sec.msg = "•IF FIRE AFTER " ~ getprop("/systems/fire/engine1/agent2-timer") ~ " S:"; + if (getprop("/systems/fire/engine2/agent2-timer") != 0 and getprop("/systems/fire/engine2/agent2-timer") != 99) { + eng2FireFl30Sec.msg = "•IF FIRE AFTER " ~ getprop("/systems/fire/engine2/agent2-timer") ~ " S:"; } - if (eng2FireFlAgent2.clearFlag == 0 and getprop("/systems/fire/engine1/disch1") and !getprop("/systems/fire/engine1/disch2") and getprop("/systems/fire/engine1/agent2-timer") > 0) { + if (eng2FireFlAgent2.clearFlag == 0 and getprop("/systems/fire/engine2/disch1") and !getprop("/systems/fire/engine2/disch2") and getprop("/systems/fire/engine2/agent2-timer") > 0) { eng2FireFl30Sec.active = 1; } else { ECAM_controller.warningReset(eng2FireFl30Sec); } - if (eng2FireFlAgent2.clearFlag == 0 and getprop("/systems/fire/engine1/disch1") and !getprop("/systems/fire/engine1/disch2")) { + if (eng2FireFlAgent2.clearFlag == 0 and getprop("/systems/fire/engine2/disch1") and !getprop("/systems/fire/engine2/disch2")) { eng2FireFlAgent2.active = 1; } else { ECAM_controller.warningReset(eng2FireFlAgent2); @@ -504,31 +504,31 @@ var messages_priority_3 = func { ECAM_controller.warningReset(eng2FireGnparkbrk); } - if (eng2FireGnmaster.clearFlag == 0 and getprop("/controls/engines/engine[0]/cutoff-switch") == 0) { + if (eng2FireGnmaster.clearFlag == 0 and getprop("/controls/engines/engine[1]/cutoff-switch") == 0) { eng2FireGnmaster.active = 1; } else { ECAM_controller.warningReset(eng2FireGnmaster); } - if (eng2FireGnPB.clearFlag == 0 and getprop("/controls/engines/engine[0]/fire-btn") == 0) { + if (eng2FireGnPB.clearFlag == 0 and getprop("/controls/engines/engine[1]/fire-btn") == 0) { eng2FireGnPB.active = 1; } else { ECAM_controller.warningReset(eng2FireGnPB); } - if (eng2FireGnAgent1.clearFlag == 0 and !getprop("/systems/fire/engine1/disch1")) { + if (eng2FireGnAgent1.clearFlag == 0 and !getprop("/systems/fire/engine2/disch1")) { eng2FireGnAgent1.active = 1; } else { ECAM_controller.warningReset(eng2FireGnAgent1); } - if (eng2FireGnAgent2.clearFlag == 0 and !getprop("/systems/fire/engine1/disch2")) { + if (eng2FireGnAgent2.clearFlag == 0 and !getprop("/systems/fire/engine2/disch2")) { eng2FireGnAgent2.active = 1; } else { ECAM_controller.warningReset(eng2FireGnAgent2); } - if (eng2FireGnmaster2.clearFlag == 0 and getprop("/controls/engines/engine[1]/cutoff-switch") == 0) { + if (eng2FireGnmaster2.clearFlag == 0 and getprop("/controls/engines/engine[0]/cutoff-switch") == 0) { eng2FireGnmaster2.active = 1; } else { ECAM_controller.warningReset(eng2FireGnmaster2); diff --git a/Nasal/fire.nas b/Nasal/fire.nas index d4ddb183..f99a581c 100644 --- a/Nasal/fire.nas +++ b/Nasal/fire.nas @@ -439,8 +439,8 @@ var checkTimeFire2 = func() { if (engFireDetectorUnits.vector[1].loopOne == 9 and engFireDetectorUnits.vector[1].loopTwo == 9) { fireTimer2.stop(); engFireDetectorUnits.vector[1].TriggerWarning(engFireDetectorUnits.vector[1].sys); - loop3.setValue(0); - loop4.setValue(0); + propsNasFireTime.vector[2].setValue(0); + propsNasFireTime.vector[3].setValue(0); } } @@ -458,8 +458,8 @@ var checkTimeFire3 = func() { if (engFireDetectorUnits.vector[2].loopOne == 9 and engFireDetectorUnits.vector[2].loopTwo == 9) { fireTimer3.stop(); engFireDetectorUnits.vector[2].TriggerWarning(engFireDetectorUnits.vector[2].sys); - loop4.setValue(0); - loop5.setValue(0); + propsNasFireTime.vector[4].setValue(0); + propsNasFireTime.vector[5].setValue(0); } }