diff --git a/fbw-a32nx/src/base/flybywire-aircraft-a320-neo/config/a32nx/a320-251n/flypad-misc.json5 b/fbw-a32nx/src/base/flybywire-aircraft-a320-neo/config/a32nx/a320-251n/flypad-misc.json5 deleted file mode 100644 index b65666f909a..00000000000 --- a/fbw-a32nx/src/base/flybywire-aircraft-a320-neo/config/a32nx/a320-251n/flypad-misc.json5 +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) 2024 FlyByWire Simulations -// SPDX-License-Identifier: GPL-3.0 -// ======================================================================================= -// This is part of the base flyPad configuration file for A320-251N -// Any keys prefixed by underscore (_) should be considered read-only and not overwritable. -// -// NOTE: * This is currently a WIP * ! The override functionality has not been completed yet ! -// -// ****** ! WARNING TO LIVERY MAKERS: DO NOT OVERRIDE THIS FILE ! ********** -// ****** ! WARNING TO LIVERY MAKERS: DO NOT OVERRIDE THIS FILE ! ********** -// ****** ! WARNING TO LIVERY MAKERS: DO NOT OVERRIDE THIS FILE ! ********** -// ****** ! WARNING TO LIVERY MAKERS: DO NOT OVERRIDE THIS FILE ! ********** -// -// Please follow the instructions in the documentation to create a new configuration file! -// ======================================================================================= -// Last updated: 2 April 2024 -{ - "configMajorVersion": 0, - "configMinorVersion": 1, - "_throttle": { - "numberOfAircraftThrottles": 2, - "axisOptions": [ - 1, - 2 - ], - "axisMapping": [ - [[1, 2]], // 1 - [[1], [2]], // 2 - ] - }, - "_pushback": { - "turnIndicatorTuningDefault": 1.35, // determined by testing - } -} diff --git a/fbw-a32nx/src/systems/instruments/src/EFB/index.tsx b/fbw-a32nx/src/systems/instruments/src/EFB/index.tsx index 42a8735add9..d903e957ffd 100644 --- a/fbw-a32nx/src/systems/instruments/src/EFB/index.tsx +++ b/fbw-a32nx/src/systems/instruments/src/EFB/index.tsx @@ -26,7 +26,45 @@ render( takeoff: new A320251NTakeoffPerformanceCalculator(), landing: new A320251NLandingCalculator(), }, + pushbackPage: { + turnIndicatorTuningDefault: 1.35, + }, settingsPages: { + audio: { + announcements: true, + boardingMusic: true, + engineVolume: true, + masterVolume: true, + windVolume: true, + ptuCockpit: true, + paxAmbience: true, + }, + // FIXME: just inject the aircraft options page from the aircraft context (or plugin in flypadOSv4). + pinProgram: { + latLonExtend: true, + paxSign: true, + rmpVhfSpacing: true, + satcom: true, + }, + realism: { + mcduKeyboard: true, + pauseOnTod: true, + pilotAvatars: true, + }, + sim: { + cones: true, + pilotSeat: false, + registrationDecal: true, + wheelChocks: true, + }, + throttle: { + numberOfAircraftThrottles: 2, + axisOptions: [1, 2], + axisMapping: [ + [[1, 2]], // 1 + [[1], [2]], // 2 + ], + }, autoCalloutsPage: AutomaticCallOutsPage, }, }} diff --git a/fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/aircraft.cfg b/fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/aircraft.cfg index d2290029d73..4f4a4983a7c 100644 --- a/fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/aircraft.cfg +++ b/fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/aircraft.cfg @@ -19,7 +19,7 @@ icao_engine_type = Jet icao_engine_count = 4 ; the A380-800 is the only WTC J aircraft but MSFS does not support J as far as we know ; @see https://skybrary.aero/articles/icao-wake-turbulence-category -icao_WTC = H +icao_WTC = H icao_generic = 0 [PILOT] @@ -104,7 +104,7 @@ left_hand_target = "" left_foot_target = "" right_foot_target = "" [FLTSIM.0] -Title = "Airbus A380X FlyByWire" +Title = "FlyByWire A380X" Model = "" Panel = "" Sound = "" diff --git a/fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/model/A380_COCKPIT.xml b/fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/model/A380_COCKPIT.xml index de2e6dd6e95..0fa0c060238 100644 --- a/fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/model/A380_COCKPIT.xml +++ b/fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/model/A380_COCKPIT.xml @@ -5529,13 +5529,13 @@ - (L:XMLVar_HOSE0816:VISIBILITY , bool) 0 == + (L:A380X_CABIN_HIDDEN, bool) 0 == - (M:Event) 'LeftSingle' scmp 0 == if{ (L:XMLVar_HOSE0816:VISIBILITY , bool) ! (>L:XMLVar_HOSE0816:VISIBILITY , bool) } + (M:Event) 'LeftSingle' scmp 0 == if{ (L:A380X_CABIN_HIDDEN, bool) ! (>L:A380X_CABIN_HIDDEN, bool) } LeftSingle Hand diff --git a/fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/systems.cfg b/fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/systems.cfg index d383be512c1..60931b90b97 100644 --- a/fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/systems.cfg +++ b/fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/systems.cfg @@ -777,3 +777,5 @@ LocalVar.74 = A380X_RMP_3_NAV_SEL LocalVarDefault.74 = 0 LocalVar.75 = A380X_RMP_3_INT_RAD LocalVarDefault.75 = 1 +LocalVar.76 = A380X_CABIN_HIDDEN +LocalVarDefault.76 = 0 diff --git a/fbw-a380x/src/base/flybywire-aircraft-a380-842/config/a380x/a380-842/airframe.json5 b/fbw-a380x/src/base/flybywire-aircraft-a380-842/config/a380x/a380-842/airframe.json5 index 5f4fee18a20..f1a20148a1c 100644 --- a/fbw-a380x/src/base/flybywire-aircraft-a380-842/config/a380x/a380-842/airframe.json5 +++ b/fbw-a380x/src/base/flybywire-aircraft-a380-842/config/a380x/a380-842/airframe.json5 @@ -19,8 +19,8 @@ "configMinorVersion": 1, "_variant": "A380-842", "_icao": "A388", - "_name": "Airbus A380", - "_engines": "RR Trent 972B-84", + "_name": "FBW A380X", + "_engines": "972B-84", "_developer": "FBW", "msnReference": "MSN 225", "weightVariant": "WV003", diff --git a/fbw-a380x/src/base/flybywire-aircraft-a380-842/config/a380x/a380-842/flypad-misc.json5 b/fbw-a380x/src/base/flybywire-aircraft-a380-842/config/a380x/a380-842/flypad-misc.json5 deleted file mode 100644 index ae56cbd1a15..00000000000 --- a/fbw-a380x/src/base/flybywire-aircraft-a380-842/config/a380x/a380-842/flypad-misc.json5 +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) 2024 FlyByWire Simulations -// SPDX-License-Identifier: GPL-3.0 -// ======================================================================================= -// This is part of the base flyPad configuration file for A380-842 -// Any keys prefixed by underscore (_) should be considered read-only and not overwritable. -// -// NOTE: * This is currently a WIP * ! The override functionality has not been completed yet ! -// -// ****** ! WARNING TO LIVERY MAKERS: DO NOT OVERRIDE THIS FILE ! ********** -// ****** ! WARNING TO LIVERY MAKERS: DO NOT OVERRIDE THIS FILE ! ********** -// ****** ! WARNING TO LIVERY MAKERS: DO NOT OVERRIDE THIS FILE ! ********** -// ****** ! WARNING TO LIVERY MAKERS: DO NOT OVERRIDE THIS FILE ! ********** -// -// Please follow the instructions in the documentation to create a new configuration file! -// ======================================================================================= -// Last updated: 2 April 2024 -{ - "configMajorVersion": 0, - "configMinorVersion": 1, - "_throttle": { - "numberOfAircraftThrottles": 4, - "axisOptions": [ - 1, - 2, - 4 - ], - "axisMapping": [ - [[1, 2, 3, 4]], // 1 - [[1, 2], [3, 4]], // 2 - [[1], [2], [3], [4]] // 4 - ] - }, - "_pushback": { - "turnIndicatorTuningDefault": 1.35, // determined by testing - } -} diff --git a/fbw-a380x/src/systems/instruments/src/EFB/index.tsx b/fbw-a380x/src/systems/instruments/src/EFB/index.tsx index 9bb89bf27de..edbf93d5168 100644 --- a/fbw-a380x/src/systems/instruments/src/EFB/index.tsx +++ b/fbw-a380x/src/systems/instruments/src/EFB/index.tsx @@ -23,7 +23,49 @@ render( takeoff: null, landing: null, }, + pushbackPage: { + turnIndicatorTuningDefault: 1.35, + }, settingsPages: { + audio: { + announcements: false, + boardingMusic: false, + engineVolume: true, + masterVolume: true, + windVolume: true, + ptuCockpit: false, + paxAmbience: false, + }, + // FIXME: just inject the aircraft options page from the aircraft context (or plugin in flypadOSv4). + pinProgram: { + paxSign: false, + satcom: false, + latLonExtend: false, + rmpVhfSpacing: false, + }, + realism: { + mcduKeyboard: false, + pauseOnTod: true, + pilotAvatars: false, + }, + sim: { + cones: false, + pilotSeat: true, + registrationDecal: false, // TODO FIXME: Enable when dynamic registration decal is completed + wheelChocks: false, + }, + throttle: { + numberOfAircraftThrottles: 4, + axisOptions: [1, 2, 4], + axisMapping: [ + [[1, 2, 3, 4]], // 1 + [ + [1, 2], + [3, 4], + ], // 2 + [[1], [2], [3], [4]], // 4 + ], + }, autoCalloutsPage: AutomaticCallOutsPage, }, }} diff --git a/fbw-common/src/systems/instruments/src/EFB/AircraftContext.ts b/fbw-common/src/systems/instruments/src/EFB/AircraftContext.ts index 17d1e8ea69b..80e58e1196d 100644 --- a/fbw-common/src/systems/instruments/src/EFB/AircraftContext.ts +++ b/fbw-common/src/systems/instruments/src/EFB/AircraftContext.ts @@ -10,12 +10,55 @@ interface PerformanceCalculators { landing: LandingPerformanceCalculator | null; } +interface PushbackPage { + turnIndicatorTuningDefault: number; +} interface SettingsPages { autoCalloutsPage: React.ComponentType; + audio: AudioOptions; + pinProgram: PinProgramOptions; + realism: RealismOptions; + sim: SimOptions; + throttle: ThrottleOptions; +} + +interface AudioOptions { + announcements: boolean; + boardingMusic: boolean; + masterVolume: boolean; + windVolume: boolean; + engineVolume: boolean; + paxAmbience: boolean; + ptuCockpit: boolean; +} +interface PinProgramOptions { + latLonExtend: boolean; + paxSign: boolean; + rmpVhfSpacing: boolean; + satcom: boolean; +} + +interface RealismOptions { + mcduKeyboard: boolean; + pauseOnTod: boolean; + pilotAvatars: boolean; +} + +interface SimOptions { + cones: boolean; + registrationDecal: boolean; + wheelChocks: boolean; + pilotSeat: boolean; } +interface ThrottleOptions { + numberOfAircraftThrottles: number; + axisOptions: number[]; + axisMapping: number[][][]; +} interface AircraftEfbContext { performanceCalculators: PerformanceCalculators; + pushbackPage: PushbackPage; settingsPages: SettingsPages; } @@ -24,7 +67,41 @@ export const AircraftContext = createContext({ takeoff: null, landing: null, }, + pushbackPage: { + turnIndicatorTuningDefault: 0, + }, settingsPages: { + audio: { + announcements: false, + boardingMusic: false, + engineVolume: false, + masterVolume: false, + windVolume: false, + ptuCockpit: false, + paxAmbience: false, + }, + pinProgram: { + latLonExtend: false, + paxSign: false, + rmpVhfSpacing: false, + satcom: false, + }, + realism: { + mcduKeyboard: false, + pauseOnTod: false, + pilotAvatars: false, + }, + sim: { + cones: false, + pilotSeat: false, + registrationDecal: false, + wheelChocks: false, + }, + throttle: { + numberOfAircraftThrottles: 0, + axisOptions: [], + axisMapping: [], + }, autoCalloutsPage: null, }, }); diff --git a/fbw-common/src/systems/instruments/src/EFB/Ground/Pages/Pushback/PushbackMap.tsx b/fbw-common/src/systems/instruments/src/EFB/Ground/Pages/Pushback/PushbackMap.tsx index 49d569a6b18..d0d3c7f82ff 100644 --- a/fbw-common/src/systems/instruments/src/EFB/Ground/Pages/Pushback/PushbackMap.tsx +++ b/fbw-common/src/systems/instruments/src/EFB/Ground/Pages/Pushback/PushbackMap.tsx @@ -2,7 +2,7 @@ // SPDX-License-Identifier: GPL-3.0 /* eslint-disable max-len */ -import React, { useEffect, useMemo, useState } from 'react'; +import React, { useContext, useEffect, useMemo, useState } from 'react'; import { useSimVar, MathUtils, AirframeType } from '@flybywiresim/fbw-sdk'; import { ZoomIn, ZoomOut } from 'react-bootstrap-icons'; import { IconPlane } from '@tabler/icons'; @@ -10,7 +10,7 @@ import { Coordinates } from 'msfs-geo'; import { computeDestinationPoint, getGreatCircleBearing } from 'geolib'; import getDistance from 'geolib/es/getPreciseDistance'; import { GeolibInputCoordinates } from 'geolib/es/types'; -import { BingMap, t, TooltipWrapper, useAppDispatch, useAppSelector } from '@flybywiresim/flypad'; +import { AircraftContext, BingMap, t, TooltipWrapper, useAppDispatch, useAppSelector } from '@flybywiresim/flypad'; import { setActualMapLatLon, setAircraftIconPosition, @@ -56,7 +56,7 @@ const TurningRadiusIndicator = ({ turningRadius }: TurningRadiusIndicatorProps) export const PushbackMap = () => { const dispatch = useAppDispatch(); const airframeInfo = useAppSelector((state) => state.config.airframeInfo); - const flypadInfo = useAppSelector((state) => state.config.flypadInfo); + const aircraftContext = useContext(AircraftContext); const [planeHeadingTrue] = useSimVar('PLANE HEADING DEGREES TRUE', 'degrees', 50); const [planeLatitude] = useSimVar('A:PLANE LATITUDE', 'degrees latitude', 50); const [planeLongitude] = useSimVar('A:PLANE LONGITUDE', 'degrees longitude', 50); @@ -71,7 +71,7 @@ export const PushbackMap = () => { 'number', 250, ); - const turnIndicatorTuningDefault = flypadInfo.pushback.turnIndicatorTuningDefault; + const turnIndicatorTuningDefault = aircraftContext.pushbackPage.turnIndicatorTuningDefault; // Reducer state for pushback const { mapRange, centerPlaneMode, actualMapLatLon, aircraftIconPosition } = useAppSelector( diff --git a/fbw-common/src/systems/instruments/src/EFB/Settings/Pages/AircraftOptionsPinProgramsPage.tsx b/fbw-common/src/systems/instruments/src/EFB/Settings/Pages/AircraftOptionsPinProgramsPage.tsx index 19a4b1fad83..c8dcc70cdbf 100644 --- a/fbw-common/src/systems/instruments/src/EFB/Settings/Pages/AircraftOptionsPinProgramsPage.tsx +++ b/fbw-common/src/systems/instruments/src/EFB/Settings/Pages/AircraftOptionsPinProgramsPage.tsx @@ -10,7 +10,7 @@ import { SelectGroup, SelectItem } from '../../UtilComponents/Form/Select'; import { SimpleInput } from '../../UtilComponents/Form/SimpleInput/SimpleInput'; import { ButtonType, SettingItem, SettingsPage } from '../Settings'; import { Toggle } from '../../UtilComponents/Form/Toggle'; -import { AircraftContext } from '../../AircraftContext'; +import { AircraftContext } from '@flybywiresim/flypad'; const basePinProgRoute = `/settings/${pathify('Aircraft Options / Pin Programs')}`; @@ -144,48 +144,53 @@ export const AircraftOptionsPinProgramsPage = () => { setIsisMetricAltitude(value ? 1 : 0)} /> - - - - {paxSignsButtons.map((button) => ( - setPaxSigns(button.setting)} - selected={paxSigns === button.setting} - > - {button.name} - - ))} - - - - - - {vhfSpacingButtons.map((button) => ( - setVhfSpacing(button.setting)} - selected={vhfSpacing === button.setting} - > - {button.name} - - ))} - - - - - - {latLonExtendedButtons.map((button) => ( - setLatLonExtended(button.setting)} - selected={latLonExtended === button.setting} - > - {button.name} - - ))} - - + {aircraftContext.settingsPages.pinProgram.paxSign && ( + + + {paxSignsButtons.map((button) => ( + setPaxSigns(button.setting)} + selected={paxSigns === button.setting} + > + {button.name} + + ))} + + + )} + + {aircraftContext.settingsPages.pinProgram.rmpVhfSpacing && ( + + + {vhfSpacingButtons.map((button) => ( + setVhfSpacing(button.setting)} + selected={vhfSpacing === button.setting} + > + {button.name} + + ))} + + + )} + + {aircraftContext.settingsPages.pinProgram.latLonExtend && ( + + + {latLonExtendedButtons.map((button) => ( + setLatLonExtended(button.setting)} + selected={latLonExtended === button.setting} + > + {button.name} + + ))} + + + )} @@ -200,10 +205,11 @@ export const AircraftOptionsPinProgramsPage = () => { ))} - - - setsatcomEnabled(value ? 1 : 0)} /> - + {aircraftContext.settingsPages.pinProgram.satcom && ( + + setsatcomEnabled(value ? 1 : 0)} /> + + )} { - // FIXME remove from A380 when we setup injection into this page + const aircraftContext = useContext(AircraftContext); const [ptuAudible, setPtuAudible] = usePersistentNumberProperty('SOUND_PTU_AUDIBLE_COCKPIT', 0); const [exteriorVolume, setExteriorVolume] = usePersistentNumberProperty('SOUND_EXTERIOR_MASTER', 0); const [engineVolume, setEngineVolume] = usePersistentNumberProperty('SOUND_INTERIOR_ENGINE', 0); @@ -36,81 +37,95 @@ export const AudioPage = () => { return ( - -
- setExteriorVolume(value - 50)} - onAfterChange={() => exteriorSliderRef.current.blur()} - /> - setExteriorVolume(Number.parseInt(value) - 50)} - number - /> -
-
+ {aircraftContext.settingsPages.audio.masterVolume && ( + +
+ setExteriorVolume(value - 50)} + onAfterChange={() => exteriorSliderRef.current.blur()} + /> + setExteriorVolume(Number.parseInt(value) - 50)} + number + /> +
+
+ )} - -
- setEngineVolume(value - 50)} - onAfterChange={() => engineSliderRef.current.blur()} - /> - setEngineVolume(Number.parseInt(value) - 50)} - number - /> -
-
+ {aircraftContext.settingsPages.audio.engineVolume && ( + +
+ setEngineVolume(value - 50)} + onAfterChange={() => engineSliderRef.current.blur()} + /> + setEngineVolume(Number.parseInt(value) - 50)} + number + /> +
+
+ )} - -
- setWindVolume(value - 50)} - onAfterChange={() => windSliderRef.current.blur()} - /> - setWindVolume(Number.parseInt(value) - 50)} - number - /> -
-
+ {aircraftContext.settingsPages.audio.windVolume && ( + +
+ setWindVolume(value - 50)} + onAfterChange={() => windSliderRef.current.blur()} + /> + setWindVolume(Number.parseInt(value) - 50)} + number + /> +
+
+ )} - - setPtuAudible(value ? 1 : 0)} /> - + {aircraftContext.settingsPages.audio.ptuCockpit && ( + + setPtuAudible(value ? 1 : 0)} /> + + )} - - setPassengerAmbienceEnabled(value ? 1 : 0)} /> - + {aircraftContext.settingsPages.audio.paxAmbience && ( + + setPassengerAmbienceEnabled(value ? 1 : 0)} /> + + )} - - setAnnouncementsEnabled(value ? 1 : 0)} /> - + {aircraftContext.settingsPages.audio.announcements && ( + + setAnnouncementsEnabled(value ? 1 : 0)} /> + + )} - - setBoardingMusicEnabled(value ? 1 : 0)} /> - + {aircraftContext.settingsPages.audio.boardingMusic && ( + + setBoardingMusicEnabled(value ? 1 : 0)} /> + + )}
); }; diff --git a/fbw-common/src/systems/instruments/src/EFB/Settings/Pages/RealismPage.tsx b/fbw-common/src/systems/instruments/src/EFB/Settings/Pages/RealismPage.tsx index edae051ddab..d8a70004c2a 100644 --- a/fbw-common/src/systems/instruments/src/EFB/Settings/Pages/RealismPage.tsx +++ b/fbw-common/src/systems/instruments/src/EFB/Settings/Pages/RealismPage.tsx @@ -1,7 +1,7 @@ // Copyright (c) 2023-2024 FlyByWire Simulations // SPDX-License-Identifier: GPL-3.0 -import React from 'react'; +import React, { useContext } from 'react'; import { usePersistentBooleanProperty, usePersistentNumberProperty, @@ -15,12 +15,15 @@ import { ButtonType, SettingGroup, SettingItem, SettingsPage } from '../Settings import { SelectGroup, SelectItem } from '../../UtilComponents/Form/Select'; import { SimpleInput } from '../../UtilComponents/Form/SimpleInput/SimpleInput'; +import { AircraftContext } from '@flybywiresim/flypad'; type SimVarButton = { simVarValue: number; }; export const RealismPage = () => { + const aircraftContext = useContext(AircraftContext); + const [adirsAlignTime, setAdirsAlignTime] = usePersistentProperty('CONFIG_ALIGN_TIME', 'REAL'); const [, setAdirsAlignTimeSimVar] = useSimVar('L:A32NX_CONFIG_ADIRS_IR_ALIGN_TIME', 'Enum', Number.MAX_SAFE_INTEGER); const [dmcSelfTestTime, setDmcSelfTestTime] = usePersistentProperty('CONFIG_SELF_TEST_TIME', '12'); @@ -111,62 +114,70 @@ export const RealismPage = () => { setRealisticTiller(value ? 1 : 0)} />
- - - setMcduInput(value)} /> - - - {mcduInput && ( - - { - if (!Number.isNaN(event) && parseInt(event) >= 5 && parseInt(event) <= 120) { - setMcduTimeout(event.trim()); - } - }} - /> + {aircraftContext.settingsPages.realism.mcduKeyboard && ( + + + setMcduInput(value)} /> - )} - + + {mcduInput && ( + + { + if (!Number.isNaN(event) && parseInt(event) >= 5 && parseInt(event) <= 120) { + setMcduTimeout(event.trim()); + } + }} + /> + + )} + + )} setFoEfis(value ? 1 : 0)} /> - - setPilotAvatar(value ? 1 : 0)} /> - + {aircraftContext.settingsPages.realism.pilotAvatars && ( + <> + + setPilotAvatar(value ? 1 : 0)} /> + - - setFirstOfficerAvatar(value ? 1 : 0)} /> - + + setFirstOfficerAvatar(value ? 1 : 0)} /> + + + )} - - - setPauseAtTod(value)} /> - - {pauseAtTod && ( - - { - if (!Number.isNaN(event) && parseInt(event) >= 0 && parseInt(event) <= 50.0) { - setTodOffset(parseFloat(event.trim())); - } - }} - /> + {aircraftContext.settingsPages.realism.pauseOnTod && ( + + + setPauseAtTod(value)} /> - )} - + {pauseAtTod && ( + + { + if (!Number.isNaN(event) && parseInt(event) >= 0 && parseInt(event) <= 50.0) { + setTodOffset(parseFloat(event.trim())); + } + }} + /> + + )} + + )} ); }; diff --git a/fbw-common/src/systems/instruments/src/EFB/Settings/Pages/SimOptionsPage.tsx b/fbw-common/src/systems/instruments/src/EFB/Settings/Pages/SimOptionsPage.tsx index cfd34a93d6b..d44116c89f5 100644 --- a/fbw-common/src/systems/instruments/src/EFB/Settings/Pages/SimOptionsPage.tsx +++ b/fbw-common/src/systems/instruments/src/EFB/Settings/Pages/SimOptionsPage.tsx @@ -2,7 +2,7 @@ // SPDX-License-Identifier: GPL-3.0 /* eslint-disable max-len */ -import React, { useState } from 'react'; +import React, { useContext, useState } from 'react'; import { DefaultPilotSeatConfig, PilotSeatConfig, @@ -20,8 +20,10 @@ import { SelectGroup, SelectItem } from '../../UtilComponents/Form/Select'; import { SimpleInput } from '../../UtilComponents/Form/SimpleInput/SimpleInput'; import { ThrottleConfig } from '../ThrottleConfig/ThrottleConfig'; +import { AircraftContext } from '@flybywiresim/flypad'; export const SimOptionsPage = () => { + const aircraftContext = useContext(AircraftContext); const [showThrottleSettings, setShowThrottleSettings] = useState(false); const [defaultBaro, setDefaultBaro] = usePersistentProperty('CONFIG_INIT_BARO_UNIT', 'AUTO'); @@ -155,13 +157,14 @@ export const SimOptionsPage = () => { }} /> - - - setDynamicRegistration(value ? '1' : '0')} - /> - + {aircraftContext.settingsPages.sim.registrationDecal && ( + + setDynamicRegistration(value ? '1' : '0')} + /> + + )} { /> - - { - setWheelChocksEnabled(value ? 1 : 0); - }} - /> - - - - { - setConesEnabled(value ? 1 : 0); - }} - /> - + {aircraftContext.settingsPages.sim.wheelChocks && ( + + { + setWheelChocksEnabled(value ? 1 : 0); + }} + /> + + )} + + {aircraftContext.settingsPages.sim.cones && ( + + { + setConesEnabled(value ? 1 : 0); + }} + /> + + )} - - - {pilotSeatButtons.map((button) => ( - setPilotSeat(button.setting)} - selected={pilotSeat === button.setting} - > - {button.name} - - ))} - - + {aircraftContext.settingsPages.sim.pilotSeat && ( + + + {pilotSeatButtons.map((button) => ( + setPilotSeat(button.setting)} + selected={pilotSeat === button.setting} + > + {button.name} + + ))} + + + )} )} setShowThrottleSettings(false)} /> diff --git a/fbw-common/src/systems/instruments/src/EFB/Settings/ThrottleConfig/ThrottleConfig.tsx b/fbw-common/src/systems/instruments/src/EFB/Settings/ThrottleConfig/ThrottleConfig.tsx index b356559045a..da4bb406699 100644 --- a/fbw-common/src/systems/instruments/src/EFB/Settings/ThrottleConfig/ThrottleConfig.tsx +++ b/fbw-common/src/systems/instruments/src/EFB/Settings/ThrottleConfig/ThrottleConfig.tsx @@ -2,16 +2,16 @@ // SPDX-License-Identifier: GPL-3.0 /* eslint-disable max-len */ -import React, { useEffect, useState } from 'react'; +import React, { useContext, useEffect, useState } from 'react'; import { usePersistentNumberProperty, useSimVar } from '@flybywiresim/fbw-sdk'; import { ExclamationCircleFill } from 'react-bootstrap-icons'; import { + AircraftContext, PromptModal, SelectGroup, SelectItem, t, Toggle, - useAppSelector, useModals, VerticalSelectGroup, } from '@flybywiresim/flypad'; @@ -40,10 +40,10 @@ interface ThrottleConfigProps { * @constructor */ export const ThrottleConfig = ({ isShown, onClose }: ThrottleConfigProps) => { - const flypadInfo = useAppSelector((state) => state.config.flypadInfo); + const aircraftContext = useContext(AircraftContext); // the number of throttles that are used in the aircraft (2 or 4) - const numberOfThrottles = flypadInfo.throttle.numberOfAircraftThrottles; + const numberOfThrottles = aircraftContext.settingsPages.throttle.numberOfAircraftThrottles; const [axisNum, setAxisNum] = usePersistentNumberProperty('THROTTLE_AXIS', numberOfThrottles); // this makes sure that the axis number is set to 2 when the A320 is selected when previously the A380 with 4 axis was used @@ -239,7 +239,7 @@ export const ThrottleConfig = ({ isShown, onClose }: ThrottleConfigProps) => { const axisSelectGroup = ( - {flypadInfo.throttle.axisOptions.map((option) => ( + {aircraftContext.settingsPages.throttle.axisOptions.map((option) => ( setAxisNum(option)}> {option} @@ -368,13 +368,13 @@ export const ThrottleConfig = ({ isShown, onClose }: ThrottleConfigProps) => { const getAxis = () => { switch (axisNum) { case 4: - if (flypadInfo.throttle.numberOfAircraftThrottles === 4) { + if (aircraftContext.settingsPages.throttle.numberOfAircraftThrottles === 4) { return fourAxis; } console.warn('A320 does not have 4 axis - defaulting to 2 axis'); return twoAxisA320; case 2: - if (flypadInfo.throttle.numberOfAircraftThrottles === 4) { + if (aircraftContext.settingsPages.throttle.numberOfAircraftThrottles === 4) { return twoAxisA380; } return twoAxisA320; diff --git a/fbw-common/src/systems/instruments/src/EFB/StatusBar/QuickControls.tsx b/fbw-common/src/systems/instruments/src/EFB/StatusBar/QuickControls.tsx index c6991c74736..6329a472a77 100644 --- a/fbw-common/src/systems/instruments/src/EFB/StatusBar/QuickControls.tsx +++ b/fbw-common/src/systems/instruments/src/EFB/StatusBar/QuickControls.tsx @@ -1,7 +1,7 @@ // Copyright (c) 2023-2024 FlyByWire Simulations // SPDX-License-Identifier: GPL-3.0 -import React, { FC, forwardRef, useCallback, useMemo, useRef, useState } from 'react'; +import React, { FC, forwardRef, useCallback, useContext, useMemo, useRef, useState } from 'react'; import { BrightnessHigh, BrightnessHighFill, @@ -33,6 +33,7 @@ import { t } from '../Localization/translation'; import { TooltipWrapper } from '../UtilComponents/TooltipWrapper'; import { PowerStates, usePower } from '../Efb'; import { PiAirplaneLandingFill } from 'react-icons/pi'; +import { AircraftContext } from '@flybywiresim/flypad'; interface QuickSettingsButtonProps { onClick: () => void; @@ -168,6 +169,7 @@ export const QuickControlsPane = ({ }: { setShowQuickControlsPane: (value: boolean) => void; }) => { + const aircraftContext = useContext(AircraftContext); const history = useHistory(); const power = usePower(); @@ -421,16 +423,18 @@ export const QuickControlsPane = ({ {/* Second Row */}
- - } - className={pauseAtTodStyle} - > - {t('QuickControls.PauseAtTod')}
- {pauseAtTodString} -
-
+ {aircraftContext.settingsPages.realism.pauseOnTod && ( + + } + className={pauseAtTodStyle} + > + {t('QuickControls.PauseAtTod')}
+ {pauseAtTodString} +
+
+ )} ', 'flypad-payload'); - const jsonMisc = await this.fetchVFSJson5(aircraft, variant, '', 'flypad-misc'); this.flypadInfo = { payload: { chartLimits: jsonPayload.chartLimits, planeCanvas: jsonPayload._canvas, seatDisplay: jsonPayload.seatDisplay, }, - throttle: jsonMisc._throttle, - pushback: jsonMisc._pushback, }; return this.flypadInfo; diff --git a/fbw-common/src/systems/shared/src/unifiedConfig.ts b/fbw-common/src/systems/shared/src/unifiedConfig.ts index aa8881abe18..fadd73faa27 100644 --- a/fbw-common/src/systems/shared/src/unifiedConfig.ts +++ b/fbw-common/src/systems/shared/src/unifiedConfig.ts @@ -53,27 +53,7 @@ export interface AirframeDimensions { */ export interface FlypadInfo { payload: PayloadFlypadInfo; - throttle: ThrottleFlypadInfo; - pushback: PushbackFlypadInfo; } - -export interface ThrottleFlypadInfo { - numberOfAircraftThrottles: number; - axisOptions: number[]; - axisMapping: ThrottleFlypadAxisMapping; -} - -export interface ThrottleFlypadAxisMapping { - 1?: number[][]; - 2?: number[][]; - 3?: number[][]; - 4?: number[][]; -} - -export interface PushbackFlypadInfo { - turnIndicatorTuningDefault: number; -} - export interface PayloadFlypadInfo { planeCanvas: PayloadPlaneCanvas; chartLimits: PayloadChartLimits;