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

fix(fws): Sound scheduling for FWS, triple click on capability downgrade #9555

Merged
merged 44 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
9910c5c
Implement FwsSoundManager
flogross89 Nov 19, 2024
1ca6245
add altitude callouts
flogross89 Nov 19, 2024
45b9827
a380x fixes
flogross89 Nov 20, 2024
f4adb8d
move PseudoFWC to systems-host; Implement AP + A/THR disconnect logic
flogross89 Nov 20, 2024
74a53a0
fix triple clicks
flogross89 Nov 21, 2024
4ffe5a9
Merge branch 'master' into feat-fws-ap-disco
flogross89 Nov 21, 2024
5ffcc15
fix a320/a380 differences
flogross89 Nov 21, 2024
520730a
review fixes
flogross89 Nov 21, 2024
e62dcac
BravoMike's review findings
flogross89 Nov 21, 2024
cafa508
Merge branch 'master' into feat-fws-ap-disco
flogross89 Nov 23, 2024
88b0c36
fix AUTO_THROTTLE_DISCONNECT
flogross89 Nov 24, 2024
7bb4f4d
single chime for A/THR OFF memo
flogross89 Nov 24, 2024
d4e281d
another event forward
flogross89 Nov 24, 2024
f379ffd
Merge branch 'master' into feat-fws-ap-disco
flogross89 Nov 24, 2024
4833704
update a32nx sounds
flogross89 Nov 25, 2024
078b35c
change single chime back to a32nx variant
flogross89 Nov 25, 2024
8dc16c2
consider land armed for CAT 2 -> CAT 1 downgrades
flogross89 Nov 26, 2024
19c5926
don't break before event emission :)
flogross89 Nov 26, 2024
e542136
Merge branch 'master' into feat-fws-ap-disco
flogross89 Nov 26, 2024
a0dc2d6
Revert "update a32nx sounds"
flogross89 Nov 26, 2024
669646b
Merge branch 'master' into feat-fws-ap-disco
flogross89 Nov 26, 2024
e3a543f
replace exec calculator code with simconnect call
flogross89 Nov 28, 2024
c11dc7c
Merge branch 'master' into feat-fws-ap-disco
flogross89 Nov 28, 2024
8159c04
Merge branch 'master' into feat-fws-ap-disco
flogross89 Nov 28, 2024
97b40a6
Merge branch 'master' into feat-fws-ap-disco
flogross89 Nov 29, 2024
8750439
add athr disconnect event, improve sendEvent call (no this)
flogross89 Nov 29, 2024
e6cb73b
first cavcharge fix
flogross89 Nov 29, 2024
affc018
remove sound elec bus dependency
flogross89 Dec 1, 2024
0b83056
keep showing AP OFF alert unless AP re-engaged or flight is restarted
flogross89 Dec 1, 2024
f34f5c4
listen to ATS discrete word
flogross89 Dec 5, 2024
b54e65e
pause before triple click
flogross89 Dec 5, 2024
a887a0d
timing update
flogross89 Dec 5, 2024
196321f
Merge branch 'master' into feat-fws-ap-disco
flogross89 Dec 5, 2024
cdd5116
use FMGC discrete for AP engagement
flogross89 Dec 5, 2024
ad46d5d
add THR LEVERS ... MOVE
flogross89 Dec 5, 2024
6e574f6
Merge branch 'master' into feat-fws-ap-disco
flogross89 Dec 5, 2024
b639450
Don't instantly interrupt when continuous, only when higher prio
flogross89 Dec 5, 2024
4cf4397
Merge branch 'master' into feat-fws-ap-disco
flogross89 Dec 13, 2024
6fa4917
ECAM warning: Separate sound from AP OFF fault line
flogross89 Dec 15, 2024
2bdf3df
Merge branch 'master' into feat-fws-ap-disco
flogross89 Dec 15, 2024
da93b0c
A380X: adapt timing, play first cav charge for at least 0.3s
flogross89 Dec 16, 2024
d464e6f
fix alt c chord
flogross89 Dec 17, 2024
6d9ffee
a380x: fix short c-chord
flogross89 Dec 18, 2024
d073c22
Merge branch 'master' into feat-fws-ap-disco
flogross89 Dec 18, 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
3 changes: 3 additions & 0 deletions .github/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@
1. [FMS] Fix Pause at T/D not working in selected speed - @BlueberryKing (BlueberryKing)
1. [MISC] Replaced brake temperature simulation with physics based model of brakes - @Gurgel100 (Pascal)
1. [A32NX/MCDU] Suppress TMPY FPLN when no modifications made in airways page - @robertxing2004 (robeet)
1. [A380X/FWS] No "auto brake off" callout when double pressing A/THR instinctive disconnect - @flogross89 (floridude)
1. [A380X/FWS] Improve landing capability downgrade triple click logic (#9008) - @flogross89 (floridude)
1. [A32NX/FWS] Add "auto brake off" callout, improve AP/ATHR disconnect aural alert logic - @flogross89 (floridude)
1. [A380X/FMC] Fix reset of perf data on done phase or database swap - @tracernz (Mike)
1. [A32NX/ATC] Fixed ATC/TCAS power supply - @tracernz (Mike)
1. [A32NX] Fixed appearance of FCU decals on MSFS2024 - @tracernz (Mike)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -596,10 +596,6 @@
<WwiseRTPC LocalVar="A32NX_SOUND_EXTERIOR_MASTER" Units="number" Index="0" RTPCName="LOCALVAR_A32NX_EXTERIOR_VOLUME" />
</Sound>

<Sound WwiseData="true" WwiseEvent="AP_DC_new" Continuous="false" NodeName="PEDALS_LEFT" LocalVar="A32NX_AUTOPILOT_ACTIVE" Units="BOOL" Index="0">
<Range UpperBound="0" />
</Sound>

<Sound WwiseData="true" WwiseEvent="APUnlock" NodeName="PUSH_YOKE_LEFT" ViewPoint="Inside" Continuous="false" LocalVar="A32NX_STICK_LOCK_ACTIVE" Units="BOOL" Index="0">
<Range UpperBound="0" />
</Sound>
Expand Down Expand Up @@ -2150,7 +2146,7 @@

<!-- CRC and Caution ========================================================================================-->

<Sound WwiseData="true" WwiseEvent="CRC" NodeName="Wiper_Base_l" ViewPoint="Inside" LocalVar="A32NX_MASTER_WARNING">
<Sound WwiseData="true" WwiseEvent="CRC" NodeName="Wiper_Base_l" ViewPoint="Inside" LocalVar="A32NX_FWC_CRC">
<Range LowerBound="0.5" />
<Requires SimVar="ELECTRICAL MAIN BUS VOLTAGE" Units="VOLTS" Index="1">
<Range LowerBound="28" />
Expand Down Expand Up @@ -2276,12 +2272,14 @@
<WwiseRTPC LocalVar="A32NX_SOUND_ANNOUNCEMENTS_ENABLED" Units="number" Index="0" RTPCName="LOCALVAR_A32NX_ANNOUNCEMENT_TOGGLE" />
</Sound>

<!-- Cavalry charge ===============================================================================-->

<Sound WwiseData="true" WwiseEvent="improved_tone_caution" NodeName="PEDALS_LEFT" ViewPoint="Inside" LocalVar="A32NX_MASTER_CAUTION" Continuous="false">
<Sound WwiseData="true" WwiseEvent="cavcharge" NodeName="WIPER_BASE_L" ViewPoint="Inside" LocalVar="A32NX_FWC_CAVALRY_CHARGE" Continuous="true">
<Range LowerBound="0.5" />
<Requires SimVar="ELECTRICAL MAIN BUS VOLTAGE" Units="VOLTS" Index="1">
<Range LowerBound="28" />
</Requires>
<WwiseRTPC LocalVar="A32NX_FWS_AUDIO_VOLUME" Units="number" Index="0" RTPCName="LOCALVAR_FWC_VOLUME" />
</Sound>

<!-- Altitude deviation warning =====================================================================-->
Expand Down Expand Up @@ -2344,6 +2342,20 @@
</Requires>
</Sound>

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

<Sound WwiseData="true" WwiseEvent="mastercaution" NodeName="PEDALS_LEFT" ViewPoint="Inside" LocalVar="A32NX_FWC_SC" Continuous="false">
<Range LowerBound="0.5" />
<Requires SimVar="ELECTRICAL MAIN BUS VOLTAGE" Units="VOLTS" Index="1">
<Range LowerBound="28" />
</Requires>
</Sound>

</SimVarSounds>

<!-- AvionicSounds ========================================================================================== -->
Expand Down
6 changes: 6 additions & 0 deletions fbw-a32nx/src/systems/instruments/src/Common/EWDMessages.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const EWDMessages = {
'000002010': ' \x1b<3mFLAPS FULL',
'000002011': ' \x1b<3mFLAPS\x1b<5m.....CONF 3',
'000002012': ' \x1b<3mFLAPS CONF 3',
'320000001': '\x1b<4mAUTO BRK OFF',
'000002201': '\x1b<3mAUTO BRK LO',
'000002202': '\x1b<3mAUTO BRK MED',
'000002203': '\x1b<3mAUTO BRK MAX',
Expand Down Expand Up @@ -192,6 +193,11 @@ const EWDMessages = {
'216330503': '\x1b<4m -FWD CAB TRIM VALVE',
'216330504': '\x1b<4m -AFT CAB TRIM VALVE',
'216330505': '\x1b<4m -TRIM AIR HI PR',
'220000001': '\x1b<2mAP OFF',
'220000002': '\x1b<4mA/THR OFF',
'220800001': '\x1b<2m\x1b4mAUTO FLT\x1bm AP OFF',
'220800004': '\x1b<4m\x1b4mAUTO FLT\x1bm A/THR OFF',
'220800005': '\x1b<5m -THR LEVERS........MOVE',
'221070001': '\x1b<4m\x1b4mT.O\x1bm SPEEDS TOO LOW',
'221070002': '\x1b<5m -TOW AND T.O DATA.CHECK',
'221071001': '\x1b<4m\x1b4mT.O\x1bm V1/VR/V2 DISAGREE',
Expand Down
16 changes: 1 addition & 15 deletions fbw-a32nx/src/systems/instruments/src/EWD/instrument.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,11 @@
//
// SPDX-License-Identifier: GPL-3.0

import {
AdcPublisher,
Clock,
EventBus,
FSComponent,
InstrumentBackplane,
StallWarningPublisher,
} from '@microsoft/msfs-sdk';
import { AdcPublisher, Clock, EventBus, FSComponent, InstrumentBackplane } from '@microsoft/msfs-sdk';
import { FuelSystemPublisher } from 'instruments/src/MsfsAvionicsCommon/providers/FuelSystemPublisher';
import { ArincValueProvider } from './shared/ArincValueProvider';
import { EwdComponent } from './EWD';
import { EwdSimvarPublisher } from './shared/EwdSimvarPublisher';
import { PseudoFWC } from './PseudoFWC';

import './style.scss';

Expand All @@ -33,19 +25,13 @@ class A32NX_EWD extends BaseInstrument {

private readonly adcPublisher = new AdcPublisher(this.bus);

private readonly stallWarningPublisher = new StallWarningPublisher(this.bus, 0.9);

private readonly pseudoFwc = new PseudoFWC(this.bus, this);

constructor() {
super();

this.backplane.addInstrument('Clock', this.clock);
this.backplane.addPublisher('SimVars', this.simVarPublisher);
this.backplane.addPublisher('FuelSystem', this.fuelSystemPublisher);
this.backplane.addPublisher('adc', this.adcPublisher);
this.backplane.addPublisher('stallWarning', this.stallWarningPublisher);
this.backplane.addInstrument('Fwc', this.pseudoFwc);
}

get templateID(): string {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// Copyright (c) 2021-2023 FlyByWire Simulations
//
// SPDX-License-Identifier: GPL-3.0

import { EventBus, SimVarDefinition, SimVarValueType, SimVarPublisher } from '@microsoft/msfs-sdk';

export type PseudoFwcSimvars = {
engine1Master: number;
engine2Master: number;
engine3Master: number;
engine4Master: number;
fmgc1DiscreteWord4: number;
fmgc2DiscreteWord4: number;
};

export class PseudoFwcSimvarPublisher extends SimVarPublisher<PseudoFwcSimvars> {
private static simvars = new Map<keyof PseudoFwcSimvars, SimVarDefinition>([
['engine1Master', { name: 'A:FUELSYSTEM VALVE SWITCH:1', type: SimVarValueType.Bool }],
['engine2Master', { name: 'A:FUELSYSTEM VALVE SWITCH:2', type: SimVarValueType.Bool }],
['engine3Master', { name: 'A:FUELSYSTEM VALVE SWITCH:3', type: SimVarValueType.Bool }],
['engine4Master', { name: 'A:FUELSYSTEM VALVE SWITCH:4', type: SimVarValueType.Bool }],
['fmgc1DiscreteWord4', { name: 'L:A32NX_FMGC_1_DISCRETE_WORD_4', type: SimVarValueType.Number }],
['fmgc2DiscreteWord4', { name: 'L:A32NX_FMGC_2_DISCRETE_WORD_4', type: SimVarValueType.Number }],
]);

public constructor(bus: EventBus) {
super(PseudoFwcSimvarPublisher.simvars, bus);
}
}
65 changes: 49 additions & 16 deletions fbw-a32nx/src/systems/systems-host/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,40 @@
//
// SPDX-License-Identifier: GPL-3.0

import { EventBus, HEventPublisher } from '@microsoft/msfs-sdk';
import {
Clock,
ClockEvents,
EventBus,
HEventPublisher,
InstrumentBackplane,
StallWarningPublisher,
} from '@microsoft/msfs-sdk';
import { AtsuSystem } from './systems/atsu';
import { PowerSupplyBusses } from './systems/powersupply';
import { PseudoFWC } from 'systems-host/systems/FWC/PseudoFWC';
import { FuelSystemPublisher } from 'instruments/src/MsfsAvionicsCommon/providers/FuelSystemPublisher';
import { PseudoFwcSimvarPublisher } from 'instruments/src/MsfsAvionicsCommon/providers/PseudoFwcPublisher';

class SystemsHost extends BaseInstrument {
private readonly bus: EventBus;
private readonly bus = new EventBus();

private readonly hEventPublisher: HEventPublisher;
private readonly backplane = new InstrumentBackplane();

private readonly powerSupply: PowerSupplyBusses;
private readonly clock = new Clock(this.bus);

private readonly atsu: AtsuSystem;
private readonly hEventPublisher = new HEventPublisher(this.bus);

private readonly powerSupply = new PowerSupplyBusses(this.bus);

private readonly atsu = new AtsuSystem(this.bus);

private readonly fuelSystemPublisher = new FuelSystemPublisher(this.bus);

private readonly stallWarningPublisher = new StallWarningPublisher(this.bus, 0.9);

private readonly pseudoFwcPublisher = new PseudoFwcSimvarPublisher(this.bus);

private readonly pseudoFwc = new PseudoFWC(this.bus, this);

/**
* "mainmenu" = 0
Expand All @@ -26,10 +48,25 @@ class SystemsHost extends BaseInstrument {
constructor() {
super();

this.bus = new EventBus();
this.hEventPublisher = new HEventPublisher(this.bus);
this.powerSupply = new PowerSupplyBusses(this.bus);
this.atsu = new AtsuSystem(this.bus);
this.backplane.addInstrument('Clock', this.clock);
this.backplane.addInstrument('AtsuSystem', this.atsu);
this.backplane.addPublisher('FuelSystem', this.fuelSystemPublisher);
this.backplane.addPublisher('PowerPublisher', this.powerSupply);
this.backplane.addPublisher('stallWarning', this.stallWarningPublisher);
this.backplane.addPublisher('PseudoFwcPublisher', this.pseudoFwcPublisher);

this.pseudoFwc.init();
let lastUpdateTime: number;
this.bus
.getSubscriber<ClockEvents>()
.on('simTimeHiFreq')
.atFrequency(50)
.handle((now) => {
const dt = lastUpdateTime === undefined ? 0 : now - lastUpdateTime;
lastUpdateTime = now;

this.pseudoFwc.update(dt);
});
}

get templateID(): string {
Expand All @@ -47,9 +84,6 @@ class SystemsHost extends BaseInstrument {
public connectedCallback(): void {
super.connectedCallback();

this.powerSupply.connectedCallback();
this.atsu.connectedCallback();

// Needed to fetch METARs from the sim
RegisterViewListener(
'JS_LISTENER_FACILITY',
Expand All @@ -58,6 +92,8 @@ class SystemsHost extends BaseInstrument {
},
true,
);

this.backplane.init();
}

public Update(): void {
Expand All @@ -67,14 +103,11 @@ class SystemsHost extends BaseInstrument {
const gamestate = this.getGameState();
if (gamestate === 3) {
this.hEventPublisher.startPublish();
this.powerSupply.startPublish();
this.atsu.startPublish();
}
this.gameState = gamestate;
}

this.powerSupply.update();
this.atsu.update();
this.backplane.onUpdate();
}
}

Expand Down
Loading