Skip to content

Commit

Permalink
apply suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
Saschl committed Jan 2, 2025
1 parent 966948a commit 29a2169
Showing 1 changed file with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,17 @@ export class FlightManagementComputer implements FmcInterface {
// TODO remove this cyclic dependency, isWaypointInUse should be moved to DataInterface
private dataManager: DataManager | null = null;

private readonly flightPhase = ConsumerSubject.create<FmgcFlightPhase>(null, this.flightPhaseManager.phase);
private readonly activePage = ConsumerSubject.create<ActiveUriInformation | null>(null, null);
private readonly sub = this.bus.getSubscriber<FlightPhaseManagerEvents & MfdUIData>();

private readonly flightPhase = ConsumerSubject.create<FmgcFlightPhase>(
this.sub.on('fmgc_flight_phase'),
this.flightPhaseManager.phase,
);
private readonly activePage = ConsumerSubject.create<ActiveUriInformation | null>(
this.sub.on('mfd_active_uri'),
null,
);

private readonly isReset = Subject.create(true);

private readonly shouldBePreflightPhase = MappedSubject.create(
Expand Down Expand Up @@ -245,10 +254,6 @@ export class FlightManagementComputer implements FmcInterface {

this.flightPhaseManager.addOnPhaseChanged((prev, next) => this.onFlightPhaseChanged(prev, next));

const sub = this.bus.getSubscriber<FlightPhaseManagerEvents & MfdUIData>();
this.flightPhase.setConsumer(sub.on('fmgc_flight_phase'));
this.activePage.setConsumer(sub.on('mfd_active_uri'));

this.shouldBePreflightPhase.sub((shouldBePreflight) => {
if (shouldBePreflight) {
this.flightPhaseManager.changePhase(FmgcFlightPhase.Preflight);
Expand Down

0 comments on commit 29a2169

Please sign in to comment.