diff --git a/src/instruments/src/PFD/AttitudeIndicatorFixed.tsx b/src/instruments/src/PFD/AttitudeIndicatorFixed.tsx index f63aff1ee96..16602b6f744 100644 --- a/src/instruments/src/PFD/AttitudeIndicatorFixed.tsx +++ b/src/instruments/src/PFD/AttitudeIndicatorFixed.tsx @@ -398,7 +398,7 @@ class SidestickIndicator extends DisplayComponent<{ bus: EventBus }> { private sideStickY = 0; - private onGround = 0; + private onGround = true; private crossHairRef = FSComponent.createRef(); @@ -411,7 +411,7 @@ class SidestickIndicator extends DisplayComponent<{ bus: EventBus }> { private handleSideStickIndication() { const oneEngineRunning = this.engOneRunning || this.engTwoRunning; - if (this.onGround === 0 || !oneEngineRunning) { + if (!this.onGround || !oneEngineRunning) { this.onGroundForVisibility.set('hidden'); } else { this.onGroundForVisibility.set('visible'); @@ -424,7 +424,7 @@ class SidestickIndicator extends DisplayComponent<{ bus: EventBus }> { const sub = this.props.bus.getSubscriber(); - sub.on('onGround').whenChanged().handle((g) => { + sub.on('noseGearCompressed').whenChanged().handle((g) => { this.onGround = g; this.handleSideStickIndication(); }); diff --git a/src/instruments/src/PFD/AttitudeIndicatorHorizon.tsx b/src/instruments/src/PFD/AttitudeIndicatorHorizon.tsx index 12f4dc4fc16..aaba40a2885 100644 --- a/src/instruments/src/PFD/AttitudeIndicatorHorizon.tsx +++ b/src/instruments/src/PFD/AttitudeIndicatorHorizon.tsx @@ -449,7 +449,11 @@ class SideslipIndicator extends DisplayComponent { private slideSlip = FSComponent.createRef(); - private onGround = 1; + private onGround = true; + + private leftMainGearCompressed = true; + + private rightMainGearCompressed = true; private roll = new Arinc429Word(0); @@ -466,8 +470,15 @@ class SideslipIndicator extends DisplayComponent { const sub = this.props.bus.getSubscriber(); - sub.on('onGround').whenChanged().handle((og) => { - this.onGround = og; + sub.on('leftMainGearCompressed').whenChanged().handle((og) => { + this.leftMainGearCompressed = og; + this.onGround = this.rightMainGearCompressed || og; + this.determineSlideSlip(); + }); + + sub.on('rightMainGearCompressed').whenChanged().handle((og) => { + this.rightMainGearCompressed = og; + this.onGround = this.leftMainGearCompressed || og; this.determineSlideSlip(); }); diff --git a/src/instruments/src/PFD/SpeedIndicator.tsx b/src/instruments/src/PFD/SpeedIndicator.tsx index 8e9c71291a8..478d64629a0 100644 --- a/src/instruments/src/PFD/SpeedIndicator.tsx +++ b/src/instruments/src/PFD/SpeedIndicator.tsx @@ -149,12 +149,16 @@ export class AirspeedIndicator extends DisplayComponent private barTimeout= 0; - private onGround = 0; + private onGround = Subject.create(true); private airSpeed = new Arinc429Word(0); private vMax = 0; + private leftMainGearCompressed: boolean; + + private rightMainGearCompressed: boolean; + private setOutline() { let airspeedValue: number; if (this.airSpeed.isFailureWarning() || (this.airSpeed.isNoComputedData() && !this.onGround)) { @@ -248,10 +252,19 @@ export class AirspeedIndicator extends DisplayComponent this.vMax = vMax; }); + pf.on('leftMainGearCompressed').whenChanged().handle((g) => { + this.leftMainGearCompressed = g; + this.onGround.set(this.rightMainGearCompressed || g); + }); + + pf.on('rightMainGearCompressed').whenChanged().handle((g) => { + this.rightMainGearCompressed = g; + this.onGround.set(this.leftMainGearCompressed || g); + }); + // showBars replacement - pf.on('onGround').whenChanged().handle((g) => { - this.onGround = g; - if (g === 1) { + this.onGround.sub((g) => { + if (g) { this.showBarsRef.instance.style.display = 'none'; this.barberPoleRef.instance.style.display = 'none'; clearTimeout(this.barTimeout); @@ -423,15 +436,25 @@ export class AirspeedIndicatorOfftape extends DisplayComponent<{ bus: EventBus } private decelRef = FSComponent.createRef(); - private onGround = 0; + private onGround = true; + + private leftMainGearCompressed = true; + + private rightMainGearCompressed = true; onAfterRender(node: VNode): void { super.onAfterRender(node); const sub = this.props.bus.getSubscriber(); - sub.on('onGround').whenChanged().handle((g) => { - this.onGround = g; + sub.on('leftMainGearCompressed').whenChanged().handle((g) => { + this.leftMainGearCompressed = g; + this.onGround = this.rightMainGearCompressed || g; + }); + + sub.on('rightMainGearCompressed').whenChanged().handle((g) => { + this.rightMainGearCompressed = g; + this.onGround = this.leftMainGearCompressed || g; }); sub.on('speedAr').handle((speed) => { @@ -862,7 +885,11 @@ export class MachNumber extends DisplayComponent<{bus: EventBus}> { private showMach = false; - private onGround = 0; + private onGround = false; + + private leftMainGearCompressed = true; + + private rightMainGearCompressed = true; onAfterRender(node: VNode): void { super.onAfterRender(node); @@ -888,8 +915,14 @@ export class MachNumber extends DisplayComponent<{bus: EventBus}> { } }); - sub.on('onGround').whenChanged().handle((g) => { - this.onGround = g; + sub.on('leftMainGearCompressed').whenChanged().handle((g) => { + this.leftMainGearCompressed = g; + this.onGround = this.rightMainGearCompressed || g; + }); + + sub.on('rightMainGearCompressed').whenChanged().handle((g) => { + this.rightMainGearCompressed = g; + this.onGround = this.leftMainGearCompressed || g; }); } diff --git a/src/instruments/src/PFD/instrument.tsx b/src/instruments/src/PFD/instrument.tsx index 597f3b8e8e6..391906df61c 100644 --- a/src/instruments/src/PFD/instrument.tsx +++ b/src/instruments/src/PFD/instrument.tsx @@ -71,7 +71,9 @@ class A32NX_PFD extends BaseInstrument { this.simVarPublisher.subscribe('altitude'); this.simVarPublisher.subscribe('speed'); this.simVarPublisher.subscribe('alphaProt'); - this.simVarPublisher.subscribe('onGround'); + this.simVarPublisher.subscribe('noseGearCompressed'); + this.simVarPublisher.subscribe('leftMainGearCompressed'); + this.simVarPublisher.subscribe('rightMainGearCompressed'); this.simVarPublisher.subscribe('activeLateralMode'); this.simVarPublisher.subscribe('activeVerticalMode'); this.simVarPublisher.subscribe('fmaModeReversion'); diff --git a/src/instruments/src/PFD/shared/PFDSimvarPublisher.tsx b/src/instruments/src/PFD/shared/PFDSimvarPublisher.tsx index 788393da149..17981971ef1 100644 --- a/src/instruments/src/PFD/shared/PFDSimvarPublisher.tsx +++ b/src/instruments/src/PFD/shared/PFDSimvarPublisher.tsx @@ -12,7 +12,9 @@ export interface PFDSimvars { altitude: number; speed: number; alphaProt: number; - onGround: number; + noseGearCompressed: boolean; + leftMainGearCompressed: boolean; + rightMainGearCompressed: boolean; activeLateralMode: number; activeVerticalMode: number; fmaModeReversion: boolean; @@ -124,7 +126,9 @@ export enum PFDVars { altitude = 'L:A32NX_ADIRS_ADR_1_ALTITUDE', speed = 'L:A32NX_ADIRS_ADR_1_COMPUTED_AIRSPEED', alphaProt = 'L:A32NX_SPEEDS_ALPHA_PROTECTION', - onGround = 'L:A32NX_LGCIU_1_NOSE_GEAR_COMPRESSED', + noseGearCompressed = 'L:A32NX_LGCIU_1_NOSE_GEAR_COMPRESSED', + leftMainGearCompressed = 'L:A32NX_LGCIU_1_LEFT_GEAR_COMPRESSED', + rightMainGearCompressed = 'L:A32NX_LGCIU_1_RIGHT_GEAR_COMPRESSED', activeLateralMode = 'L:A32NX_FMA_LATERAL_MODE', activeVerticalMode = 'L:A32NX_FMA_VERTICAL_MODE', fmaModeReversion = 'L:A32NX_FMA_MODE_REVERSION', @@ -238,7 +242,9 @@ export class PFDSimvarPublisher extends SimVarPublisher { ['altitude', { name: PFDVars.altitude, type: SimVarValueType.Number }], ['speed', { name: PFDVars.speed, type: SimVarValueType.Number }], ['alphaProt', { name: PFDVars.alphaProt, type: SimVarValueType.Number }], - ['onGround', { name: PFDVars.onGround, type: SimVarValueType.Number }], + ['noseGearCompressed', { name: PFDVars.noseGearCompressed, type: SimVarValueType.Bool }], + ['leftMainGearCompressed', { name: PFDVars.leftMainGearCompressed, type: SimVarValueType.Bool }], + ['rightMainGearCompressed', { name: PFDVars.rightMainGearCompressed, type: SimVarValueType.Bool }], ['activeLateralMode', { name: PFDVars.activeLateralMode, type: SimVarValueType.Number }], ['activeVerticalMode', { name: PFDVars.activeVerticalMode, type: SimVarValueType.Number }], ['fmaModeReversion', { name: PFDVars.fmaModeReversion, type: SimVarValueType.Bool }],