diff --git a/Nasal/ECAM/ECAM-logic.nas b/Nasal/ECAM/ECAM-logic.nas index f300e0ed..14aa0f75 100644 --- a/Nasal/ECAM/ECAM-logic.nas +++ b/Nasal/ECAM/ECAM-logic.nas @@ -3239,7 +3239,7 @@ var messages_config_memo = func { ldgMemoLine3.colour = "c"; } - if (getprop("/it-fbw/law") == 1 or getprop("instrumentation/mk-viii/inputs/discretes/momentary-flap-3-override")) { + if (fbw.FBW.activeLaw.getValue() == 1 or pts.Instrumentation.MKVII.Inputs.Discretes.flap3Override.getValue()) { if (pts.Controls.Flight.flapsPos.getValue() == 4) { ldgMemoLine4.msg = " FLAPS CONF 3"; ldgMemoLine4.colour = "g"; diff --git a/Nasal/Systems/fbw.nas b/Nasal/Systems/fbw.nas index adeed76e..c0ede289 100644 --- a/Nasal/Systems/fbw.nas +++ b/Nasal/Systems/fbw.nas @@ -163,6 +163,8 @@ var FBW = { }, }; +var degradeLaw = 0; + var update_loop = func { elac1 = FBW.Computers.elac1.getBoolValue(); elac2 = FBW.Computers.elac2.getBoolValue(); @@ -210,35 +212,30 @@ var update_loop = func { FBW.degradeYawLaw.setValue(1); } - if (law == 0 and !tripleIRFail) { - FBW.degradeLaw.setValue(1); + if ((law == 0 or law == 2 or law == 3) and !tripleIRFail) { + degradeLaw = 1; if (!tripleSECFault) { FBW.apOff = 1; } - } elsif (tripleIRFail and (law == 0 or law == 1)) { - FBW.degradeLaw.setValue(2); + } elsif (tripleIRFail and (law == 0 or law == 1 or law == 3)) { + degradeLaw = 2; FBW.apOff = 1; } + + if (!pts.Gear.wow[1].getBoolValue() and !pts.Gear.wow[2].getBoolValue()) { + if (degradeLaw == 1 and pts.Controls.Gear.gearDown.getBoolValue()) { + FBW.degradeLaw.setValue(2); # todo 3 sec timer + } else { + FBW.degradeLaw.setValue(degradeLaw) + } + } else { + FBW.degradeLaw.setValue(degradeLaw) + } } else { FBW.degradeYawLaw.setValue(0); FBW.degradeLaw.setValue(0); FBW.apOff = 0; } - - # degrade loop runs faster; reset this variable - law = FBW.activeLaw.getValue(); - - if (!pts.Gear.wow[1].getBoolValue() and !pts.Gear.wow[2].getBoolValue()) { - if (pts.Controls.Gear.gearDown.getBoolValue()) { - if (law == 1) { - FBW.degradeLaw.setValue(2); # todo 3 sec timer - } - } else { - if (law == 2 and !tripleIRFail) { - FBW.degradeLaw.setValue(1); # todo 3 sec timer - } - } - } if (FBW.Protections.overspeed.getBoolValue()) { if (fmgc.Input.ap1.getBoolValue() or fmgc.Input.ap2.getBoolValue()) {