diff --git a/.github/CHANGELOG.md b/.github/CHANGELOG.md index e6fcd8ae2f6..79752e1c085 100644 --- a/.github/CHANGELOG.md +++ b/.github/CHANGELOG.md @@ -107,6 +107,7 @@ 1. [A380X/ENGINES] Adjust climb thrust to be more accurate - @BlueberryKing (BlueberryKing) 1. [A380X/EWD] Show THR limit in EWD instead of N1 - @flogross89 (floridude) 1. [A380X/FLIGHT MODEL] Fix pitchup and unrecoverable stall - - @donstim (donbikes#4084) +1. [A32NX/FWS] Fix autopilot instinctive disconnect button logic for 3D model - @flogross89 (floridude) ## 0.12.0 diff --git a/fbw-a32nx/src/systems/systems-host/systems/FWC/PseudoFWC.ts b/fbw-a32nx/src/systems/systems-host/systems/FWC/PseudoFWC.ts index 4266ca34ee1..d9f223eadec 100644 --- a/fbw-a32nx/src/systems/systems-host/systems/FWC/PseudoFWC.ts +++ b/fbw-a32nx/src/systems/systems-host/systems/FWC/PseudoFWC.ts @@ -125,6 +125,7 @@ export class PseudoFWC { public readonly recallButtonInputBuffer = new NXLogicMemoryNode(false); public readonly aThrDiscInputBuffer = new NXLogicMemoryNode(false); public readonly apDiscInputBuffer = new NXLogicMemoryNode(false); + public readonly takeoverPbInputBuffer = new NXLogicMemoryNode(false); /* PSEUDO FWC VARIABLES */ private readonly startupTimer = new DebounceTimer(); @@ -1263,6 +1264,13 @@ export class PseudoFWC { this.recallButtonInputBuffer.write(true, false); } + if ( + SimVar.GetSimVarValue('L:A32NX_PRIORITY_TAKEOVER:1', SimVarValueType.Bool) || + SimVar.GetSimVarValue('L:A32NX_PRIORITY_TAKEOVER:2', SimVarValueType.Bool) + ) { + this.takeoverPbInputBuffer.write(true, false); + } + // Enforce cycle time for the logic computation (otherwise pulse nodes would be broken) if (deltaTime === -1 || _deltaTime === 0) { return; @@ -1277,7 +1285,10 @@ export class PseudoFWC { this.clr2PulseNode.write(this.clearButtonInputBuffer.read(), deltaTime); this.rclUpPulseNode.write(this.recallButtonInputBuffer.read(), deltaTime); this.autoThrustInstinctiveDiscPressed.write(this.aThrDiscInputBuffer.read(), deltaTime); - this.autoPilotInstinctiveDiscPressedPulse.write(this.apDiscInputBuffer.read(), deltaTime); + this.autoPilotInstinctiveDiscPressedPulse.write( + this.apDiscInputBuffer.read() || this.takeoverPbInputBuffer.read(), + deltaTime, + ); // Inputs update this.flightPhaseEndedPulseNode.write(false, deltaTime); @@ -2904,6 +2915,7 @@ export class PseudoFWC { this.recallButtonInputBuffer.write(false, true); this.aThrDiscInputBuffer.write(false, true); this.apDiscInputBuffer.write(false, true); + this.takeoverPbInputBuffer.write(false, true); this.autoPilotInstinctiveDiscCountSinceLastFwsCycle = 0; } diff --git a/fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/model/behaviour/legacy/generated/A32NX_Interior_Misc.xml b/fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/model/behaviour/legacy/generated/A32NX_Interior_Misc.xml index b6cd9b765ce..afb32d4c23f 100644 --- a/fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/model/behaviour/legacy/generated/A32NX_Interior_Misc.xml +++ b/fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/model/behaviour/legacy/generated/A32NX_Interior_Misc.xml @@ -382,11 +382,7 @@ %((L:A32NX_AUTOPILOT_ACTIVE, Bool))%{if}Disc. Autopilot%{else}Take priority%{end} - (L:A32NX_AUTOPILOT_ACTIVE, Bool) if{ - (>K:AUTOPILOT_OFF) - } els{ - 1 (>L:A32NX_PRIORITY_TAKEOVER:#ID#) - } + 1 (>L:A32NX_PRIORITY_TAKEOVER:#ID#) 0 (>L:A32NX_PRIORITY_TAKEOVER:#ID#) diff --git a/fbw-a380x/src/systems/systems-host/systems/FlightWarningSystem/FwsCore.ts b/fbw-a380x/src/systems/systems-host/systems/FlightWarningSystem/FwsCore.ts index 9d4cf36fa3b..71b4a4297c3 100644 --- a/fbw-a380x/src/systems/systems-host/systems/FlightWarningSystem/FwsCore.ts +++ b/fbw-a380x/src/systems/systems-host/systems/FlightWarningSystem/FwsCore.ts @@ -206,6 +206,7 @@ export class FwsCore { public readonly clDownInputBuffer = new NXLogicMemoryNode(false); public readonly aThrDiscInputBuffer = new NXLogicMemoryNode(false); public readonly apDiscInputBuffer = new NXLogicMemoryNode(false); + public readonly takeoverPbInputBuffer = new NXLogicMemoryNode(false); /* PSEUDO FWC VARIABLES */ @@ -1816,6 +1817,13 @@ export class FwsCore { this.clDownInputBuffer.write(true, false); } + if ( + SimVar.GetSimVarValue('L:A32NX_PRIORITY_TAKEOVER:1', SimVarValueType.Bool) || + SimVar.GetSimVarValue('L:A32NX_PRIORITY_TAKEOVER:2', SimVarValueType.Bool) + ) { + this.takeoverPbInputBuffer.write(true, false); + } + // Enforce cycle time for the logic computation (otherwise pulse nodes would be broken) if (deltaTime === -1 || _deltaTime === 0) { return; @@ -1839,7 +1847,10 @@ export class FwsCore { this.clUpPulseNode.write(this.clUpInputBuffer.read(), deltaTime); this.clDownPulseNode.write(this.clDownInputBuffer.read(), deltaTime); this.autoThrustInstinctiveDiscPressed.write(this.aThrDiscInputBuffer.read(), deltaTime); - this.autoPilotInstinctiveDiscPressedPulse.write(this.apDiscInputBuffer.read(), deltaTime); + this.autoPilotInstinctiveDiscPressedPulse.write( + this.apDiscInputBuffer.read() || this.takeoverPbInputBuffer.read(), + deltaTime, + ); // Inputs update this.flightPhaseEndedPulseNode.write(false, deltaTime); @@ -4143,6 +4154,7 @@ export class FwsCore { this.clDownInputBuffer.write(false, true); this.aThrDiscInputBuffer.write(false, true); this.apDiscInputBuffer.write(false, true); + this.takeoverPbInputBuffer.write(false, true); this.autoPilotInstinctiveDiscCountSinceLastFwsCycle = 0; } diff --git a/fbw-a380x/src/wasm/fbw_a380/src/FlyByWireInterface.cpp b/fbw-a380x/src/wasm/fbw_a380/src/FlyByWireInterface.cpp index 5850fa32186..c6409e24790 100644 --- a/fbw-a380x/src/wasm/fbw_a380/src/FlyByWireInterface.cpp +++ b/fbw-a380x/src/wasm/fbw_a380/src/FlyByWireInterface.cpp @@ -2141,7 +2141,8 @@ bool FlyByWireInterface::updateAutopilotStateMachine(double sampleTime) { autopilotStateMachineInput.in.input.AP_ENGAGE_push = simInputAutopilot.AP_engage; autopilotStateMachineInput.in.input.AP_1_push = simInputAutopilot.AP_1_push; autopilotStateMachineInput.in.input.AP_2_push = simInputAutopilot.AP_2_push; - autopilotStateMachineInput.in.input.AP_DISCONNECT_push = simInputAutopilot.AP_disconnect || wasInSlew || doDisconnect; + autopilotStateMachineInput.in.input.AP_DISCONNECT_push = simInputAutopilot.AP_disconnect || idCaptPriorityButtonPressed->get() || + idFoPriorityButtonPressed->get() || wasInSlew || doDisconnect; autopilotStateMachineInput.in.input.HDG_push = simInputAutopilot.HDG_push; autopilotStateMachineInput.in.input.HDG_pull = simInputAutopilot.HDG_pull; autopilotStateMachineInput.in.input.ALT_push = simInputAutopilot.ALT_push;