Skip to content

Commit

Permalink
Merge branch 'upstream-master' into lvar-api-provider
Browse files Browse the repository at this point in the history
  • Loading branch information
frankkopp committed May 29, 2024
2 parents b92e610 + 1a6e658 commit c219947
Show file tree
Hide file tree
Showing 53 changed files with 8,959 additions and 7,483 deletions.
7 changes: 6 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,12 @@ module.exports = {
tailwindcss: { groupByResponsive: true },
react: { version: 'detect' },
},
ignorePatterns: ['fbw-common/src/typings/*', 'fbw-a380x/*', 'fbw-ingamepanels-checklist-fix/*'],
ignorePatterns: [
'fbw-common/src/typings/*',
'fbw-a380x/*',
'fbw-ingamepanels-checklist-fix/*',
'!fbw-a380x/src/systems/instruments/src/PFD/*',
],
rules: {
'prettier/prettier': ['error', {}, { usePrettierrc: true }],

Expand Down
2 changes: 1 addition & 1 deletion fbw-a32nx/docs/a320-simvars.md
Original file line number Diff line number Diff line change
Expand Up @@ -3221,7 +3221,7 @@ In the variables below, {number} should be replaced with one item in the set: {
- The V_3 / F-Speed.
- Arinc429<Knots>

- A32NX_FAC_{number}_V_3
- A32NX_FAC_{number}_V_4
- The V_4 / S-Speed.
- Arinc429<Knots>

Expand Down
2 changes: 1 addition & 1 deletion fbw-a32nx/mach.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const imagePlugin = require('esbuild-plugin-inline-image');
const postCssPlugin = require('esbuild-style-plugin');
const postCssPlugin = require('esbuild-style-plugin-v2');
const tailwind = require('tailwindcss');
const postCssColorFunctionalNotation = require('postcss-color-functional-notation');
const postCssInset = require('postcss-inset');
Expand Down
5 changes: 4 additions & 1 deletion fbw-a32nx/src/systems/atsu/fmsclient/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
"moduleResolution": "node",
"target": "ESNext",
"noEmit": true,
"typeRoots": ["../../../../fbw-common/src/typings"]
"typeRoots": [
"../../../../fbw-common/src/typings",
"../../../../node_modules/@types",
]
},
"include": [
"src/**/*",
Expand Down
2 changes: 1 addition & 1 deletion fbw-a32nx/src/systems/instruments/src/DCDU/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ const DCDU: React.FC = () => {
const [state, setState] = useState(isColdAndDark ? DcduState.Off : DcduState.On);
const [systemStatusMessage, setSystemStatusMessage] = useState(MailboxStatusMessage.NoMessage);
const [systemStatusTimer, setSystemStatusTimer] = useState<number | null>(null);
const [screenTimeout, setScreenTimeout] = useState<number | null>(null);
const [screenTimeout, setScreenTimeout] = useState<ReturnType<typeof setTimeout> | null>(null);
const [messages, setMessages] = useState(new Map<number, DcduMessageBlock>());
const publisherRef = useRef<Publisher<AtsuMailboxMessages> | null>();
const messagesRef = useRef<Map<number, DcduMessageBlock>>();
Expand Down
2 changes: 1 addition & 1 deletion fbw-a32nx/src/systems/instruments/src/SD/Pages/Eng/Eng.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ const EngineColumn = ({ x, y, engineNumber, fadecOn }: ComponentPositionProps) =
setTempAmber(false);
}

let timeout: number;
let timeout: ReturnType<typeof setTimeout>;
if (engineOilTemperature > OIL_TEMP_HIGH_ADVISORY) {
timeout = setTimeout(() => {
if (engineOilTemperature > OIL_TEMP_HIGH_ADVISORY) {
Expand Down
23 changes: 19 additions & 4 deletions fbw-a32nx/src/systems/instruments/src/SD/Pages/Press/Press.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ export const PressPage: FC = () => {
}, [cabinAlt]);

const deltaPress = splitDecimals(MathUtils.clamp(deltaPsi, -9.9, 9.9));
// TODO: SDAC logic missing. Delta pressure is not available when the SDAC indication is not valid.
// This happens when both the CPCs and ADRs are not sending pressure information. Here we only check
// for CPC no computed data.
const deltaPressNotAvail = arincDeltaPsi.isNoComputedData();
const cax = 455;
const dpx = 110;
const y = 165;
Expand All @@ -77,19 +81,30 @@ export const PressPage: FC = () => {
<text className="Medium Center Cyan" x={dpx - 5} y="100">
PSI
</text>
<text className={`Huge End ${deltaPsi < -0.4 || deltaPsi >= 8.5 ? 'Amber' : 'Green'}`} x={dpx + 38} y={y + 25}>
<text
className={`Huge End ${deltaPsi < -0.4 || deltaPsi >= 8.5 ? 'Amber' : 'Green'} ${deltaPressNotAvail ? 'hide' : 'show'}`}
x={dpx + 38}
y={y + 25}
>
{deltaPress[0]}
</text>
<text className={`Huge End ${deltaPsi < -0.4 || deltaPsi >= 8.5 ? 'Amber' : 'Green'}`} x={dpx + 53} y={y + 25}>
<text
className={`Huge End ${deltaPsi < -0.4 || deltaPsi >= 8.5 ? 'Amber' : 'Green'} ${deltaPressNotAvail ? 'hide' : 'show'}`}
x={dpx + 53}
y={y + 25}
>
.
</text>
<text
className={`Standard End ${deltaPsi < -0.4 || deltaPsi >= 8.5 ? 'Amber' : 'Green'}`}
className={`Standard End ${deltaPsi < -0.4 || deltaPsi >= 8.5 ? 'Amber' : 'Green'} ${deltaPressNotAvail ? 'hide' : 'show'}`}
x={dpx + 63}
y={y + 25}
>
{deltaPress[1]}
</text>
<text className={`Standard End Amber ${deltaPressNotAvail ? 'show' : 'hide'}`} x={dpx + 53} y={y + 25}>
XX
</text>
<GaugeComponent x={dpx} y={y} radius={radius} startAngle={210} endAngle={50} visible className="Gauge">
<GaugeComponent x={dpx} y={y} radius={radius} startAngle={40} endAngle={50} visible className="Gauge Amber" />
<GaugeComponent
Expand Down Expand Up @@ -148,7 +163,7 @@ export const PressPage: FC = () => {
radius={radius}
startAngle={210}
endAngle={50}
className={`GaugeIndicator ${deltaPsi < -0.4 || deltaPsi >= 8.5 ? 'Amber' : ''}`}
className={`GaugeIndicator ${deltaPsi < -0.4 || deltaPsi >= 8.5 ? 'Amber' : ''} ${deltaPressNotAvail ? 'hide' : 'show'}`}
indicator
/>
</GaugeComponent>
Expand Down
5 changes: 4 additions & 1 deletion fbw-a32nx/src/systems/sentry-client/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
"moduleResolution": "node",
"target": "ESNext",
"noEmit": true,
"typeRoots": ["../../../../fbw-common/src/typings"]
"typeRoots": [
"../../../../fbw-common/src/typings",
"../../../../node_modules/@types",
]
},
"include": [
"src/**/*",
Expand Down
5 changes: 4 additions & 1 deletion fbw-a32nx/src/systems/simbridge-client/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
"moduleResolution": "node",
"target": "ESNext",
"noEmit": true,
"typeRoots": ["../../../../fbw-common/src/typings"]
"typeRoots": [
"../../../../fbw-common/src/typings",
"../../../../node_modules/@types",
]
},
"include": [
"src/**/*",
Expand Down
5 changes: 4 additions & 1 deletion fbw-a32nx/src/systems/tcas/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
"moduleResolution": "node",
"target": "ESNext",
"noEmit": true,
"typeRoots": ["../../../../fbw-common/src/typings"]
"typeRoots": [
"../../../../fbw-common/src/typings",
"../../../../node_modules/@types",
]
},
"include": [
"src/**/*",
Expand Down
3 changes: 2 additions & 1 deletion fbw-a32nx/src/systems/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"resolveJsonModule" : true,
"skipLibCheck": true,
"typeRoots": [
"../../../fbw-common/src/typings"
"../../../fbw-common/src/typings",
"../../../node_modules/@types",
],
"moduleResolution": "node",
"allowSyntheticDefaultImports": true,
Expand Down
14 changes: 10 additions & 4 deletions fbw-a32nx/src/wasm/systems/a320_systems/src/air_conditioning.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use systems::{
acs_controller::{AcscId, AirConditioningSystemController, Pack},
cabin_air::CabinAirSimulation,
cabin_pressure_controller::{CabinPressureController, CpcId},
pressure_valve::{OutflowValve, SafetyValve},
pressure_valve::{OutflowValve, SafetyValve, SafetyValveSignal},
AdirsToAirCondInterface, Air, AirConditioningOverheadShared, AirConditioningPack, CabinFan,
Channel, DuctTemperature, MixerUnit, OutflowValveSignal, OutletAir, OverheadFlowSelector,
PackFlowControllers, PressurizationConstants, PressurizationOverheadShared, TrimAirSystem,
Expand Down Expand Up @@ -696,6 +696,7 @@ struct A320PressurizationSystem {
cpc_interface: [PressurizationSystemInterfaceUnit; 2],
outflow_valve: [OutflowValve; 1], // Array to prepare for more than 1 outflow valve in A380
safety_valve: SafetyValve,
safety_valve_signal: SafetyValveSignal<A320PressurizationConstants>,
residual_pressure_controller: ResidualPressureController,
active_system: usize,

Expand Down Expand Up @@ -725,6 +726,7 @@ impl A320PressurizationSystem {
vec![ElectricalBusType::DirectCurrentBattery],
)],
safety_valve: SafetyValve::new(),
safety_valve_signal: SafetyValveSignal::new(),
residual_pressure_controller: ResidualPressureController::new(),
active_system: active as usize,

Expand Down Expand Up @@ -794,8 +796,12 @@ impl A320PressurizationSystem {
});
}

self.safety_valve
.update(context, &self.cpc[self.active_system - 1]);
self.safety_valve_signal.update(
context,
cabin_simulation.cabin_pressure(),
self.safety_valve.open_amount(),
);
self.safety_valve.update(context, &self.safety_valve_signal);

self.switch_active_system();

Expand Down Expand Up @@ -2628,7 +2634,7 @@ mod tests {
InternationalStandardAtmosphere::pressure_at_altitude(Length::default())
- Pressure::new::<psi>(10.),
)
.iterate(10);
.iterate(2);

assert!(test_bed.safety_valve_open_amount() > Ratio::default());
}
Expand Down
2 changes: 1 addition & 1 deletion fbw-a380x/mach.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const imagePlugin = require('esbuild-plugin-inline-image');
const postCssPlugin = require('esbuild-style-plugin');
const postCssPlugin = require('esbuild-style-plugin-v2');
const tailwind = require('tailwindcss');
const postCssColorFunctionalNotation = require('postcss-color-functional-notation');
const postCssInset = require('postcss-inset');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,20 @@ Night=233,166,134
Luminous=201,64,64

[VCockpit01]
size_mm=1536,1024
pixel_size=1536,1024
size_mm=1646,1024
pixel_size=1646,1024
texture=$SCREEN_DU_MFD

htmlgauge00=A380X/MFD/mfd.html?duID=2, 0,0,1536,1024
htmlgauge00=A380X/MFD/mfd.html?duID=2, 0,0,768,1024

; To enable both MFD screens without fms-v2 rpc sync, we map one texture across both screens,
; and render both MFD screens within one texture/instrument

; FIXME delete
[VCockpit02]
size_mm=768,1024
pixel_size=768,1024
texture=$SCREEN_DU_MFDR
texture=NO_TEXTURE

; No separate MFDR, see above

Expand Down Expand Up @@ -92,7 +93,8 @@ size_mm=512,512
pixel_size=512,512
texture=$ISIS2

htmlgauge00=A32NX/ISIS/isis.html, 0,0,512,512
;htmlgauge00=A32NX/ISIS/isis.html, 0,0,512,512
; FIXME re-enable second ISIS when A380X ISIS implementation is in place

[VCockpit12]
size_mm=256,256
Expand Down
5 changes: 4 additions & 1 deletion fbw-a380x/src/systems/atsu/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
"moduleResolution": "node",
"target": "ESNext",
"noEmit": true,
"typeRoots": ["../../typings"]
"typeRoots": [
"../../typings",
"../../../../node_modules/@types",
]
},
"include": [
"src/**/*",
Expand Down
8 changes: 5 additions & 3 deletions fbw-a380x/src/systems/fmgc/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
"moduleResolution": "node",
"target": "ESNext",
"noEmit": true,
"typeRoots": ["../../typings"]
"typeRoots": [
"../../typings",
"../../../../node_modules/@types",
]
},
"include": [
"src/**/*",
"../../typings/**/*.d.ts",
"../../node_modules/@types/jest/index.d.ts"
]
}
}
8 changes: 3 additions & 5 deletions fbw-a380x/src/systems/instruments/src/PFD/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
'use strict';

module.exports = {
extends: '../../../../../../.eslintrc.js',

extends: '../../../../../../.eslintrc.js',

// overrides airbnb, use sparingly
rules: { 'react/react-in-jsx-scope': 'off', 'react/no-unknown-property': 'off', 'react/style-prop-object': 'off' },

// overrides airbnb, use sparingly
rules: { 'react/react-in-jsx-scope': 'off', 'react/no-unknown-property': 'off', 'react/style-prop-object': 'off' },
};
Loading

0 comments on commit c219947

Please sign in to comment.