1
0
Fork 0

Merge branch 'dev' into 3D

This commit is contained in:
Jonathan Redpath 2021-10-17 19:47:32 +01:00
commit be0bcd2bd4
2 changed files with 17 additions and 20 deletions

View file

@ -3239,7 +3239,7 @@ var messages_config_memo = func {
ldgMemoLine3.colour = "c"; 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) { if (pts.Controls.Flight.flapsPos.getValue() == 4) {
ldgMemoLine4.msg = " FLAPS CONF 3"; ldgMemoLine4.msg = " FLAPS CONF 3";
ldgMemoLine4.colour = "g"; ldgMemoLine4.colour = "g";

View file

@ -163,6 +163,8 @@ var FBW = {
}, },
}; };
var degradeLaw = 0;
var update_loop = func { var update_loop = func {
elac1 = FBW.Computers.elac1.getBoolValue(); elac1 = FBW.Computers.elac1.getBoolValue();
elac2 = FBW.Computers.elac2.getBoolValue(); elac2 = FBW.Computers.elac2.getBoolValue();
@ -210,36 +212,31 @@ var update_loop = func {
FBW.degradeYawLaw.setValue(1); FBW.degradeYawLaw.setValue(1);
} }
if (law == 0 and !tripleIRFail) { if ((law == 0 or law == 2 or law == 3) and !tripleIRFail) {
FBW.degradeLaw.setValue(1); degradeLaw = 1;
if (!tripleSECFault) { if (!tripleSECFault) {
FBW.apOff = 1; FBW.apOff = 1;
} }
} elsif (tripleIRFail and (law == 0 or law == 1)) { } elsif (tripleIRFail and (law == 0 or law == 1 or law == 3)) {
FBW.degradeLaw.setValue(2); degradeLaw = 2;
FBW.apOff = 1; 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 { } else {
FBW.degradeYawLaw.setValue(0); FBW.degradeYawLaw.setValue(0);
FBW.degradeLaw.setValue(0); FBW.degradeLaw.setValue(0);
FBW.apOff = 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 (FBW.Protections.overspeed.getBoolValue()) {
if (fmgc.Input.ap1.getBoolValue() or fmgc.Input.ap2.getBoolValue()) { if (fmgc.Input.ap1.getBoolValue() or fmgc.Input.ap2.getBoolValue()) {
fcu.apOff("hard", 0); fcu.apOff("hard", 0);