From 9062486b9b2676f5312223d318d42c40dec9b4c6 Mon Sep 17 00:00:00 2001 From: flogross89 <63071941+flogross89@users.noreply.github.com> Date: Thu, 2 Jan 2025 23:29:00 +0100 Subject: [PATCH] add direct law PFD indications --- .../src/PFD/AttitudeIndicatorFixed.tsx | 26 ++- .../src/PFD/AttitudeIndicatorHorizon.tsx | 38 +++- .../src/systems/instruments/src/PFD/FMA.tsx | 20 +- .../instruments/src/PFD/SpeedIndicator.tsx | 76 ++++---- .../wasm/fbw_a380/src/FlyByWireInterface.cpp | 32 ++-- .../wasm/fbw_a380/src/FlyByWireInterface.h | 3 + fbw-a380x/src/wasm/fbw_a380/src/fcdc/Fcdc.cpp | 174 ++++++++++++++---- fbw-a380x/src/wasm/fbw_a380/src/fcdc/Fcdc.h | 40 +++- 8 files changed, 293 insertions(+), 116 deletions(-) diff --git a/fbw-a380x/src/systems/instruments/src/PFD/AttitudeIndicatorFixed.tsx b/fbw-a380x/src/systems/instruments/src/PFD/AttitudeIndicatorFixed.tsx index d7c775cf227..5db0fa26552 100644 --- a/fbw-a380x/src/systems/instruments/src/PFD/AttitudeIndicatorFixed.tsx +++ b/fbw-a380x/src/systems/instruments/src/PFD/AttitudeIndicatorFixed.tsx @@ -1,6 +1,6 @@ import { DisplayComponent, EventBus, FSComponent, Subject, Subscribable, VNode } from '@microsoft/msfs-sdk'; import { getDisplayIndex } from 'instruments/src/PFD/PFD'; -import { Arinc429Word } from '@flybywiresim/fbw-sdk'; +import { Arinc429ConsumerSubject, Arinc429Word } from '@flybywiresim/fbw-sdk'; import { FlightPathDirector } from './FlightPathDirector'; import { FlightPathVector } from './FlightPathVector'; import { Arinc429Values } from './shared/ArincValueProvider'; @@ -11,18 +11,22 @@ interface AttitudeIndicatorFixedUpperProps { } export class AttitudeIndicatorFixedUpper extends DisplayComponent { + private readonly sub = this.props.bus.getSubscriber(); + private roll = new Arinc429Word(0); private pitch = new Arinc429Word(0); private visibilitySub = Subject.create('hidden'); + private readonly fcdcDiscreteWord1 = Arinc429ConsumerSubject.create(this.sub.on('fcdcDiscreteWord1')); + + private readonly isNormalLawActive = this.fcdcDiscreteWord1.map((dw) => dw.bitValue(11) && !dw.isFailureWarning()); + onAfterRender(node: VNode): void { super.onAfterRender(node); - const sub = this.props.bus.getSubscriber(); - - sub.on('rollAr').handle((roll) => { + this.sub.on('rollAr').handle((roll) => { this.roll = roll; if (!this.roll.isNormalOperation()) { this.visibilitySub.set('hidden'); @@ -31,7 +35,7 @@ export class AttitudeIndicatorFixedUpper extends DisplayComponent { + this.sub.on('pitchAr').handle((pitch) => { this.pitch = pitch; if (!this.pitch.isNormalOperation()) { this.visibilitySub.set('hidden'); @@ -44,11 +48,19 @@ export class AttitudeIndicatorFixedUpper extends DisplayComponent - + (nl ? 'block' : 'none')) }} + > - - + (nl ? 'inherit' : 'none')) }} + > -