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/fcu): add TRUE indication on FCU when TRUE/MAG pb is pushed #9678

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
1 change: 1 addition & 0 deletions .github/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@
1. [ELEC] Improved elec system startup behaviour - @Gurgel100 (Pascal) - @saschl
1. [A380X] Improve pilot and copilot camera positions - @heclak (Heclak)
1. [A380X/EFIS] Illuminate ND range and mode selectors during light test - @BravoMike99 (bruno_pt99)
1. [A380X/FCU] Add TRUE indication on FCU when TRUE North reference is selected on AFS CP - @heclak (Heclak)

## 0.12.0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export class FcuDisplay extends DisplayComponent<FcuDisplayProps> {
<div id="Electricity" state={this.props.isHidden.map((v) => (v ? 'off' : 'on'))}>
<div id="LargeScreen">
<Speed />
<Heading />
<Heading bus={this.props.bus} />

<div id="AltVS">
<Altitude bus={this.props.bus} />
Expand Down
48 changes: 45 additions & 3 deletions fbw-a380x/src/systems/instruments/src/FCU/Components/Heading.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,58 @@
// Copyright (c) 2023-2024 FlyByWire Simulations
// SPDX-License-Identifier: GPL-3.0

import { DisplayComponent, FSComponent, VNode } from '@microsoft/msfs-sdk';
import {
ConsumerSubject,
DisplayComponent,
EventBus,
FSComponent,
MappedSubject,
SubscribableMapFunctions,
VNode,
} from '@microsoft/msfs-sdk';
import { FcuEvents } from 'instruments/src/FCU/Publishers/FcuPublisher';
import { OverheadEvents } from 'instruments/src/MsfsAvionicsCommon/providers/OverheadPublisher';

export interface HeadingProps {}
export interface HeadingProps {
readonly bus: EventBus;
}

export class Heading extends DisplayComponent<HeadingProps> {
private readonly sub = this.props.bus.getSubscriber<FcuEvents & OverheadEvents>();

private readonly isLightTestActive = ConsumerSubject.create(this.sub.on('ovhd_ann_lt_test_active'), false);
private readonly trueRefActive = ConsumerSubject.create(this.sub.on('fcu_push_true_ref'), false);

private readonly trueIndicatorActive = MappedSubject.create(
([isLightTest, trueRef]) => {
if (isLightTest) {
tracernz marked this conversation as resolved.
Show resolved Hide resolved
return true;
} else {
return trueRef;
}
},
this.isLightTestActive,
this.trueRefActive,
);

onAfterRender(node: VNode): void {
super.onAfterRender(node);
}

render(): VNode | null {
return (
<div id="Heading">
<svg width="100%" height="100%">
<text id="TRUE" class="Common Active " x="23%" y="20%">
<text
id="TRUE"
class={{
Common: true,
Active: this.trueIndicatorActive,
Inactive: this.trueIndicatorActive.map(SubscribableMapFunctions.not()),
}}
x="23%"
y="20%"
>
TRUE
</text>
<text id="HDG" class="Common Active" x="48%" y="20%">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,12 +222,10 @@ export class HeadingManager extends TemporaryHax implements Instrument {
this.isTRKMode = _isTRKMode;
this.showSelectedHeading = _showSelectedHeading;
this.currentValue = _value;
this.setTextElementActive(this.textTRUE, false);
this.setTextElementActive(this.textHDG, !this.isTRKMode);
this.setTextElementActive(this.textTRK, !!this.isTRKMode);
this.lightsTest = _lightsTest;
if (this.lightsTest) {
this.setTextElementActive(this.textTRUE, true);
this.setTextElementActive(this.textHDG, true);
this.setTextElementActive(this.textTRK, true);
this.setElementVisibility(this.signDegrees, true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ interface FcuBaseEvents {
fcu_trk_fpa_active: boolean;
fcu_left_navaid_mode: NavAidMode;
fcu_right_navaid_mode: NavAidMode;
fcu_push_true_ref: boolean;
}

type IndexedTopics = 'fcu_left_navaid_mode' | 'fcu_right_navaid_mode';
Expand Down Expand Up @@ -36,6 +37,7 @@ export class FcuPublisher extends SimVarPublisher<FcuEvents> {
'fcu_right_navaid_mode',
{ name: `L:A32NX_EFIS_R_NAVAID_#index#_MODE`, type: SimVarValueType.Enum, indexed: true },
],
['fcu_push_true_ref', { name: `L:A32NX_PUSH_TRUE_REF`, type: SimVarValueType.Bool }],
]);

super(simvars, bus, pacer);
Expand Down
Loading