Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
1. [A32NX/FWC] Improve CAB PR LO DIFF PR warning logic to avoid spurious warnings - @tracernz (Mike)
1. [A32NX/FWS] Fixed stall warning not working - @tracernz (Mike)
1. [A380X/MFD] Add initial implementation of D-ATIS page in ATCCOM - @heclak (Heclak)
1. [A32NX/FWS] Fixed takeoff memo not working in flight phase 9 (after landing) - @tracernz (Mike)

## 0.14.0

Expand Down
11 changes: 2 additions & 9 deletions fbw-a32nx/docs/a320-simvars.md
Original file line number Diff line number Diff line change
Expand Up @@ -292,14 +292,6 @@
- Bool
- Set to true in a non-cold and dark flight phase to skip the initial memorization step

- A32NX_FWC_TOMEMO
- Bool
- True when the FWC decides that the takeoff memo should be shown

- A32NX_FWC_LDGMEMO
- Bool
- True when the FWC decides that the landing memo should be shown

- A32NX_FWC_INHIBOVRD
- Bool
- True when the FWC decides that flight phase inhibits should be overridden (and ignored)
Expand Down Expand Up @@ -3934,7 +3926,8 @@ In the variables below, {number} should be replaced with one item in the set: {
- Percent
- Trim wheel position in percent

## Fuel ATA 28
## Fuel (ATA 28)

- A32NX_TOTAL_FUEL_QUANTITY
- Number in kilogramm
- The total physical quantity of fuel in the tanks
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// @ts-strict-ignore
import {
Arinc429Register,
Arinc429Word,
NXLogicConfirmNode,
NXLogicMemoryNode,
Expand All @@ -9,13 +8,8 @@ import {

// FIXME move to PseudoFWC
export class A32NX_FWC {
// momentary
private toConfigTest = false; // WTOCT

// persistent
private flightPhase = null;
private ldgMemo = null;
private toMemo = null;

// ESDL 1. 0. 60
private gndMemo = new NXLogicConfirmNode(1); // outptuts ZGND
Expand Down Expand Up @@ -46,34 +40,8 @@ export class A32NX_FWC {
private phase5Memo = new NXLogicTriggeredMonostableNode(120); // MTRIG 01
private phase67Memo = new NXLogicTriggeredMonostableNode(180); // MTRIG 02

// ESDL 1. 0.180
private memoTo_conf01 = new NXLogicConfirmNode(120, true); // CONF 01
private memoTo_memo = new NXLogicMemoryNode(false);

// ESDL 1. 0.190
private memoLdgMemo_conf01 = new NXLogicConfirmNode(1, true); // CONF 01
private memoLdgMemo_inhibit = new NXLogicMemoryNode(false);
private memoLdgMemo_conf02 = new NXLogicConfirmNode(10, true); // CONF 01
private memoLdgMemo_below2000ft = new NXLogicMemoryNode(true);

// ESDL 1. 0.310
private memoToInhibit_conf01 = new NXLogicConfirmNode(3, true); // CONF 01

// ESDL 1. 0.320
private memoLdgInhibit_conf01 = new NXLogicConfirmNode(3, true); // CONF 01

private readonly ecpWarningButtonStatus = Arinc429Register.empty();

update(_deltaTime, _core) {
this._updateFlightPhase(_deltaTime);
this._updateButtons(_deltaTime);
this._updateTakeoffMemo(_deltaTime);
this._updateLandingMemo(_deltaTime);
}

_updateButtons(_deltaTime) {
this.ecpWarningButtonStatus.setFromSimVar('L:A32NX_ECP_WARNING_SWITCH_WORD');
this.toConfigTest = this.ecpWarningButtonStatus.bitValue(18);
}

_updateFlightPhase(_deltaTime) {
Expand Down Expand Up @@ -226,62 +194,4 @@ export class A32NX_FWC {
this.flightPhase = flightPhase;
SimVar.SetSimVarValue('L:A32NX_FWC_FLIGHT_PHASE', 'Enum', this.flightPhase || 0);
}

_updateTakeoffMemo(_deltaTime) {
/// FWC ESLD 1.0.180
const setFlightPhaseMemo = this.flightPhase === 2 && this.toConfigTest;
const resetFlightPhaseMemo =
this.flightPhase === 10 || this.flightPhase === 3 || this.flightPhase === 1 || this.flightPhase === 6;
const flightPhaseMemo = this.memoTo_memo.write(setFlightPhaseMemo, resetFlightPhaseMemo);

const eng1NotRunning = SimVar.GetSimVarValue('ENG N1 RPM:1', 'Percent') < 15;
const eng2NotRunning = SimVar.GetSimVarValue('ENG N1 RPM:2', 'Percent') < 15;
const toTimerElapsed = this.memoTo_conf01.write(!eng1NotRunning && !eng2NotRunning, _deltaTime);

this.toMemo = flightPhaseMemo || (this.flightPhase === 2 && toTimerElapsed);
SimVar.SetSimVarValue('L:A32NX_FWC_TOMEMO', 'Bool', this.toMemo);
}

_updateLandingMemo(_deltaTime) {
const radioHeight1 = Arinc429Word.fromSimVarValue('L:A32NX_RA_1_RADIO_ALTITUDE');
const radioHeight2 = Arinc429Word.fromSimVarValue('L:A32NX_RA_2_RADIO_ALTITUDE');
const radioHeight1Invalid = radioHeight1.isFailureWarning() || radioHeight1.isNoComputedData();
const radioHeight2Invalid = radioHeight2.isFailureWarning() || radioHeight2.isNoComputedData();
const gearDownlocked = SimVar.GetSimVarValue('GEAR TOTAL PCT EXTENDED', 'percent') > 0.95;

// FWC ESLD 1.0.190
const setBelow2000ft =
(radioHeight1.value < 2000 && !radioHeight1Invalid) || (radioHeight2.value < 2000 && !radioHeight2Invalid);
const resetBelow2000ft =
(radioHeight1.value > 2200 || radioHeight1Invalid) && (radioHeight2.value > 2200 || radioHeight2Invalid);
const memo2 = this.memoLdgMemo_below2000ft.write(setBelow2000ft, resetBelow2000ft);

const setInhibitMemo = this.memoLdgMemo_conf01.write(
resetBelow2000ft && !radioHeight1Invalid && !radioHeight2Invalid,
_deltaTime,
);
const resetInhibitMemo = !(this.flightPhase === 7 || this.flightPhase === 8 || this.flightPhase === 6);
const memo1 = this.memoLdgMemo_inhibit.write(setInhibitMemo, resetInhibitMemo);

const showInApproach = memo1 && memo2 && this.flightPhase === 6;

const invalidRadioMemo = this.memoLdgMemo_conf02.write(
radioHeight1Invalid && radioHeight2Invalid && gearDownlocked && this.flightPhase === 6,
_deltaTime,
);

this.ldgMemo = showInApproach || invalidRadioMemo || this.flightPhase === 8 || this.flightPhase === 7;
SimVar.SetSimVarValue('L:A32NX_FWC_LDGMEMO', 'Bool', this.ldgMemo);
}

hasAltitudeConstraint() {
// FIXME SUSSY code reading an LVar that's never written
if (
Simplane.getAutoPilotAltitudeManaged() &&
SimVar.GetSimVarValue('L:AP_CURRENT_TARGET_ALTITUDE_IS_CONSTRAINT', 'number') != 0
) {
return false;
}
return true;
}
}
Loading
Loading