Skip to content

Commit f709a44

Browse files
mjuheGurgel100
andauthored
feat(press): a380 pressurization system (#8323)
* feat: initial rust implementation of 380 press * feat: system tunning and tests * feat: aft ofv close during takeoff * feat: climb pressurization schedule * feat: safety partition valves * feat: overpressure relief valves * feat: target cabin altitude * refactor: move ocm to local controllers folder * fix: tweak ofv controller constants * feat: fwc pressure signals * feat: instruments and vars * fix: final tweaks and fixes * fix: lint error * fix: review comments --------- Co-authored-by: Pascal Störzbach <Gurgel100@users.noreply.github.com>
1 parent 68bf940 commit f709a44

File tree

16 files changed

+1932
-677
lines changed

16 files changed

+1932
-677
lines changed

fbw-a380x/docs/a380-simvars.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,33 @@
171171
- FWD
172172
- AFT
173173

174+
- A32NX_VENT_OVERPRESSURE_RELIEF_VALVE_IS_OPEN
175+
- Bool
176+
- True when the Overpressure Relief Valve Dumps are open. There are two valves but just one variable for now as they (mostly) always open and close at the same time.
177+
178+
- A32NX_PRESS_CABIN_ALTITUDE_TARGET
179+
- Feet
180+
- Target cabin altitude as calculated by the pressurization system or manually selected on the overhead panel
181+
182+
- A32NX_PRESS_{id}_OCSM_CHANNEL_FAILURE
183+
- Number
184+
- 0 if no failure
185+
- 1 or 2 if single channel failure (for failed channel id)
186+
- 3 if dual channel failure
187+
- {id} 1 to 4
188+
189+
- A32NX_PRESS_DIFF_PRESS_HI
190+
- Bool
191+
- True when FWC condition for "DIFF PRESS HI" is met (differential pressure between 8.92 and 9.2 PSI)
192+
193+
- A32NX_PRESS_DIFF_PRESS_EXCESSIVE
194+
- Bool
195+
- True when FWC condition for "EXCESS DIFF PRESS" is met (differential pressure over 9.65 PSI)
196+
197+
- A32NX_PRESS_NEGATIVE_DIFF_PRESS_EXCESSIVE
198+
- Bool
199+
- True when FWC condition for "EXCESS NEGATIVE DIFF PRESS" is met (differential pressure lower than -0.72 PSI)
200+
174201
- A32NX_OVHD_COND_{id}_SELECTOR_KNOB
175202
- Number (0 to 300)
176203
- Rotation amount of the overhead temperature selectors for the cockpit and the cabin
@@ -216,6 +243,27 @@
216243
- Bool
217244
- True if the bulk cargo heater is failed
218245

246+
- A32NX_OVHD_PRESS_MAN_ALTITUDE_PB_IS_AUTO
247+
- Bool
248+
- True if the overhead manual altitude pushbutton is auto (no light)
249+
250+
- A32NX_OVHD_PRESS_MAN_ALTITUDE_KNOB
251+
- Feet
252+
- Value in feet of the manually selected cabin target altitude on the overhead panel
253+
254+
- A32NX_OVHD_PRESS_MAN_VS_CTL_PB_IS_AUTO
255+
- Bool
256+
- True if the overhead manual vertical speed pushbutton is auto (no light)
257+
258+
- A32NX_OVHD_PRESS_MAN_VS_CTL_KNOB
259+
- Feet per minute
260+
- Value in feet per minute of the manually selected cabin vertical speed on the overhead panel
261+
262+
- A32NX_OVHD_VENT_AIR_EXTRACT_PB_IS_ON
263+
- Bool
264+
- True if the overhead manual extract vent override pushbutton is on (illuminated)
265+
266+
219267
## Electrical ATA 24
220268

221269
- A32NX_ELEC_CONTACTOR_{name}_IS_CLOSED

fbw-a380x/src/systems/instruments/src/SD/Pages/Press/elements/CabAlt.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ export const CabAlt: React.FC<Position> = ({ x, y }) => {
77
const [cabinAlt] = useSimVar('L:A32NX_PRESS_CABIN_ALTITUDE', 'feet', 500);
88
const cabAlt50 = Math.round(cabinAlt / 50) * 50;
99

10-
const [cabManMode] = useSimVar('L:A32NX_CAB_PRESS_MODE_MAN', 'bool', 500);
10+
const [cabinAltTarget] = useSimVar('L:A32NX_PRESS_CABIN_ALTITUDE_TARGET', 'feet', 500);
11+
const cabAltTarget50 = Math.round(cabinAltTarget / 50) * 50;
12+
13+
const [cabAltAutoMode] = useSimVar('L:A32NX_OVHD_PRESS_MAN_ALTITUDE_PB_IS_AUTO', 'bool', 500);
1114

1215
const radius = 87;
1316
const startAngle = 212;
@@ -16,7 +19,7 @@ export const CabAlt: React.FC<Position> = ({ x, y }) => {
1619

1720
return (
1821
<g id="DeltaPressure">
19-
<text className="F29 LS1 Center Green" x={x - 117} y={y - 142}>{!cabManMode ? 'AUTO' : 'MAN'}</text>
22+
<text className="F29 LS1 Center Green" x={x - 117} y={y - 142}>{cabAltAutoMode ? 'AUTO' : 'MAN'}</text>
2023
<text className="F29 LS1 Center White" x={x - 26} y={y - 142}>CAB ALT</text>
2124
<text className="F24 Center Cyan" x={x - 10} y={y - 105}>FT</text>
2225
<text className={`F35 EndAlign ${cabAlt50 >= 9550 ? 'Red' : 'Green'}`} x={x + 108} y={y + 66}>
@@ -116,15 +119,15 @@ export const CabAlt: React.FC<Position> = ({ x, y }) => {
116119
multiplierOuter={1.01}
117120
/>
118121
<ThrottlePositionDonutComponent
119-
value={cabAlt50 / 1000} // TODO: Change this once we have cabin altitude target modelled
122+
value={cabAltTarget50 / 1000}
120123
x={x}
121124
y={y}
122125
min={-0.6}
123126
max={maxValue}
124127
radius={radius}
125128
startAngle={startAngle}
126129
endAngle={endAngle}
127-
className={`SW3 NoFill ${!cabManMode ? 'Magenta' : 'Cyan'}`}
130+
className={`SW3 NoFill ${cabAltAutoMode ? 'Magenta' : 'Cyan'}`}
128131
outerMultiplier={1.1}
129132
donutRadius={6}
130133
/>

fbw-a380x/src/systems/instruments/src/SD/Pages/Press/elements/CabinVerticalSpeed.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ import React from 'react';
55

66
const CabinVerticalSpeed: React.FC<Position> = ({ x, y }) => {
77
const [cabinVs] = useSimVar('L:A32NX_PRESS_CABIN_VS', 'feet per minute', 500);
8-
const cabinAltManMode = false;
8+
const [cabinVsTarget] = useSimVar('L:A32NX_PRESS_CABIN_VS_TARGET', 'feet per minute', 500);
9+
const [cabVsAutoMode] = useSimVar('L:A32NX_OVHD_PRESS_MAN_VS_CTL_PB_IS_AUTO', 'bool', 500);
910

1011
const radius = 88;
1112
const min = -2;
@@ -16,7 +17,7 @@ const CabinVerticalSpeed: React.FC<Position> = ({ x, y }) => {
1617
return (
1718
<>
1819
<g id="VsIndicator">
19-
<text className="F29 LS1 Center Green" x={x - 109} y={y - 142}>{!cabinAltManMode ? 'AUTO' : 'MAN'}</text>
20+
<text className="F29 LS1 Center Green" x={x - 109} y={y - 142}>{cabVsAutoMode ? 'AUTO' : 'MAN'}</text>
2021
<text className="F29 LS1 Center White" x={x - 15} y={y - 142}>V/S</text>
2122
<text className="F24 Center Cyan" x={x - 43} y={y - 105}>FT/MIN</text>
2223
<text className={`F35 EndAlign ${Math.abs(Math.round(cabinVs / 50) * 50) > 1800 ? 'GreenTextPulse' : 'Green'}`} x={x + 128} y={y + 13}>{Math.round(cabinVs / 50) * 50}</text>
@@ -104,15 +105,15 @@ const CabinVerticalSpeed: React.FC<Position> = ({ x, y }) => {
104105
multiplierOuter={1.01}
105106
/>
106107
<ThrottlePositionDonutComponent
107-
value={((cabinVs / 50) * 50) / 1000} // TODO: Change this once we have v/s target modelled
108+
value={((cabinVsTarget / 50) * 50) / 1000}
108109
x={x}
109110
y={y}
110111
min={min}
111112
max={max}
112113
radius={radius}
113114
startAngle={startAngle}
114115
endAngle={endAngle}
115-
className={`SW3 NoFill ${!cabinAltManMode ? 'Magenta' : 'Cyan'}`}
116+
className={`SW3 NoFill ${cabVsAutoMode ? 'Magenta' : 'Cyan'}`}
116117
outerMultiplier={1.1}
117118
donutRadius={6}
118119
/>

fbw-a380x/src/systems/instruments/src/SD/Pages/Press/elements/DeltaP.tsx

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@ export const DeltaP: React.FC<Position> = ({ x, y }) => {
77
const [deltaPsi] = useSimVar('L:A32NX_PRESS_CABIN_DELTA_PRESSURE', 'psi', 500);
88
const deltaPress = splitDecimals(deltaPsi);
99

10+
let colour;
11+
if (deltaPsi < -0.72 || deltaPsi > 9.2) {
12+
colour = `Red`
13+
} else if ((-0.72 <= deltaPsi && deltaPsi <= -0.2) || (8.92 <= deltaPsi && deltaPsi <= 9.2)) {
14+
colour = `Amber`
15+
} else {
16+
colour = `Green`
17+
};
18+
1019
const radius = 86;
1120
const startAngle = 205;
1221
const endAngle = 55;
@@ -15,11 +24,11 @@ export const DeltaP: React.FC<Position> = ({ x, y }) => {
1524
<g id="DeltaPressure">
1625
<text className="F29 LS1 Center White" x={x - 51} y={y - 142}>DELTA P</text>
1726
<text className="F24 Center Cyan" x={x - 18} y={y - 105}>PSI</text>
18-
<text className={`F35 End ${deltaPsi < -0.4 || deltaPsi >= 8.5 ? 'Amber' : 'Green'}`} x={x + 9} y={y + 48}>
27+
<text className={`F35 End ${colour}`} x={x + 9} y={y + 48}>
1928
{deltaPress[0]}
2029
</text>
21-
<text className={`F35 End ${deltaPsi < -0.4 || deltaPsi >= 8.5 ? 'Amber' : 'Green'}`} x={x + 29} y={y + 48}>.</text>
22-
<text className={`F35 End ${deltaPsi < -0.4 || deltaPsi >= 8.5 ? 'Amber' : 'Green'}`} x={x + 56} y={y + 48}>{deltaPress[1]}</text>
30+
<text className={`F35 End ${colour}`} x={x + 29} y={y + 48}>.</text>
31+
<text className={`F35 End ${colour}`} x={x + 56} y={y + 48}>{deltaPress[1]}</text>
2332
<GaugeComponent x={x} y={y} radius={radius} startAngle={startAngle} endAngle={endAngle} visible className="Gauge">
2433
<GaugeComponent x={x} y={y} radius={radius - 2} startAngle={endAngle - 15} endAngle={endAngle} visible className="GaugeComponent Gauge ThickRedLine" />
2534
<GaugeComponent x={x} y={y} radius={radius - 2} startAngle={endAngle - 30} endAngle={endAngle - 15} visible className="GaugeComponent Gauge ThickAmberLine" />
@@ -95,7 +104,7 @@ export const DeltaP: React.FC<Position> = ({ x, y }) => {
95104
radius={radius}
96105
startAngle={startAngle}
97106
endAngle={endAngle}
98-
className={`GaugeIndicator SW4 ${deltaPsi < -0.4 || deltaPsi >= 8.5 ? 'Amber' : ''}`}
107+
className={`GaugeIndicator SW4 ${colour}`}
99108
indicator
100109
multiplierOuter={1.01}
101110
/>

fbw-a380x/src/systems/instruments/src/SD/Pages/Press/elements/LandingElevation.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { Position } from '@instruments/common/types';
44

55

66
const LandingElevation: React.FC<Position> = ({ x, y }) => {
7-
const [landingElev] = useSimVar('L:A32NX_OVHD_PRESS_LDG_ELEV_KNOB', 'feet', 100);
7+
const [landingElev] = useSimVar('L:A32NX_FM1_LANDING_ELEVATION', 'feet', 100);
88

99
const ldgElevValue = Math.round(landingElev / 50) * 50;
1010

fbw-a380x/src/systems/instruments/src/SD/Pages/Press/elements/OutflowValve.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const OutflowValve: React.FC<Position & EngineNumber> = memo(({ x, y, engine })
77
const ofradius = 52;
88

99
const [flightPhase] = useSimVar('L:A32NX_FWC_FLIGHT_PHASE', 'enum', 1000);
10-
const [outflowValueOpenPercentage] = useSimVar('L:A32NX_PRESS_OUTFLOW_VALVE_OPEN_PERCENTAGE', 'percent', 500);
10+
const [outflowValueOpenPercentage] = useSimVar(`L:A32NX_PRESS_OUTFLOW_VALVE_${engine}_OPEN_PERCENTAGE`, 'percent', 500);
1111

1212
return (
1313
<>

fbw-a380x/src/systems/instruments/src/SD/Pages/Press/elements/Packs.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ import { PackNumber, Position } from '@instruments/common/types';
44
import React from 'react';
55

66
const Packs: React.FC<Position & PackNumber> = ({ pack, x, y }) => {
7-
const [packOpen] = useSimVar(`L:A32NX_COND_PACK_FLOW_VALVE_${pack}_IS_OPEN`, 'bool', 500);
7+
const [packValve1Open] = useSimVar(`L:A32NX_COND_PACK_${pack}_FLOW_VALVE_1_IS_OPEN`, 'bool', 500);
8+
const [packValve2Open] = useSimVar(`L:A32NX_COND_PACK_${pack}_FLOW_VALVE_2_IS_OPEN`, 'bool', 500);
9+
const packOpen = packValve1Open || packValve2Open;
810
const triangleColour = !packOpen ? 'Amber' : 'Green';
911
const packWordColour = !packOpen ? 'AmberFill' : 'WhiteFill';
1012

0 commit comments

Comments
 (0)