FMGC: Fix errenous disarming of NAV mode - and incorrect ingauge condition
This commit is contained in:
parent
fa9dd8baa3
commit
5cc72e1acd
2 changed files with 14 additions and 12 deletions
|
@ -4,7 +4,7 @@
|
|||
|
||||
# Initialize all used variables and property nodes
|
||||
# Sim
|
||||
var Velocity = {
|
||||
var Velocities = {
|
||||
airspeedKt: props.globals.getNode("velocities/airspeed-kt", 1), # Only used for gain scheduling
|
||||
groundspeedKt: props.globals.getNode("velocities/groundspeed-kt", 1),
|
||||
groundspeedMps: 0,
|
||||
|
@ -371,14 +371,14 @@ var ITAF = {
|
|||
},
|
||||
slowLoop: func() {
|
||||
Input.bankLimitSWTemp = Input.bankLimitSW.getValue();
|
||||
Velocity.trueAirspeedKtTemp = Velocity.trueAirspeedKt.getValue();
|
||||
Velocities.trueAirspeedKtTemp = Velocities.trueAirspeedKt.getValue();
|
||||
FPLN.activeTemp = FPLN.active.getValue();
|
||||
FPLN.currentWPTemp = FPLN.currentWP.getValue();
|
||||
|
||||
# Bank Limit
|
||||
if (Velocity.trueAirspeedKtTemp >= 420) {
|
||||
if (Velocities.trueAirspeedKtTemp >= 420) {
|
||||
Internal.bankLimitAuto = 15;
|
||||
} else if (Velocity.trueAirspeedKtTemp >= 340) {
|
||||
} else if (Velocities.trueAirspeedKtTemp >= 340) {
|
||||
Internal.bankLimitAuto = 20;
|
||||
} else {
|
||||
Internal.bankLimitAuto = 25;
|
||||
|
@ -396,7 +396,7 @@ var ITAF = {
|
|||
# Waypoint Advance Logic
|
||||
if (flightPlanController.num[2].getValue() > 0 and FPLN.activeTemp == 1) {
|
||||
if ((FPLN.currentWPTemp + 1) < flightPlanController.num[2].getValue()) {
|
||||
Velocity.groundspeedMps = Velocity.groundspeedKt.getValue() * 0.5144444444444;
|
||||
Velocities.groundspeedMps = Velocities.groundspeedKt.getValue() * 0.5144444444444;
|
||||
FPLN.wpFlyFrom = FPLN.currentWPTemp;
|
||||
if (FPLN.wpFlyFrom < 0) {
|
||||
FPLN.wpFlyFrom = 0;
|
||||
|
@ -414,7 +414,7 @@ var ITAF = {
|
|||
if (FPLN.maxBank > FPLN.maxBankLimit) {
|
||||
FPLN.maxBank = FPLN.maxBankLimit;
|
||||
}
|
||||
FPLN.radius = (Velocity.groundspeedMps * Velocity.groundspeedMps) / (9.81 * math.tan(FPLN.maxBank / 57.2957795131));
|
||||
FPLN.radius = (Velocities.groundspeedMps * Velocities.groundspeedMps) / (9.81 * math.tan(FPLN.maxBank / 57.2957795131));
|
||||
FPLN.deltaAngleRad = (180 - FPLN.deltaAngle) / 114.5915590262;
|
||||
FPLN.R = FPLN.radius / math.sin(FPLN.deltaAngleRad);
|
||||
FPLN.distCoeff = FPLN.deltaAngle * -0.011111 + 2;
|
||||
|
@ -740,7 +740,7 @@ var ITAF = {
|
|||
checkLNAV: func(t) {
|
||||
if (flightPlanController.num[2].getValue() > 0 and FPLN.active.getBoolValue() and Position.gearAglFt.getValue() >= 30) {
|
||||
me.activateLNAV();
|
||||
} else if (Output.lat.getValue() != 1 and t != 1) {
|
||||
} else if (FPLN.active.getBoolValue() and Output.lat.getValue() != 1 and t != 1) {
|
||||
Output.lnavArm.setBoolValue(1);
|
||||
me.armTextCheck();
|
||||
}
|
||||
|
@ -813,7 +813,7 @@ var ITAF = {
|
|||
},
|
||||
takeoffGoAround: func() {
|
||||
Output.vertTemp = Output.vert.getValue();
|
||||
if ((Output.vertTemp == 2 or Output.vertTemp == 6) and Velocity.indicatedAirspeedKt.getValue() >= 80) {
|
||||
if ((Output.vertTemp == 2 or Output.vertTemp == 6) and Velocities.indicatedAirspeedKt.getValue() >= 80) {
|
||||
if (Gear.wow1.getBoolValue() or Gear.wow2.getBoolValue()) {
|
||||
me.ap1Master(0);
|
||||
me.ap2Master(0);
|
||||
|
@ -825,7 +825,9 @@ var ITAF = {
|
|||
me.syncIAS();
|
||||
} else if (Gear.wow1Temp or Gear.wow2Temp) {
|
||||
me.athrMaster(1);
|
||||
me.setLatMode(5);
|
||||
if (Output.lat.getValue() != 5) { # Don't accidently disarm LNAV
|
||||
me.setLatMode(5);
|
||||
}
|
||||
me.setVertMode(7);
|
||||
Text.vert.setValue("T/O CLB");
|
||||
}
|
||||
|
@ -842,10 +844,10 @@ var ITAF = {
|
|||
}
|
||||
},
|
||||
syncIAS: func() {
|
||||
Input.ias.setValue(math.clamp(math.round(Velocity.indicatedAirspeedKt.getValue()), 100, 350));
|
||||
Input.ias.setValue(math.clamp(math.round(Velocities.indicatedAirspeedKt.getValue()), 100, 350));
|
||||
},
|
||||
syncMach: func() {
|
||||
Input.mach.setValue(math.clamp(math.round(Velocity.indicatedMach.getValue(), 0.001), 0.5, 0.82));
|
||||
Input.mach.setValue(math.clamp(math.round(Velocities.indicatedMach.getValue(), 0.001), 0.5, 0.82));
|
||||
},
|
||||
syncHDG: func() {
|
||||
Input.hdg.setValue(math.round(Internal.hdgPredicted.getValue())); # Switches to track automatically
|
||||
|
|
|
@ -1 +1 @@
|
|||
21
|
||||
22
|
Loading…
Add table
Reference in a new issue