-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(a380x/fcu): automatically select LS on LOC or APPR arming (#9670)
* feat(fcu): auto select LS on FCU appr mode active * docs: add changelog * fix: also use loc arming
- Loading branch information
1 parent
1ca1ea9
commit 6ca94e2
Showing
4 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
fbw-a380x/src/systems/instruments/src/FCU/Managers/LsManager.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Copyright (c) 2024 FlyByWire Simulations | ||
// SPDX-License-Identifier: GPL-3.0 | ||
import { ConsumerSubject, EventBus, Instrument, MappedSubject, SubscribableMapFunctions } from '@microsoft/msfs-sdk'; | ||
import { FcuEvents } from '../Publishers/FcuPublisher'; | ||
|
||
export class LsManager implements Instrument { | ||
private readonly sub = this.bus.getSubscriber<FcuEvents>(); | ||
|
||
private readonly locActive = ConsumerSubject.create(this.sub.on('fcu_loc_mode_active'), false); | ||
|
||
private readonly apprActive = ConsumerSubject.create(this.sub.on('fcu_approach_mode_active'), false); | ||
|
||
private readonly locOrApprSelected = MappedSubject.create( | ||
SubscribableMapFunctions.or(), | ||
this.locActive, | ||
this.apprActive, | ||
); | ||
|
||
constructor(private readonly bus: EventBus) {} | ||
|
||
init(): void { | ||
this.locOrApprSelected.sub((v) => { | ||
if (v) { | ||
SimVar.SetSimVarValue('L:A380X_EFIS_L_LS_BUTTON_IS_ON', 'Bool', true); | ||
SimVar.SetSimVarValue('L:A380X_EFIS_R_LS_BUTTON_IS_ON', 'Bool', true); | ||
} | ||
}); | ||
} | ||
onUpdate(): void {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters