1
0
Fork 0

DU: Fix bugs and issues in FMA

This commit is contained in:
Josh Davidson 2022-01-10 11:12:51 -05:00
parent 9cc8d5aa71
commit 666b45d067
5 changed files with 319 additions and 320 deletions

View file

@ -1320,7 +1320,7 @@ var canvas_pfd = {
if (notification.alphaFloor != 1 and notification.togaLk != 1) {
if (notification.athr and notification.engOut != 1 and (notification.thrust1 == "MAN" or notification.thrust1 == "CL") and (notification.thrust2 == "MAN" or notification.thrust2 == "CL")) {
me["FMA_thrust"].show();
if (fmgc.Modes.PFD.FMA.throttleBox and fmgc.Modes.PFD.FMA.throttle != " ") {
if (fmgc.Modes.PFD.FMA.throttleModeBox and fmgc.Modes.PFD.FMA.throttleMode != " ") {
me["FMA_thrust_box"].show();
} else {
me["FMA_thrust_box"].hide();
@ -1328,7 +1328,7 @@ var canvas_pfd = {
} else if (notification.athr and notification.engOut and (notification.thrust1 == "MAN" or notification.thrust1 == "CL" or (notification.thrust1 == "MAN THR" and !systems.FADEC.manThrAboveMct[0]) or (notification.thrust1 == "MCT" and notification.thrustLimit != "FLX")) and
(notification.thrust2 == "MAN" or notification.thrust2 == "CL" or (notification.thrust2 == "MAN THR" and !systems.FADEC.manThrAboveMct[1]) or (notification.thrust2 == "MCT" and notification.thrustLimit != "FLX"))) {
me["FMA_thrust"].show();
if (fmgc.Modes.PFD.FMA.throttleBox and fmgc.Modes.PFD.FMA.throttle != " ") {
if (fmgc.Modes.PFD.FMA.throttleModeBox and fmgc.Modes.PFD.FMA.throttleMode != " ") {
me["FMA_thrust_box"].show();
} else {
me["FMA_thrust_box"].hide();
@ -1691,7 +1691,7 @@ var canvas_pfd = {
me["FMA_combined"].hide();
me["FMA_combined_box"].hide();
if (fmgc.Modes.PFD.FMA.pitchModeBox and fmgc.Modes.PFD.FMA.pitchMode != " " and (notification.ap1 or notification.notification or val.fd1 or notification.fd2)) {
if (fmgc.Modes.PFD.FMA.pitchModeBox and fmgc.Modes.PFD.FMA.pitchMode != " " and (notification.ap1 or notification.ap2 or notification.fd1 or notification.fd2)) {
me["FMA_pitch_box"].show();
} else {
me["FMA_pitch_box"].hide();
@ -1700,20 +1700,20 @@ var canvas_pfd = {
if (fmgc.Modes.PFD.FMA.pitchModeArmed == " " and fmgc.Modes.PFD.FMA.pitchMode2Armed == " ") {
me["FMA_pitcharm_box"].hide();
} else {
if ((fmgc.Modes.PFD.FMA.pitchModeArmedBox or fmgc.Modes.PFD.FMA.pitchMode2ArmedBox) and (notification.ap1 or notification.notification or val.fd1 or notification.fd2)) {
if ((fmgc.Modes.PFD.FMA.pitchModeArmedBox or fmgc.Modes.PFD.FMA.pitchMode2ArmedBox) and (notification.ap1 or notification.ap2 or notification.fd1 or notification.fd2)) {
me["FMA_pitcharm_box"].show();
} else {
me["FMA_pitcharm_box"].hide();
}
}
if (fmgc.Modes.PFD.FMA.rollModeBox == 1 and fmgc.Modes.PFD.FMA.rollMode != " " and (notification.ap1 or notification.notification or val.fd1 or notification.fd2)) {
if (fmgc.Modes.PFD.FMA.rollModeBox == 1 and fmgc.Modes.PFD.FMA.rollMode != " " and (notification.ap1 or notification.ap2 or notification.fd1 or notification.fd2)) {
me["FMA_roll_box"].show();
} else {
me["FMA_roll_box"].hide();
}
if (fmgc.Modes.PFD.FMA.rollModeArmedBox == 1 and fmgc.Modes.PFD.FMA.rollModeArmed != " " and (notification.ap1 or notification.notification or val.fd1 or notification.fd2)) {
if (fmgc.Modes.PFD.FMA.rollModeArmedBox == 1 and fmgc.Modes.PFD.FMA.rollModeArmed != " " and (notification.ap1 or notification.ap2 or notification.fd1 or notification.fd2)) {
me["FMA_rollarm_box"].show();
} else {
me["FMA_rollarm_box"].hide();
@ -1727,7 +1727,7 @@ var canvas_pfd = {
me["FMA_thrust"].setText("TOGA LK");
me["FMA_thrust_box"].setColor(0.7333,0.3803,0);
} else {
me["FMA_thrust"].setText(sprintf("%s", fmgc.Modes.PFD.FMA.throttle));
me["FMA_thrust"].setText(sprintf("%s", fmgc.Modes.PFD.FMA.throttleMode));
me["FMA_thrust_box"].setColor(0.8078,0.8039,0.8078);
}

File diff suppressed because it is too large Load diff

Before

Width:  |  Height:  |  Size: 348 KiB

After

Width:  |  Height:  |  Size: 350 KiB

View file

@ -1077,7 +1077,7 @@ setlistener(pts.Systems.Navigation.ADR.Output.overspeed, func(v) {
}, 0, 0);
setlistener(pts.Systems.Navigation.ADR.Output.underspeed, func(v) {
if (v.getBoolValue() and !Output.ap1.getBoolValue() and !Output.ap2.getBoolValue() and Output.athr.getBoolValue() and Modes.PFD.FMA.pitchMode.getValue() == "OP DES" and Modes.PFD.FMA.throttle.getValue() == "THR IDLE") {
if (v.getBoolValue() and !Output.ap1.getBoolValue() and !Output.ap2.getBoolValue() and Output.athr.getBoolValue() and Modes.PFD.FMA.pitchMode.getValue() == "OP DES" and Modes.PFD.FMA.throttleMode.getValue() == "THR IDLE") {
Input.fd1.setValue(0);
Input.fd2.setValue(0);
ecam.aural[5].setBoolValue(0);
@ -1087,7 +1087,6 @@ setlistener(pts.Systems.Navigation.ADR.Output.underspeed, func(v) {
}
}, 0, 0);
setlistener("/sim/signals/fdm-initialized", func {
ITAF.init();
});

View file

@ -48,7 +48,7 @@ var Modes = {
pitchModeArmedTime: 0,
pitchMode2ArmedTime: 0,
pitchMode2ArmedBox: 0,
throttle: " ",
throttleMode: " ",
throttleModeBox: 0,
throttleModeTime: 0,
},
@ -98,7 +98,7 @@ var fma_init = func() {
setFmaText("pitchMode2Armed", " ", genericCallback, "pitchMode2ArmedTime");
setFmaText("rollMode", " ", genericCallback, "rollModeTime");
setFmaText("rollModeArmed", " ", genericCallback, "rollModeArmedTime");
setFmaText("throttle", " ", throttleModeCallback, "throttleModeTime");
setFmaText("throttleMode", " ", throttleModeCallback, "throttleModeTime");
Modes.PFD.FMA.apModeBox = 0;
Modes.PFD.FMA.athrModeBox = 0;
@ -129,36 +129,36 @@ var loopFMA = maketimer(0.05, func() {
engout = systems.FADEC.engOut.getValue();
if (state1 == "TOGA" or state2 == "TOGA") {
setFmaText("throttle", " ", throttleModeCallback, "throttleModeTime");
setFmaText("throttleMode", " ", throttleModeCallback, "throttleModeTime");
} else if ((state1 == "MAN THR" and systems.FADEC.manThrAboveMct[0]) or (state2 == "MAN THR" and systems.FADEC.manThrAboveMct[1])) {
setFmaText("throttle", " ", throttleModeCallback, "throttleModeTime");
setFmaText("throttleMode", " ", throttleModeCallback, "throttleModeTime");
} else if ((state1 == "MCT" or state2 == "MCT") and !engout) {
setFmaText("throttle", " ", throttleModeCallback, "throttleModeTime");
setFmaText("throttleMode", " ", throttleModeCallback, "throttleModeTime");
} else if (((state1 == "MAN THR" and !systems.FADEC.manThrAboveMct[0]) or (state2 == "MAN THR" and !systems.FADEC.manThrAboveMct[1])) and !engout) {
setFmaText("throttle", " ", throttleModeCallback, "throttleModeTime");
setFmaText("throttleMode", " ", throttleModeCallback, "throttleModeTime");
} else {
vert = Output.vert.getValue();
if (vert == 4 or vert >= 6 or vert <= 8) {
if (Output.ap1.getBoolValue() or Output.ap2.getBoolValue() or Output.fd1.getBoolValue() or Output.fd2.getBoolValue()) {
thr = Output.thrMode.getValue();
if (thr == 0) {
setFmaText("throttle", Input.ktsMach.getValue() ? "MACH" : "SPEED", throttleModeCallback, "throttleModeTime");
setFmaText("throttleMode", Input.ktsMach.getValue() ? "MACH" : "SPEED", throttleModeCallback, "throttleModeTime");
} else if (thr == 1) {
setFmaText("throttle", "THR IDLE", throttleModeCallback, "throttleModeTime");
setFmaText("throttleMode", "THR IDLE", throttleModeCallback, "throttleModeTime");
} else if (thr == 2) {
if (state1 == "MCT" or state2 == "MCT" and engout) {
setFmaText("throttle", "THR MCT", throttleModeCallback, "throttleModeTime");
setFmaText("throttleMode", "THR MCT", throttleModeCallback, "throttleModeTime");
} else if (state1 == "CL" or state2 == "CL") {
setFmaText("throttle", "THR CLB", throttleModeCallback, "throttleModeTime");
setFmaText("throttleMode", "THR CLB", throttleModeCallback, "throttleModeTime");
} else {
setFmaText("throttle", "THR LVR", throttleModeCallback, "throttleModeTime");
setFmaText("throttleMode", "THR LVR", throttleModeCallback, "throttleModeTime");
}
}
} else {
setFmaText("throttle", Input.ktsMach.getValue() ? "MACH" : "SPEED", throttleModeCallback, "throttleModeTime");
setFmaText("throttleMode", Input.ktsMach.getValue() ? "MACH" : "SPEED", throttleModeCallback, "throttleModeTime");
}
} else {
setFmaText("throttle", Input.ktsMach.getValue() ? "MACH" : "SPEED", throttleModeCallback, "throttleModeTime");
setFmaText("throttleMode", Input.ktsMach.getValue() ? "MACH" : "SPEED", throttleModeCallback, "throttleModeTime");
}
}

View file

@ -700,7 +700,7 @@ var masterFMGC = maketimer(0.2, func {
}
}
# Speeds
# Pull speeds from JSBsim
FMGCInternal.vsw = FMGCNodes.vs1g.getValue();
FMGCInternal.vls = FMGCNodes.vls.getValue();
FMGCInternal.vs1g_conf_0 = FMGCNodes.vs1gConf0.getValue();