Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(a380x/ois): Initial implementation #9778

Open
wants to merge 30 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
0f13a86
OIT initial commit
flogross89 Jan 17, 2025
39e85c5
first stub
flogross89 Jan 18, 2025
d3e2bdb
Merge branch 'master' into feat-a380x-ois-initial
flogross89 Jan 18, 2025
b60a62b
Merge branch 'master' into feat-a380x-ois-initial
flogross89 Jan 19, 2025
be54fa5
Merge branch 'master' into feat-a380x-ois-initial
flogross89 Jan 20, 2025
c3ff935
update paths
flogross89 Jan 20, 2025
6e2bec0
styles, failures
flogross89 Jan 20, 2025
c0a0b0d
Merge branch 'master' into feat-a380x-ois-initial
flogross89 Jan 20, 2025
de89893
menu revamp, introduce performance pages
flogross89 Jan 20, 2025
b88f801
STS page first implementation
flogross89 Jan 20, 2025
eb3f6cc
SYNCHRO AVIONICS
flogross89 Jan 20, 2025
3b4d0c4
style tweaks
flogross89 Jan 20, 2025
64646d4
update PERF pages
flogross89 Jan 20, 2025
958d84a
first try at charts
flogross89 Jan 21, 2025
6579f63
squeeze space
flogross89 Jan 21, 2025
555aa69
weird style import to override EFB styles in OIT + OFP page
flogross89 Jan 21, 2025
6a3284e
fix exports
flogross89 Jan 21, 2025
560d669
FMS/simbrief sync
flogross89 Jan 22, 2025
fd21331
enable FUNCTIONS -> HOME/PREVIOUS
flogross89 Jan 22, 2025
7a2f320
Merge branch 'master' into feat-a380x-ois-initial
flogross89 Jan 22, 2025
292d500
disable right OIT
flogross89 Jan 22, 2025
1b52356
failures rename
flogross89 Jan 22, 2025
02ed928
small stuff
flogross89 Jan 22, 2025
c7ee6db
add loading screen
flogross89 Jan 22, 2025
1d69bee
Merge branch 'master' into feat-a380x-ois-initial
flogross89 Jan 22, 2025
e138ccd
fix imports
flogross89 Jan 22, 2025
a94dc02
smaller logo
flogross89 Jan 23, 2025
fcf4a99
reload hint after linking
flogross89 Jan 24, 2025
f8f77ad
Merge branch 'master' into feat-a380x-ois-initial
flogross89 Feb 1, 2025
281af25
sub cleanup, progress bar fix
flogross89 Feb 1, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion fbw-a380x/mach.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,12 @@ module.exports = {
msfsAvionicsInstrument('ND'),
msfsAvionicsInstrument('PFD'),
msfsAvionicsInstrument('RMP'),
msfsAvionicsInstrument('OIT'),

reactInstrument('BAT'),
reactInstrument('EFB', ['/Pages/VCockpit/Instruments/Shared/Map/MapInstrument.html']),
reactInstrument('ISISlegacy'),
reactInstrument('OIT'),
reactInstrument('OITlegacy'),
reactInstrument('RTPI'),
reactInstrument('SD'),
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -357,14 +357,26 @@
</Component>
</Component>

<!-- FIXME I don't know the bus for this yet -->
<!-- FIXME wrong node -->
<!-- FIXME backlight missing -->
<!-- OIT_L -->
<Component ID="OITL">
<Component ID="SCREEN_OITL">
<UseTemplate Name="ASOBO_GT_Material_Emissive_Code">
<NODE_ID>EFB</NODE_ID>
<EMISSIVE_CODE>0.75</EMISSIVE_CODE>
<UseTemplate Name="ASOBO_GT_Component_Emissive_Gauge">
<NODE_ID>SCREEN_OIT_LEFT</NODE_ID>
<POTENTIOMETER>81</POTENTIOMETER>
<EMISSIVE_CODE>(L:A32NX_ELEC_AC_2_BUS_IS_POWERED, Bool)</EMISSIVE_CODE>
</UseTemplate>
</Component>
</Component>

<!-- FIXME backlight missing -->
<!-- OIT_R -->
<Component ID="OITR">
<Component ID="SCREEN_OITR">
<UseTemplate Name="ASOBO_GT_Component_Emissive_Gauge">
<NODE_ID>SCREEN_OIT_RIGHT</NODE_ID>
<POTENTIOMETER>82</POTENTIOMETER>
<EMISSIVE_CODE>(L:A32NX_ELEC_AC_ESS_BUS_IS_POWERED, Bool)</EMISSIVE_CODE>
</UseTemplate>
</Component>
</Component>
Expand All @@ -388,7 +400,6 @@
</Component>

<!-- EFB -->

<Component ID="EFB">
<Component ID="SCREEN_EFB" Node="SCREEN_EFB">
<DefaultTemplateParameters>
Expand Down Expand Up @@ -1245,11 +1256,18 @@
<!-- CPT MFD POTENTIOMETER -->
<UseTemplate Name="FBW_Stepless_Potentiometer">
<NODE_ID>KNOB_EFIS_CS_MFD</NODE_ID>
<PART_ID>ND_Brightness</PART_ID>
<ANIMTIP_0>TT:COCKPIT.TOOLTIPS.LIGHTING_KNOB_L_MFD_DECREASE</ANIMTIP_0>
<ANIMTIP_1>TT:COCKPIT.TOOLTIPS.LIGHTING_KNOB_L_MFD_INCREASE</ANIMTIP_1>
<POTENTIOMETER>98</POTENTIOMETER>
</UseTemplate>

<!-- CPT OIT POTENTIOMETER -->
<UseTemplate Name="FBW_Stepless_Potentiometer">
<NODE_ID>KNOB_EFIS_CS_OIT</NODE_ID>
<ANIMTIP_0>TT:COCKPIT.TOOLTIPS.LIGHTING_KNOB_L_OIT_DECREASE</ANIMTIP_0>
<ANIMTIP_1>TT:COCKPIT.TOOLTIPS.LIGHTING_KNOB_L_OIT_INCREASE</ANIMTIP_1>
<POTENTIOMETER>81</POTENTIOMETER>
</UseTemplate>
</Component>

<UseTemplate Name="FBW_Airbus_Push_EFIS_GPWS">
Expand Down Expand Up @@ -1392,6 +1410,15 @@
<ANIMTIP_1>TT:COCKPIT.TOOLTIPS.LIGHTING_KNOB_R_MFD_INCREASE</ANIMTIP_1>
<POTENTIOMETER>99</POTENTIOMETER>
</UseTemplate>

<!-- CPT OIT POTENTIOMETER -->
<UseTemplate Name="FBW_Stepless_Potentiometer">
<NODE_ID>KNOB_EFIS_FO_OIT</NODE_ID>
<PART_ID>OIT_Brightness_FO</PART_ID>
<ANIMTIP_0>TT:COCKPIT.TOOLTIPS.LIGHTING_KNOB_L_OIT_DECREASE</ANIMTIP_0>
<ANIMTIP_1>TT:COCKPIT.TOOLTIPS.LIGHTING_KNOB_L_OIT_INCREASE</ANIMTIP_1>
<POTENTIOMETER>82</POTENTIOMETER>
</UseTemplate>
</Component>

<!-- DCDU -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,23 @@ texture=SCREEN_DU_RMP_3
htmlgauge00=A380X/RMP/rmp.html?Index=3, 0,0,1664,1024

[VCockpit19]
size_mm=1333,1000
pixel_size=1333,1000
texture=$SCREEN_OIT_LEFT

htmlgauge00=A380X/OIT/oit.html?Index=1, 0,0,1333,1000
htmlgauge01=A380X/OITlegacy/oitlegacy.html, 0,0,1333,1000

[VCockpit20]
size_mm=1333,1000
pixel_size=1333,1000
texture=$SCREEN_OIT_RIGHT

; Right OIT UV mapping broken; disable for now
;htmlgauge00=A380X/OIT/oit.html?Index=2, 0,0,1333,1000
;htmlgauge01=A380X/OITlegacy/oitlegacy.html, 0,0,1333,1000

[VCockpit21]
size_mm=0,0
pixel_size=0,0
texture=NO_TEXTURE
Expand All @@ -160,15 +177,15 @@ htmlgauge01=WasmInstrument/WasmInstrument.html?wasm_module=fbw.wasm&wasm_gauge=f
htmlgauge02=WasmInstrument/WasmInstrument.html?wasm_module=fadec-a380x.wasm&wasm_gauge=Gauge_Fadec,0,0,1,1
htmlgauge03=WasmInstrument/WasmInstrument.html?wasm_module=extra-backend-a380x.wasm&wasm_gauge=Gauge_Extra_Backend,0,0,1,1

[VCockpit20]
[VCockpit22]
size_mm=0,0
pixel_size=0,0
texture=NO_TEXTURE
background_color=0,0,0

htmlgauge00=A380X/SystemsHost/systems-host.html,0,0,1,1

[VCockpit21]
[VCockpit23]
size_mm=0,0
pixel_size=0,0
texture=NO_TEXTURE
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions fbw-a380x/src/systems/failures/src/a380.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,14 @@ export const A380Failure = Object.freeze({

Transponder1: 34003,
Transponder2: 34004,

NssAnsu1: 46001,
NssAnsu2: 46002,
FltOpsAnsu: 46003,
CaptainLaptop: 46004,
FirstOfficerLaptop: 46005,
CaptainOit: 46006,
FirstOfficerOit: 46007,
});

export const A380FailureDefinitions: FailureDefinition[] = [
Expand Down Expand Up @@ -329,4 +337,12 @@ export const A380FailureDefinitions: FailureDefinition[] = [
[34, A380Failure.RadioAntennaDirectCoupling3, 'RA SYS C Direct Coupling'],
[34, A380Failure.Transponder1, 'XPDR 1'],
[34, A380Failure.Transponder2, 'XPDR 2'],

[46, A380Failure.NssAnsu1, 'NSS AVNCS ANSU 1'],
[46, A380Failure.NssAnsu2, 'NSS AVNCS ANSU 2'],
[46, A380Failure.FltOpsAnsu, 'FLT OPS ANSU'],
[46, A380Failure.CaptainLaptop, 'Captain Laptop'],
[46, A380Failure.FirstOfficerLaptop, 'F/O Laptop'],
[46, A380Failure.CaptainOit, 'Captain OIT'],
[46, A380Failure.FirstOfficerOit, 'F/O OIT'],
];
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: GPL-3.0

import { ConsumerValue, EventBus, GameStateProvider, SimVarValueType, Subject, UnitType } from '@microsoft/msfs-sdk';
import { Arinc429SignStatusMatrix, Arinc429Word, FmsOansData, MathUtils } from '@flybywiresim/fbw-sdk';
import { Arinc429SignStatusMatrix, Arinc429Word, FmsData, MathUtils } from '@flybywiresim/fbw-sdk';
import { FlapConf } from '@fmgc/guidance/vnav/common';
import { FlightPlanService } from '@fmgc/index';
import { MmrRadioTuningStatus } from '@fmgc/navigation/NavaidTuner';
Expand Down Expand Up @@ -495,29 +495,49 @@ export class FmcAircraftInterface {
return phase > FmgcFlightPhase.Cruise || (phase === FmgcFlightPhase.Cruise && isCloseToDestination);
}

updateOansAirports() {
if (this.flightPlanService.hasActive) {
const pub = this.bus.getPublisher<FmsOansData>();
if (this.flightPlanService.active?.originAirport?.ident) {
pub.pub('fmsOrigin', this.flightPlanService.active.originAirport.ident, true);
}
updateFmsData() {
const pub = this.bus.getPublisher<FmsData>();
pub.pub(
'fmsOrigin',
this.flightPlanService.hasActive && this.flightPlanService.active?.originAirport?.ident
? this.flightPlanService.active.originAirport.ident
: null,
true,
);

if (this.flightPlanService.active?.originRunway?.ident) {
pub.pub('fmsDepartureRunway', this.flightPlanService.active.originRunway.ident, true);
}
pub.pub(
'fmsDepartureRunway',
this.flightPlanService.hasActive && this.flightPlanService.active?.originRunway?.ident
? this.flightPlanService.active.originRunway.ident
: null,
true,
);

if (this.flightPlanService.active?.destinationAirport?.ident) {
pub.pub('fmsDestination', this.flightPlanService.active.destinationAirport.ident, true);
}
pub.pub(
'fmsDestination',
this.flightPlanService.hasActive && this.flightPlanService.active?.destinationAirport?.ident
? this.flightPlanService.active.destinationAirport.ident
: null,
true,
);

if (this.flightPlanService.active?.destinationRunway?.ident) {
pub.pub('fmsLandingRunway', this.flightPlanService.active.destinationRunway.ident, true);
}
pub.pub(
'fmsLandingRunway',
this.flightPlanService.hasActive && this.flightPlanService.active?.destinationRunway?.ident
? this.flightPlanService.active.destinationRunway.ident
: null,
true,
);

if (this.flightPlanService.active?.alternateDestinationAirport?.ident) {
pub.pub('fmsAlternate', this.flightPlanService.active.alternateDestinationAirport.ident, true);
}
}
pub.pub(
'fmsAlternate',
this.flightPlanService.hasActive && this.flightPlanService.active?.alternateDestinationAirport?.ident
? this.flightPlanService.active.alternateDestinationAirport.ident
: null,
true,
);

pub.pub('fmsFlightNumber', this.fmgc.data.atcCallsign.get(), true);
}

activatePreSelSpeedMach(preSel: number) {
Expand Down
3 changes: 2 additions & 1 deletion fbw-a380x/src/systems/instruments/src/MFD/MFD.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@ import { DisplayInterface } from '@fmgc/flightplanning/interface/DisplayInterfac
import { FmsErrorType } from '@fmgc/FmsError';
import { FmcServiceInterface } from 'instruments/src/MFD/FMC/FmcServiceInterface';
import { CdsDisplayUnit, DisplayUnitID } from '../MsfsAvionicsCommon/CdsDisplayUnit';
import { InteractionMode, InternalKccuKeyEvent, MfdSimvars } from './shared/MFDSimvarPublisher';
import { InternalKccuKeyEvent, MfdSimvars } from './shared/MFDSimvarPublisher';
import { MfdFmsPageNotAvail } from 'instruments/src/MFD/pages/FMS/MfdFmsPageNotAvail';

import './pages/common/style.scss';
import { InteractionMode } from 'instruments/src/MsfsAvionicsCommon/UiWidgets/InputField';

export const getDisplayIndex = () => {
const url = document.getElementsByTagName('a380x-mfd')[0].getAttribute('url');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export class DestinationWindow extends DisplayComponent<DestinationWindowProps>
this.props.fmcService.master.revisedWaypointPlanIndex.get() ?? undefined,
this.props.fmcService.master.revisedWaypointIsAltn.get() ?? undefined,
);
this.props.fmcService.master?.acInterface.updateOansAirports();
this.props.fmcService.master?.acInterface.updateFmsData();
}
this.props.visible.set(false);
this.newDest.set('');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ export function getRevisionsMenu(fpln: MfdFmsFpln, type: FplnRevisionsMenuType):
disabled: false,
onPressed: () => {
fpln.props.fmcService.master?.flightPlanService.enableAltn(legIndex, planIndex);
fpln.props.fmcService.master?.acInterface.updateOansAirports();
fpln.props.fmcService.master?.acInterface.updateFmsData();
},
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ export class MfdFmsInit extends FmsPage<MfdFmsInitProps> {
} else {
this.disconnectFromNetworks();
}
this.props.fmcService.master?.acInterface.updateFmsData();
this.loadedFlightPlan?.setFlightNumber(c);
});
}

Expand Down Expand Up @@ -235,7 +237,7 @@ export class MfdFmsInit extends FmsPage<MfdFmsInitProps> {
toIcao,
this.altnIcao.get() ?? undefined,
);
this.props.fmcService.master?.acInterface.updateOansAirports();
this.props.fmcService.master?.acInterface.updateFmsData();
}
}

Expand All @@ -250,7 +252,7 @@ export class MfdFmsInit extends FmsPage<MfdFmsInitProps> {
console.error(e);
logTroubleshootingError(this.props.bus, e);
}
this.props.fmcService.master?.acInterface.updateOansAirports();
this.props.fmcService.master?.acInterface.updateFmsData();
this.props.fmcService.master.fmgc.data.atcCallsign.set(this.simBriefOfp?.callsign ?? '----------');

// Don't insert weights for now, something seems broken here
Expand Down Expand Up @@ -387,7 +389,7 @@ export class MfdFmsInit extends FmsPage<MfdFmsInitProps> {
this.altnIcao.set(v);
if (v) {
await this.props.fmcService.master?.flightPlanService.setAlternate(v);
this.props.fmcService.master?.acInterface.updateOansAirports();
this.props.fmcService.master?.acInterface.updateFmsData();
}
}}
mandatory={Subject.create(true)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ export abstract class FmsPage<T extends AbstractMfdPageProps> extends DisplayCom
}
}

this.props.fmcService.master?.acInterface.updateOansAirports();
this.props.fmcService.master?.acInterface.updateFmsData();
}

public destroy(): void {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,6 @@ export type InternalKccuKeyEvent = {
kccuKeyEvent: string;
};

export enum InteractionMode {
Touchscreen,
Kccu,
}

export enum MfdVars {
coldDark = 'L:A32NX_COLD_AND_DARK_SPAWN',
elec = 'L:A32NX_ELEC_AC_ESS_BUS_IS_POWERED',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ import {
Subscription,
VNode,
} from '@microsoft/msfs-sdk';
import { InputField } from 'instruments/src/MsfsAvionicsCommon/UiWidgets/InputField';
import { InputField, InteractionMode } from 'instruments/src/MsfsAvionicsCommon/UiWidgets/InputField';
import { DropdownFieldFormat } from 'instruments/src/MFD/pages/common/DataEntryFormats';
import { InteractionMode } from 'instruments/src/MFD/shared/MFDSimvarPublisher';

interface DropdownMenuProps extends ComponentProps {
values: SubscribableArray<string>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ interface IconButtonProps extends ComponentProps {
| 'double-down'
| 'double-left'
| 'double-right'
| 'single-up'
| 'single-down'
| 'single-left'
| 'single-right'
| 'ecl-single-up'
| 'ecl-single-down'
| 'ecl-check'
Expand Down Expand Up @@ -118,6 +122,34 @@ export class IconButton extends DisplayComponent<IconButtonProps> {
</g>
</svg>
)}
{this.props.icon === 'single-up' && (
<svg width="35" viewBox="0 0 35 35" xmlns="http://www.w3.org/2000/svg">
<g ref={this.svgGroupRef} fill={this.fillColor}>
<polygon points="0,25 17.5,7.5 35,25" />
</g>
</svg>
)}
{this.props.icon === 'single-down' && (
<svg width="35" viewBox="0 0 35 35" xmlns="http://www.w3.org/2000/svg">
<g ref={this.svgGroupRef} fill={this.fillColor} transform="rotate(180 17.5 17.5)">
<polygon points="0,25 17.5,7.5 35,25" />
</g>
</svg>
)}
{this.props.icon === 'single-left' && (
<svg width="35" height="35" xmlns="http://www.w3.org/2000/svg">
<g ref={this.svgGroupRef} fill={this.fillColor} transform="rotate(270 17.5 17.5)">
<polygon points="0,25 17.5,7.5 35,25" />
</g>
</svg>
)}
{this.props.icon === 'single-right' && (
<svg width="35" height="35" xmlns="http://www.w3.org/2000/svg">
<g ref={this.svgGroupRef} fill={this.fillColor} transform="rotate(90 17.5 17.5)">
<polygon points="0,25 17.5,7.5 35,25" />
</g>
</svg>
)}
{this.props.icon === 'ecl-single-up' && (
<svg width="35" viewBox="0 0 35 35" xmlns="http://www.w3.org/2000/svg">
<g ref={this.svgGroupRef} fill-opacity="0.0" stroke={this.fillColor} stroke-width="3">
Expand Down
Loading