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(pfd): (a380x, third try): Add vertical deviation indicator, ROW/ROP/OANS warnings v3 #8734

Merged
Merged
Show file tree
Hide file tree
Changes from 48 commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
6749d0e
linting
flogross89 Apr 1, 2024
e8b91af
port LinearDeviationIndicator from a32nx PFD
flogross89 Apr 1, 2024
84a27dc
add PFD warnings for ROW, ROP, OANS
flogross89 Apr 1, 2024
5ffda3d
add speed margins to a380x
flogross89 Apr 1, 2024
eb690da
add ROP/ROW/OANS PFD warnings to a32nx
flogross89 Apr 1, 2024
03c1686
update two-line message, fix bug in getDisplayIndex()
flogross89 Apr 1, 2024
63d4622
make RWY TOO SHORT smaller
flogross89 Apr 1, 2024
6acdcab
Disable second ISIS; update colors for PFD tapes, PFD horizon, EWD TH…
flogross89 Apr 1, 2024
b191e91
restructure code, add A380X-only warnings
flogross89 Apr 4, 2024
065d66f
refactor Publisher structure, leave only data with existing sources
flogross89 Apr 5, 2024
d50e6a3
switch to data words for ROS/ROP and OANS PFD alerts
flogross89 Apr 5, 2024
ea8b511
clean up
flogross89 Apr 5, 2024
6e16c1e
feat: add some A429 utils
tracernz Apr 5, 2024
26ceb31
fix(pfd): tidy up publishers
tracernz Apr 5, 2024
0b8e7f9
feat: add fwc publisher
tracernz Apr 5, 2024
2dc347a
fix(pfd): use fwc data for stall warning
tracernz Apr 5, 2024
531377a
A380X: GPWS PFD alerts, ROP/ROW aural alerts,
flogross89 Apr 6, 2024
5a53630
use correct discrete word bit fields
flogross89 Apr 6, 2024
569ef58
Add ROP/ROW aural alerts to A32NX
flogross89 Apr 6, 2024
d913c02
fix lint after rebase
flogross89 Apr 6, 2024
177f25b
lint-fix
flogross89 Apr 28, 2024
389d916
update font for IF WET RWY TOO SHORT (fix for a32nx)
flogross89 May 3, 2024
f134667
lint + lint-fixes
flogross89 May 5, 2024
c6326f2
add LS reminder for ILS, frequency of ILS information has same font s…
flogross89 May 8, 2024
4bb36f6
consolidate to single definitions.scss, use standard colors for thrus…
flogross89 May 14, 2024
9409085
move ISIS changes to other PR
flogross89 May 14, 2024
b776c22
move logic from A32NX_FWC.js to PseudoFWC
flogross89 May 14, 2024
3fd5fab
inhibit single chimes for the first two seconds after power-on
flogross89 May 28, 2024
3922152
Merge branch 'master' into fix-a380x-pfd-vdev
flogross89 May 28, 2024
2f1b03b
Merge branch 'master' into fix-a380x-pfd-vdev
flogross89 Jun 15, 2024
d96655e
call correct gpwsUpdateDiscreteWords function in A32NX
flogross89 Jun 16, 2024
f29a0ba
Merge branch 'master' into fix-a380x-pfd-vdev
flogross89 Jun 16, 2024
f004d31
fix: wrong speedtape failure indication
Saschl Jun 17, 2024
2023abc
use Arinc429RegisterSubject for rowRop and oans words
flogross89 Jun 17, 2024
2a845d2
Merge branch 'master' into fix-a380x-pfd-vdev
flogross89 Jun 20, 2024
82b962d
disable global FBW_TYPECHECK
flogross89 Jun 20, 2024
de1eded
make compatible with RMP PR
flogross89 Jun 21, 2024
7fdf96b
a32nx fixes
flogross89 Jun 21, 2024
4d7fde6
a32nx: add stallwarningpublisher again
flogross89 Jun 25, 2024
e188713
fix stall warning
flogross89 Jun 29, 2024
760d7dc
Merge branch 'master' into fix-a380x-pfd-vdev
flogross89 Jun 29, 2024
2f2df46
fix: add missing setBitValue
Saschl Jun 29, 2024
3e8c8f1
use setBitValue as intended
flogross89 Jun 29, 2024
0ff5496
inhibit master caution/warning during PseudoFWC startup
flogross89 Jul 2, 2024
95c38f1
Merge branch 'master' into fix-a380x-pfd-vdev
flogross89 Jul 2, 2024
3f72525
Merge branch 'master' into fix-a380x-pfd-vdev
flogross89 Jul 2, 2024
04cddc9
clear timer if FWC shuts down before timer elapsed
flogross89 Jul 2, 2024
cff12d0
remove a32nx parts
flogross89 Jul 3, 2024
d5a990b
add fonts
flogross89 Jul 3, 2024
c355dd2
Merge branch 'master' into fix-a380x-pfd-vdev-a380xonly
flogross89 Jul 3, 2024
4fa2262
Merge branch 'master' into fix-a380x-pfd-vdev-a380xonly
Saschl Jul 4, 2024
42a5b86
Merge branch 'master' into fix-a380x-pfd-vdev-a380xonly
flogross89 Jul 7, 2024
653c324
Merge branch 'master' into fix-a380x-pfd-vdev-a380xonly
Saschl Jul 8, 2024
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
58 changes: 58 additions & 0 deletions fbw-a32nx/docs/a320-simvars.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
- [Landing Gear (ATA 32)](#landing-gear-ata-32)
- [ATC (ATA 34)](#atc-ata-34)
- [Radio Altimeter (ATA 34)](#radio-altimeter-ata-34)
- [GPWS / TAWS (ATA 34)](#gpws--taws-ata-34)
- [ROW / ROP / OANS (ATA 34)](#row--rop--oans-ata-34)
- [Electronic Flight Bag (ATA 46)](#electronic-flight-bag-ata-46)

## Uncategorized
Expand Down Expand Up @@ -3916,6 +3918,62 @@ In the variables below, {number} should be replaced with one item in the set: {
- 1
- 2

## GPWS / TAWS (ATA 34)
- `A32NX_EGPWS_ALERT_{1 | 2}_DISCRETE_WORD_1`
- Data word for GPWS alerts. Used for displaying alerts on the PFD (on the A380) and triggering aural warnings
- Arinc429<Discrete>
- | Bit | Description |
|:---:|:----------------------:|
| 11 | SINKRATE |
| 12 | PULL UP |
| 13 | TERRAIN |
| 14 | DON'T SINK |
| 15 | TOO LOW GEAR |
| 16 | TOO LOW FLAPS |
| 17 | TOO LOW TERRAIN |
| 18 | GLIDESLOPE |
| 20 | TERRAIN PULL UP |
| 22 | TERRAIN AHEAD PULL UP |
| 27 | TERRAIN AHEAD |

- `A32NX_EGPWS_ALERT_{1 | 2}_DISCRETE_WORD_2`
- Data word for GPWS alerts. Used for displaying alerts on the PFD (on the A380) or on the GPWS visual indicators on the A320
- Arinc429<Discrete>
- | Bit | Description |
|:---:|:----------------------------:|
| 11 | G/S CANCEL |
| 12 | GPWS ALERT |
| 13 | GPWS WARNING |
| 14 | GPWS INOP |
| 15 | W/S WARNING |
| 16 | AUDIO ON |
| 22 | TERRAIN AWARENESS WARNING |
| 23 | TERRAIN AWARENESS CAUTION |
| 24 | TERRAIN AWARENESS INOP |
| 25 | EXTERNAL FAULT |
| 26 | TERRAIN AWARENESS NOT AVAIL. |

## ROW / ROP / OANS (ATA 34)

- A32NX_ROW_ROP_WORD_1
- Data word for ROW and ROP functions. Used for displaying alerts on the PFD.
- Arinc429<Discrete>
- | Bit | Description |
|:---:|:---------------------------------:|
| 11 | ROW/ROP operative |
| 12 | ROP: Active with autobrake |
| 13 | ROP: Active with manual braking |
| 14 | ROW Wet: Runway too short |
| 15 | ROW Dry: Runway too short |

- A32NX_OANS_WORD_1
- Data word for OANS functions. Used for displaying alerts on the PFD.
- Arinc429<Discrete>
- | Bit | Description |
|:---:|:---------------------------------:|
| 11 | OANS: Runway ahead |


## Electronic Flight Bag (ATA 46)

- A32NX_PUSHBACK_SYSTEM_ENABLED
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1100,6 +1100,43 @@
</Requires>
</Sound>

<!-- Stall warning =====================================================================-->
<Sound WwiseEvent="aural_stall_new" WwiseData="true" NodeName="PEDALS_LEFT" LocalVar="A32NX_AUDIO_STALL_WARNING" Continuous="true">
<Range LowerBound="1"/>
<Requires SimVar="ELECTRICAL MAIN BUS VOLTAGE" Units="VOLTS" Index="1">
<Range LowerBound="28" />
</Requires>
</Sound>

<!-- ROP/ROW warnings =====================================================================-->
<Sound WwiseEvent="brake_max_braking" WwiseData="true" NodeName="Wiper_Base_l" LocalVar="A32NX_AUDIO_ROP_MAX_BRAKING" Continuous="true">
<Range LowerBound="1"/>
<Requires SimVar="ELECTRICAL MAIN BUS VOLTAGE" Units="VOLTS" Index="1">
<Range LowerBound="28" />
</Requires>
</Sound>

<Sound WwiseEvent="set_max_reverse" WwiseData="true" NodeName="Wiper_Base_l" LocalVar="A32NX_AUDIO_ROW_SET_MAX_REVERSE" Continuous="true">
<Range LowerBound="1"/>
<Requires SimVar="ELECTRICAL MAIN BUS VOLTAGE" Units="VOLTS" Index="1">
<Range LowerBound="28" />
</Requires>
</Sound>

<Sound WwiseEvent="keep_max_reverse" WwiseData="true" NodeName="Wiper_Base_l" LocalVar="A32NX_AUDIO_ROP_KEEP_MAX_REVERSE" Continuous="false">
<Range LowerBound="1"/>
<Requires SimVar="ELECTRICAL MAIN BUS VOLTAGE" Units="VOLTS" Index="1">
<Range LowerBound="28" />
</Requires>
</Sound>

<Sound WwiseEvent="runway_too_short" WwiseData="true" NodeName="Wiper_Base_l" LocalVar="A32NX_AUDIO_ROW_RWY_TOO_SHORT" Continuous="true">
<Range LowerBound="1"/>
<Requires SimVar="ELECTRICAL MAIN BUS VOLTAGE" Units="VOLTS" Index="1">
<Range LowerBound="28" />
</Requires>
</Sound>

</SimVarSounds>

<!-- AvionicSounds ========================================================================================== -->
Expand Down Expand Up @@ -1186,13 +1223,6 @@
<Sound WwiseData="true" WwiseEvent="traffic_traffic" NodeName="WIPER_BASE_L" />
<Sound WwiseData="true" WwiseEvent="TCAS_sys_test_OK" NodeName="WIPER_BASE_L" />

<!-- ROPS callouts ==================================================================================== -->

<Sound WwiseData="true" WwiseEvent="brake_max_braking" NodeName="WIPER_BASE_L" />
<Sound WwiseData="true" WwiseEvent="keep_max_reverse" NodeName="WIPER_BASE_L" />
<Sound WwiseData="true" WwiseEvent="runway_too_short" NodeName="WIPER_BASE_L" />
<Sound WwiseData="true" WwiseEvent="set_max_reverse" NodeName="WIPER_BASE_L" />

</AvionicSounds>

<!-- AnimationSounds ========================================================================================== -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ $font-size-huge: 22px;
$font-size-title: 24px;

$display-white: #ffffff;
$display-grey: #787878;
$display-grey: #4A5071;
$display-dark-grey: #b3b3b3;
$display-light-grey: lightgray;
$display-amber: #e68000;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import './common.scss';

export const getDisplayIndex = () => {
const url = Array.from(document.querySelectorAll('vcockpit-panel > *'))
.find((it) => it.tagName.toLowerCase() !== 'wasm-instrument')
.getAttribute('url');
?.find((it) => it.tagName.toLowerCase() !== 'wasm-instrument')
?.getAttribute('url');

return url ? parseInt(url.substring(url.length - 1), 10) : 0;
};
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
import { DisplayComponent, FSComponent, MappedSubject, Subject, VNode } from '@microsoft/msfs-sdk';
import { Arinc429RegisterSubject, ArincEventBus } from '@flybywiresim/fbw-sdk';
import { TawsDataEvents } from '@flybywiresim/msfs-avionics-common';

interface AttitudeIndicatorWarningsA380Props {
bus: ArincEventBus;
instrument: BaseInstrument;
}

export class AttitudeIndicatorWarningsA380 extends DisplayComponent<AttitudeIndicatorWarningsA380Props> {
private readonly warningGroupRef = FSComponent.createRef<SVGGElement>();

private readonly gpwsWord1 = Arinc429RegisterSubject.createEmpty();

private readonly gpwsPullUpActive = this.gpwsWord1.map((w) => w.bitValueOr(12, false));

private readonly gpwsSinkRateActive = this.gpwsWord1.map((w) => w.bitValueOr(11, false));

private readonly gpwsDontSinkActive = this.gpwsWord1.map((w) => w.bitValueOr(14, false));

private readonly gpwsTooLowGearActive = this.gpwsWord1.map((w) => w.bitValueOr(15, false));

private readonly gpwsTooLowTerrainActive = this.gpwsWord1.map((w) => w.bitValueOr(17, false));

private readonly gpwsTooLowFlapsActive = this.gpwsWord1.map((w) => w.bitValueOr(16, false));

private readonly gpwsGlideSlopeActive = this.gpwsWord1.map((w) => w.bitValueOr(18, false));

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

const sub = this.props.bus.getSubscriber<TawsDataEvents>();

sub.on('egpws_alert_discrete_word_1_1').whenChanged().handle((v) => {
this.gpwsWord1.setWord(v);
});
}

render(): VNode {
return (
<g id="WarningGroupA380" ref={this.warningGroupRef} style="display: block;">
<text
x="69"
y="100"
class="FontLargest Red MiddleAlign Blink9Seconds TextOutline"
style={{
display: MappedSubject.create(
([pullUp]) => pullUp,
this.gpwsPullUpActive,
).map((it) => (it ? 'block' : 'none')),
}}
>
PULL UP
</text>
<text
x="69"
y="100"
class="FontLargest Amber MiddleAlign Blink9Seconds TextOutline"
style={{
display: MappedSubject.create(
([sinkRate, pullUp]) => sinkRate && !pullUp,
this.gpwsSinkRateActive,
this.gpwsPullUpActive,
).map((it) => (it ? 'block' : 'none')),
}}
>
SINK RATE
</text>
<text
x="69"
y="100"
class="FontLargest Amber MiddleAlign Blink9Seconds TextOutline"
style={{
display: MappedSubject.create(
([dontSink, pullUp]) => dontSink && !pullUp,
this.gpwsDontSinkActive,
this.gpwsPullUpActive,
).map((it) => (it ? 'block' : 'none')),
}}
>
DONT SINK
</text>
<text
x="69"
y="100"
class="FontLargest Amber MiddleAlign Blink9Seconds TextOutline"
style={{
display: MappedSubject.create(
([tooLowGear, pullUp]) => tooLowGear && !pullUp,
this.gpwsTooLowGearActive,
this.gpwsPullUpActive,
).map((it) => (it ? 'block' : 'none')),
}}
>
TOO LOW GEAR
</text>
<text
x="69"
y="100"
class="FontLargest Amber MiddleAlign Blink9Seconds TextOutline"
style={{
display: MappedSubject.create(
([tooLowTerrain, pullUp]) => tooLowTerrain && !pullUp,
this.gpwsTooLowTerrainActive,
this.gpwsPullUpActive,
).map((it) => (it ? 'block' : 'none')),
}}
>
TOO LOW TERRAIN
</text>
<text
x="69"
y="100"
class="FontLargest Amber MiddleAlign Blink9Seconds TextOutline"
style={{
display: MappedSubject.create(
([tooLowFlaps, pullUp]) => tooLowFlaps && !pullUp,
this.gpwsTooLowFlapsActive,
this.gpwsPullUpActive,
).map((it) => (it ? 'block' : 'none')),
}}
>
TOO LOW FLAPS
</text>
<text
x="69"
y="100"
class="FontLargest Amber MiddleAlign Blink9Seconds TextOutline"
style={{
display: MappedSubject.create(
([glideSlope, pullUp]) => glideSlope && !pullUp,
this.gpwsGlideSlopeActive,
this.gpwsPullUpActive,
).map((it) => (it ? 'block' : 'none')),
}}
>
GLIDE SLOPE
</text>
</g>
);
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
import { DisplayComponent, EventBus, FSComponent, HEvent, Subject, VNode } from '@microsoft/msfs-sdk';
import {
ConsumerSubject,
DisplayComponent,
EventBus,
FSComponent,
HEvent,
MappedSubject,
Subject,
VNode,
} from '@microsoft/msfs-sdk';
import { getDisplayIndex } from 'instruments/src/PFD/PFD';
import { Arinc429Word } from '@flybywiresim/fbw-sdk';
import { Arinc429Values } from './shared/ArincValueProvider';
Expand Down Expand Up @@ -96,6 +105,7 @@ export class LandingSystem extends DisplayComponent<{ bus: EventBus; instrument:
<LocalizerIndicator bus={this.props.bus} instrument={this.props.instrument} />
<GlideSlopeIndicator bus={this.props.bus} instrument={this.props.instrument} />
<MarkerBeaconIndicator bus={this.props.bus} />
<LsReminder bus={this.props.bus} />
</g>

<path ref={this.gsReferenceLine} class="Yellow Fill" d="m115.52 80.067v1.5119h-8.9706v-1.5119z" />
Expand Down Expand Up @@ -223,7 +233,7 @@ class LandingSystemInfo extends DisplayComponent<{ bus: EventBus }> {
<text id="ILSFreqLeading" class="Magenta FontLarge AlignLeft" x="1.3610243" y="149.11575">
{this.freqTextLeading}
</text>
<text id="ILSFreqTrailing" class="Magenta FontSmallest AlignLeft" x="12.964463" y="149.24084">
<text id="ILSFreqTrailing" class="Magenta FontLarge AlignLeft" x="12.964463" y="149.24084">
{this.freqTextTrailing}
</text>

Expand Down Expand Up @@ -602,9 +612,49 @@ class MarkerBeaconIndicator extends DisplayComponent<{ bus: EventBus }> {

render(): VNode {
return (
<text id="ILSMarkerText" class={this.classNames} x="98.339211" y="125.12898">
<text id="ILSMarkerText" class={this.classNames} x="107" y="133">
{this.markerText}
</text>
);
}
}

class LsReminder extends DisplayComponent<{ bus: EventBus }> {
private readonly lsReminderRef = FSComponent.createRef<SVGTextElement>();

private readonly hasLoc = ConsumerSubject.create(null, false);

private readonly lsButton = ConsumerSubject.create(null, false);

private readonly ilsReminderShown = MappedSubject.create(
([hasLoc, lsButton]) => hasLoc && lsButton,
this.hasLoc,
this.lsButton,
);

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

const sub = this.props.bus.getSubscriber<PFDSimvars>();

this.hasLoc.setConsumer(sub.on('hasLoc').whenChanged());
this.lsButton.setConsumer(sub.on(getDisplayIndex() === 2 ? 'ls2Button' : 'ls1Button').whenChanged());

// normally the ident and freq should be always displayed when an ILS freq is set, but currently it only show when we have a signal
this.ilsReminderShown.sub((it) => {
if (it) {
this.lsReminderRef.instance.style.display = 'inline';
} else {
this.lsReminderRef.instance.style.display = 'none';
}
});
}

render(): VNode {
return (
<text class="FontLargest Magenta MiddleAlign Blink9Seconds" ref={this.lsReminderRef} x="104" y="126">
ILS
</text>
);
}
}
Loading