Skip to content

Commit fc8d400

Browse files
fix(a32nx/fwc): move memos to fwc and fix logic (#10501)
* fix(a32nx/fwc): implement memo logic in fwc * fix(a32nx/fwc): fix missing memo inhibits * docs: changelog * fix: method call Co-authored-by: BravoMike99 <119708186+BravoMike99@users.noreply.github.com> * docs: fix fuel section title and missing linefeed --------- Co-authored-by: BravoMike99 <119708186+BravoMike99@users.noreply.github.com>
1 parent 262d692 commit fc8d400

File tree

4 files changed

+68
-130
lines changed

4 files changed

+68
-130
lines changed

.github/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
1. [A32NX/FWC] Improve CAB PR LO DIFF PR warning logic to avoid spurious warnings - @tracernz (Mike)
7070
1. [A32NX/FWS] Fixed stall warning not working - @tracernz (Mike)
7171
1. [A380X/MFD] Add initial implementation of D-ATIS page in ATCCOM - @heclak (Heclak)
72+
1. [A32NX/FWS] Fixed takeoff memo not working in flight phase 9 (after landing) - @tracernz (Mike)
7273

7374
## 0.14.0
7475

fbw-a32nx/docs/a320-simvars.md

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -292,14 +292,6 @@
292292
- Bool
293293
- Set to true in a non-cold and dark flight phase to skip the initial memorization step
294294

295-
- A32NX_FWC_TOMEMO
296-
- Bool
297-
- True when the FWC decides that the takeoff memo should be shown
298-
299-
- A32NX_FWC_LDGMEMO
300-
- Bool
301-
- True when the FWC decides that the landing memo should be shown
302-
303295
- A32NX_FWC_INHIBOVRD
304296
- Bool
305297
- True when the FWC decides that flight phase inhibits should be overridden (and ignored)
@@ -3934,7 +3926,8 @@ In the variables below, {number} should be replaced with one item in the set: {
39343926
- Percent
39353927
- Trim wheel position in percent
39363928

3937-
## Fuel ATA 28
3929+
## Fuel (ATA 28)
3930+
39383931
- A32NX_TOTAL_FUEL_QUANTITY
39393932
- Number in kilogramm
39403933
- The total physical quantity of fuel in the tanks

fbw-a32nx/src/systems/instruments/src/MCDU/legacy/A32NX_Core/A32NX_FWC.ts

Lines changed: 0 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// @ts-strict-ignore
22
import {
3-
Arinc429Register,
43
Arinc429Word,
54
NXLogicConfirmNode,
65
NXLogicMemoryNode,
@@ -9,13 +8,8 @@ import {
98

109
// FIXME move to PseudoFWC
1110
export class A32NX_FWC {
12-
// momentary
13-
private toConfigTest = false; // WTOCT
14-
1511
// persistent
1612
private flightPhase = null;
17-
private ldgMemo = null;
18-
private toMemo = null;
1913

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

49-
// ESDL 1. 0.180
50-
private memoTo_conf01 = new NXLogicConfirmNode(120, true); // CONF 01
51-
private memoTo_memo = new NXLogicMemoryNode(false);
52-
53-
// ESDL 1. 0.190
54-
private memoLdgMemo_conf01 = new NXLogicConfirmNode(1, true); // CONF 01
55-
private memoLdgMemo_inhibit = new NXLogicMemoryNode(false);
56-
private memoLdgMemo_conf02 = new NXLogicConfirmNode(10, true); // CONF 01
57-
private memoLdgMemo_below2000ft = new NXLogicMemoryNode(true);
58-
59-
// ESDL 1. 0.310
60-
private memoToInhibit_conf01 = new NXLogicConfirmNode(3, true); // CONF 01
61-
62-
// ESDL 1. 0.320
63-
private memoLdgInhibit_conf01 = new NXLogicConfirmNode(3, true); // CONF 01
64-
65-
private readonly ecpWarningButtonStatus = Arinc429Register.empty();
66-
6743
update(_deltaTime, _core) {
6844
this._updateFlightPhase(_deltaTime);
69-
this._updateButtons(_deltaTime);
70-
this._updateTakeoffMemo(_deltaTime);
71-
this._updateLandingMemo(_deltaTime);
72-
}
73-
74-
_updateButtons(_deltaTime) {
75-
this.ecpWarningButtonStatus.setFromSimVar('L:A32NX_ECP_WARNING_SWITCH_WORD');
76-
this.toConfigTest = this.ecpWarningButtonStatus.bitValue(18);
7745
}
7846

7947
_updateFlightPhase(_deltaTime) {
@@ -226,62 +194,4 @@ export class A32NX_FWC {
226194
this.flightPhase = flightPhase;
227195
SimVar.SetSimVarValue('L:A32NX_FWC_FLIGHT_PHASE', 'Enum', this.flightPhase || 0);
228196
}
229-
230-
_updateTakeoffMemo(_deltaTime) {
231-
/// FWC ESLD 1.0.180
232-
const setFlightPhaseMemo = this.flightPhase === 2 && this.toConfigTest;
233-
const resetFlightPhaseMemo =
234-
this.flightPhase === 10 || this.flightPhase === 3 || this.flightPhase === 1 || this.flightPhase === 6;
235-
const flightPhaseMemo = this.memoTo_memo.write(setFlightPhaseMemo, resetFlightPhaseMemo);
236-
237-
const eng1NotRunning = SimVar.GetSimVarValue('ENG N1 RPM:1', 'Percent') < 15;
238-
const eng2NotRunning = SimVar.GetSimVarValue('ENG N1 RPM:2', 'Percent') < 15;
239-
const toTimerElapsed = this.memoTo_conf01.write(!eng1NotRunning && !eng2NotRunning, _deltaTime);
240-
241-
this.toMemo = flightPhaseMemo || (this.flightPhase === 2 && toTimerElapsed);
242-
SimVar.SetSimVarValue('L:A32NX_FWC_TOMEMO', 'Bool', this.toMemo);
243-
}
244-
245-
_updateLandingMemo(_deltaTime) {
246-
const radioHeight1 = Arinc429Word.fromSimVarValue('L:A32NX_RA_1_RADIO_ALTITUDE');
247-
const radioHeight2 = Arinc429Word.fromSimVarValue('L:A32NX_RA_2_RADIO_ALTITUDE');
248-
const radioHeight1Invalid = radioHeight1.isFailureWarning() || radioHeight1.isNoComputedData();
249-
const radioHeight2Invalid = radioHeight2.isFailureWarning() || radioHeight2.isNoComputedData();
250-
const gearDownlocked = SimVar.GetSimVarValue('GEAR TOTAL PCT EXTENDED', 'percent') > 0.95;
251-
252-
// FWC ESLD 1.0.190
253-
const setBelow2000ft =
254-
(radioHeight1.value < 2000 && !radioHeight1Invalid) || (radioHeight2.value < 2000 && !radioHeight2Invalid);
255-
const resetBelow2000ft =
256-
(radioHeight1.value > 2200 || radioHeight1Invalid) && (radioHeight2.value > 2200 || radioHeight2Invalid);
257-
const memo2 = this.memoLdgMemo_below2000ft.write(setBelow2000ft, resetBelow2000ft);
258-
259-
const setInhibitMemo = this.memoLdgMemo_conf01.write(
260-
resetBelow2000ft && !radioHeight1Invalid && !radioHeight2Invalid,
261-
_deltaTime,
262-
);
263-
const resetInhibitMemo = !(this.flightPhase === 7 || this.flightPhase === 8 || this.flightPhase === 6);
264-
const memo1 = this.memoLdgMemo_inhibit.write(setInhibitMemo, resetInhibitMemo);
265-
266-
const showInApproach = memo1 && memo2 && this.flightPhase === 6;
267-
268-
const invalidRadioMemo = this.memoLdgMemo_conf02.write(
269-
radioHeight1Invalid && radioHeight2Invalid && gearDownlocked && this.flightPhase === 6,
270-
_deltaTime,
271-
);
272-
273-
this.ldgMemo = showInApproach || invalidRadioMemo || this.flightPhase === 8 || this.flightPhase === 7;
274-
SimVar.SetSimVarValue('L:A32NX_FWC_LDGMEMO', 'Bool', this.ldgMemo);
275-
}
276-
277-
hasAltitudeConstraint() {
278-
// FIXME SUSSY code reading an LVar that's never written
279-
if (
280-
Simplane.getAutoPilotAltitudeManaged() &&
281-
SimVar.GetSimVarValue('L:AP_CURRENT_TARGET_ALTITUDE_IS_CONSTRAINT', 'number') != 0
282-
) {
283-
return false;
284-
}
285-
return true;
286-
}
287197
}

0 commit comments

Comments
 (0)