diff --git a/Nasal/FMGC/FMGC-b.nas b/Nasal/FMGC/FMGC-b.nas index ee165741..6966271e 100644 --- a/Nasal/FMGC/FMGC-b.nas +++ b/Nasal/FMGC/FMGC-b.nas @@ -1066,7 +1066,7 @@ setlistener("/it-autoflight/input/vert", func() { # Mode Reversions setlistener(pts.Systems.Navigation.ADR.Output.overspeed, func(v) { - if (v.getBoolValue() and !Output.ap1.getBoolValue() and !Output.ap2.getBoolValue() and Output.athr.getBoolValue() and Modes.PFD.FMA.pitchMode.getValue() == "OP CLB" and Modes.PFD.FMA.throttle.getValue() == "THR CLB") { + if (v.getBoolValue() and !Output.ap1.getBoolValue() and !Output.ap2.getBoolValue() and Output.athr.getBoolValue() and Modes.PFD.FMA.pitchMode == "OP CLB" and Modes.PFD.FMA.throttleMode == "THR CLB") { Input.fd1.setValue(0); Input.fd2.setValue(0); ecam.aural[5].setBoolValue(0); @@ -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.throttleMode.getValue() == "THR IDLE") { + if (v.getBoolValue() and !Output.ap1.getBoolValue() and !Output.ap2.getBoolValue() and Output.athr.getBoolValue() and Modes.PFD.FMA.pitchMode == "OP DES" and Modes.PFD.FMA.throttleMode == "THR IDLE") { Input.fd1.setValue(0); Input.fd2.setValue(0); ecam.aural[5].setBoolValue(0); diff --git a/Nasal/FMGC/FMGC-c.nas b/Nasal/FMGC/FMGC-c.nas index 3328b797..4c47271b 100644 --- a/Nasal/FMGC/FMGC-c.nas +++ b/Nasal/FMGC/FMGC-c.nas @@ -75,6 +75,7 @@ var athrCallback = func(modeNode, timerNode) { } var setAthrArmed = func(value) { + if (Modes.PFD.FMA.athrArmed == value) { return; } Modes.PFD.FMA.athrArmed = value; if (Modes.PFD.FMA.athrMode != " ") { Modes.PFD.FMA.athrModeTime = pts.Sim.Time.elapsedSec.getValue(); @@ -137,36 +138,58 @@ var loopFMA = maketimer(0.05, func() { engout = systems.FADEC.engOut.getValue(); if (state1 == "TOGA" or state2 == "TOGA") { - setFmaText("throttleMode", " ", throttleModeCallback, "throttleModeTime"); + if (fmgc.Modes.PFD.FMA.throttleMode != " ") { + setFmaText("throttleMode", " ", throttleModeCallback, "throttleModeTime"); + } } else if ((state1 == "MAN THR" and systems.FADEC.manThrAboveMct[0]) or (state2 == "MAN THR" and systems.FADEC.manThrAboveMct[1])) { - setFmaText("throttleMode", " ", throttleModeCallback, "throttleModeTime"); + if (fmgc.Modes.PFD.FMA.throttleMode != " ") { + setFmaText("throttleMode", " ", throttleModeCallback, "throttleModeTime"); + } } else if ((state1 == "MCT" or state2 == "MCT") and !engout) { - setFmaText("throttleMode", " ", throttleModeCallback, "throttleModeTime"); + if (fmgc.Modes.PFD.FMA.throttleMode != " ") { + 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("throttleMode", " ", throttleModeCallback, "throttleModeTime"); + if (fmgc.Modes.PFD.FMA.throttleMode != " ") { + 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("throttleMode", Input.ktsMach.getValue() ? "MACH" : "SPEED", throttleModeCallback, "throttleModeTime"); + if (fmgc.Modes.PFD.FMA.throttleMode != Input.ktsMach.getValue() ? "MACH" : "SPEED") { + setFmaText("throttleMode", Input.ktsMach.getValue() ? "MACH" : "SPEED", throttleModeCallback, "throttleModeTime"); + } } else if (thr == 1) { - setFmaText("throttleMode", "THR IDLE", throttleModeCallback, "throttleModeTime"); + if (fmgc.Modes.PFD.FMA.throttleMode != "THR IDLE") { + setFmaText("throttleMode", "THR IDLE", throttleModeCallback, "throttleModeTime"); + } } else if (thr == 2) { if (state1 == "MCT" or state2 == "MCT" and engout) { - setFmaText("throttleMode", "THR MCT", throttleModeCallback, "throttleModeTime"); + if (fmgc.Modes.PFD.FMA.throttleMode != "THR MCT") { + setFmaText("throttleMode", "THR MCT", throttleModeCallback, "throttleModeTime"); + } } else if (state1 == "CL" or state2 == "CL") { - setFmaText("throttleMode", "THR CLB", throttleModeCallback, "throttleModeTime"); + if (fmgc.Modes.PFD.FMA.throttleMode != "THR CLB") { + setFmaText("throttleMode", "THR CLB", throttleModeCallback, "throttleModeTime"); + } } else { - setFmaText("throttleMode", "THR LVR", throttleModeCallback, "throttleModeTime"); + if (fmgc.Modes.PFD.FMA.throttleMode != "THR LVR") { + setFmaText("throttleMode", "THR LVR", throttleModeCallback, "throttleModeTime"); + } } } } else { - setFmaText("throttleMode", Input.ktsMach.getValue() ? "MACH" : "SPEED", throttleModeCallback, "throttleModeTime"); + if (fmgc.Modes.PFD.FMA.throttleMode != Input.ktsMach.getValue() ? "MACH" : "SPEED") { + setFmaText("throttleMode", Input.ktsMach.getValue() ? "MACH" : "SPEED", throttleModeCallback, "throttleModeTime"); + } } } else { - setFmaText("throttleMode", Input.ktsMach.getValue() ? "MACH" : "SPEED", throttleModeCallback, "throttleModeTime"); + if (fmgc.Modes.PFD.FMA.throttleMode != Input.ktsMach.getValue() ? "MACH" : "SPEED") { + setFmaText("throttleMode", Input.ktsMach.getValue() ? "MACH" : "SPEED", throttleModeCallback, "throttleModeTime"); + } } }