Skip to content

Commit

Permalink
refactor(efb): culled a380x efb settings, replaced flypadInfo with ai…
Browse files Browse the repository at this point in the history
…rcraftContext (flybywiresim#9029)

* feat: culled 380 efb settings, replaced flypadInfo with aircraftContext

* feat: cabin hidden persisted lvar, removed pax ambience etc audio settings

* fix: remove unnecessary file

* feat: add pilot seat option

* chore: added comments
  • Loading branch information
2hwk authored Oct 15, 2024
1 parent 7b8a056 commit 0aff566
Show file tree
Hide file tree
Showing 18 changed files with 436 additions and 325 deletions.

This file was deleted.

38 changes: 38 additions & 0 deletions fbw-a32nx/src/systems/instruments/src/EFB/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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 = ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5529,13 +5529,13 @@

<Component ID="HOSE0816" Node="A380_CABIN">
<UseTemplate Name="ASOBO_GT_Visibility_Code">
<VISIBILITY_CODE>(L:XMLVar_HOSE0816:VISIBILITY , bool) 0 ==</VISIBILITY_CODE>
<VISIBILITY_CODE>(L:A380X_CABIN_HIDDEN, bool) 0 ==</VISIBILITY_CODE>
</UseTemplate>
</Component>

<Component ID="HAT03" Node="HAT03">
<UseTemplate Name="ASOBO_GT_MouseRect">
<CALLBACKCODE_DEFAULT_IM>(M:Event) 'LeftSingle' scmp 0 == if{ (L:XMLVar_HOSE0816:VISIBILITY , bool) ! (&gt;L:XMLVar_HOSE0816:VISIBILITY , bool) }</CALLBACKCODE_DEFAULT_IM>
<CALLBACKCODE_DEFAULT_IM>(M:Event) 'LeftSingle' scmp 0 == if{ (L:A380X_CABIN_HIDDEN, bool) ! (&gt;L:A380X_CABIN_HIDDEN, bool) }</CALLBACKCODE_DEFAULT_IM>
<MOUSEFLAGS>LeftSingle</MOUSEFLAGS>
<CURSOR>Hand</CURSOR>
</UseTemplate>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

This file was deleted.

42 changes: 42 additions & 0 deletions fbw-a380x/src/systems/instruments/src/EFB/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
}}
Expand Down
77 changes: 77 additions & 0 deletions fbw-common/src/systems/instruments/src/EFB/AircraftContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,55 @@ interface PerformanceCalculators {
landing: LandingPerformanceCalculator | null;
}

interface PushbackPage {
turnIndicatorTuningDefault: number;
}
interface SettingsPages {
autoCalloutsPage: React.ComponentType<any>;
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;
}

Expand All @@ -24,7 +67,41 @@ export const AircraftContext = createContext<AircraftEfbContext>({
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,
},
});
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
// 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';
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,
Expand Down Expand Up @@ -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);
Expand All @@ -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(
Expand Down
Loading

0 comments on commit 0aff566

Please sign in to comment.