Skip to main content

Class: Epic2APStateManager

Defined in: workingtitle-instruments-epic2/shared/Autopilot/Epic2APStateManager.ts:22

A Epic 2 autopilot state manager.

Extends​

Constructors​

Constructor​

new Epic2APStateManager(bus, apConfig): Epic2APStateManager

Defined in: sdk/autopilot/managers/APStateManager.ts:96

Creates an instance of the APStateManager.

Parameters​

ParameterTypeDescription
busEventBusAn instance of the event bus.
apConfigAPConfigThis autopilot's configuration.

Returns​

Epic2APStateManager

Inherited from​

APStateManager.constructor

Properties​

_isFlightDirectorCoPilotOn​

protected _isFlightDirectorCoPilotOn: Subject<boolean>

Defined in: sdk/autopilot/managers/APStateManager.ts:81

Inherited from​

APStateManager._isFlightDirectorCoPilotOn


_isFlightDirectorOn​

protected _isFlightDirectorOn: Subject<boolean>

Defined in: sdk/autopilot/managers/APStateManager.ts:78

Inherited from​

APStateManager._isFlightDirectorOn


apConfig​

protected readonly apConfig: APConfig

Defined in: sdk/autopilot/managers/APStateManager.ts:96

This autopilot's configuration.

Inherited from​

APStateManager.apConfig


apListenerRegistered​

protected apListenerRegistered: boolean = false

Defined in: sdk/autopilot/managers/APStateManager.ts:40

Inherited from​

APStateManager.apListenerRegistered


apMasterOn​

apMasterOn: Subject<boolean>

Defined in: sdk/autopilot/managers/APStateManager.ts:76

Inherited from​

APStateManager.apMasterOn


approachPressed​

approachPressed: SubEventInterface<Epic2APStateManager, boolean | undefined>

Defined in: sdk/autopilot/managers/APStateManager.ts:73

Inherited from​

APStateManager.approachPressed


bus​

protected readonly bus: EventBus

Defined in: sdk/autopilot/managers/APStateManager.ts:96

An instance of the event bus.

Inherited from​

APStateManager.bus


epic2ApIntentionalDisengageEvent​

epic2ApIntentionalDisengageEvent: SubEventInterface<Epic2APStateManager, unknown>

Defined in: workingtitle-instruments-epic2/shared/Autopilot/Epic2APStateManager.ts:28


epic2HeadingSyncEvent​

epic2HeadingSyncEvent: SubEventInterface<Epic2APStateManager, HeadingSyncPushed>

Defined in: workingtitle-instruments-epic2/shared/Autopilot/Epic2APStateManager.ts:30


epic2VerticalEvent​

epic2VerticalEvent: SubEventInterface<Epic2APStateManager, PitchWheelTurned>

Defined in: workingtitle-instruments-epic2/shared/Autopilot/Epic2APStateManager.ts:29


flightDirectorCount​

protected readonly flightDirectorCount: 1 | 2

Defined in: sdk/autopilot/managers/APStateManager.ts:44

Inherited from​

APStateManager.flightDirectorCount


flightDirectorStateRegisteredSimVars​

protected readonly flightDirectorStateRegisteredSimVars: object

Defined in: sdk/autopilot/managers/APStateManager.ts:49

1​

1: RegisteredSimVar<boolean>

2​

2: RegisteredSimVar<boolean>

Inherited from​

APStateManager.flightDirectorStateRegisteredSimVars


flightDirectorStateSimVars​

protected readonly flightDirectorStateSimVars: object

Defined in: sdk/autopilot/managers/APStateManager.ts:45

1​

1: string = 'AUTOPILOT FLIGHT DIRECTOR ACTIVE:1'

2​

2: string = 'AUTOPILOT FLIGHT DIRECTOR ACTIVE:2'

Inherited from​

APStateManager.flightDirectorStateSimVars


hEventPattern​

protected readonly hEventPattern: RegExp

Defined in: workingtitle-instruments-epic2/shared/Autopilot/Epic2APStateManager.ts:26


hEventPrefixes​

protected readonly hEventPrefixes: string[]

Defined in: workingtitle-instruments-epic2/shared/Autopilot/Epic2APStateManager.ts:25


isAnyFlightDirectorOn​

readonly isAnyFlightDirectorOn: MappedSubject<[boolean, boolean], boolean>

Defined in: sdk/autopilot/managers/APStateManager.ts:85

Whether any flight director is switched on.

Inherited from​

APStateManager.isAnyFlightDirectorOn


isFlightDirectorCoPilotOn​

isFlightDirectorCoPilotOn: Subscribable<boolean>

Defined in: sdk/autopilot/managers/APStateManager.ts:82

Inherited from​

APStateManager.isFlightDirectorCoPilotOn


isFlightDirectorOn​

isFlightDirectorOn: Subscribable<boolean>

Defined in: sdk/autopilot/managers/APStateManager.ts:79

Inherited from​

APStateManager.isFlightDirectorOn


keyEventManager?​

protected optional keyEventManager: KeyEventManager

Defined in: sdk/autopilot/managers/APStateManager.ts:42

Inherited from​

APStateManager.keyEventManager


lateralPressed​

lateralPressed: SubEventInterface<Epic2APStateManager, APModePressEvent>

Defined in: sdk/autopilot/managers/APStateManager.ts:71

Inherited from​

APStateManager.lateralPressed


stateManagerInitialized​

readonly stateManagerInitialized: Subscribable<boolean>

Defined in: sdk/autopilot/managers/APStateManager.ts:69

Whether this manager has been initialized.

Inherited from​

APStateManager.stateManagerInitialized


verticalPressed​

verticalPressed: SubEventInterface<Epic2APStateManager, APModePressEvent>

Defined in: sdk/autopilot/managers/APStateManager.ts:72

Inherited from​

APStateManager.verticalPressed


vnavPressed​

vnavPressed: SubEventInterface<Epic2APStateManager, boolean>

Defined in: sdk/autopilot/managers/APStateManager.ts:74

Inherited from​

APStateManager.vnavPressed

Methods​

awaitApListenerRegistered()​

protected awaitApListenerRegistered(): Promise<void>

Defined in: sdk/autopilot/managers/APStateManager.ts:137

Waits until the Coherent autopilot listener has been registered and this.onAPListenerRegistered() has finished executing.

Returns​

Promise<void>

A Promise which is fulfilled when the Coherent autopilot listener has been registered and this.onAPListenerRegistered() has finished executing.

Inherited from​

APStateManager.awaitApListenerRegistered


awaitKeyEventManagerAvailable()​

protected awaitKeyEventManagerAvailable(): Promise<KeyEventManager>

Defined in: sdk/autopilot/managers/APStateManager.ts:145

Waits until the key event manager has been retrieved.

Returns​

Promise<KeyEventManager>

A Promise which is fulfilled when the key event manager has been retrieved.

Inherited from​

APStateManager.awaitKeyEventManagerAvailable


awaitKeyEventManagerReady()​

protected awaitKeyEventManagerReady(): Promise<KeyEventManager>

Defined in: sdk/autopilot/managers/APStateManager.ts:154

Waits until the key event manager has been retrieved and this.onKeyEventManagerReady() has finished executing.

Returns​

Promise<KeyEventManager>

A Promise which is fulfilled when the key event manager has been retrieved and this.onKeyEventManagerReady() has finished executing.

Inherited from​

APStateManager.awaitKeyEventManagerReady


disengageAutopilot()​

disengageAutopilot(abnormal): void

Defined in: workingtitle-instruments-epic2/shared/Autopilot/Epic2APStateManager.ts:88

Disengage the autopilot, either normally or abnormally.

Parameters​

ParameterTypeDefault valueDescription
abnormalbooleantrueWhether the disconnect is abnormal.

Returns​

void


handleKeyIntercepted()​

protected handleKeyIntercepted(__namedParameters): void

Defined in: workingtitle-instruments-epic2/shared/Autopilot/Epic2APStateManager.ts:206

Handles an intercepted key event.

Parameters​

ParameterTypeDescription
__namedParametersKeyEventDataThe event data.

Returns​

void

Overrides​

APStateManager.handleKeyIntercepted


handleTrkModeChange()​

protected handleTrkModeChange(trkActive): void

Defined in: workingtitle-instruments-epic2/shared/Autopilot/Epic2APStateManager.ts:65

Handle switch between hdg and trk

Parameters​

ParameterTypeDescription
trkActivebooleantrk currently active?

Returns​

void


initFlightDirector()​

protected initFlightDirector(): void

Defined in: sdk/autopilot/managers/APStateManager.ts:287

Initializes the flight director(s) to a default value.

Returns​

void

Inherited from​

APStateManager.initFlightDirector


initialize()​

initialize(): Promise<void>

Defined in: sdk/autopilot/managers/APStateManager.ts:213

Initializes this manager. If this manager has already been initialized, then this method does nothing.

Returns​

Promise<void>

A Promise which will be fulfilled when the manager has been initialized. If the manager has already been initialized, then the Promise will be fulfilled immediately.

Inherited from​

APStateManager.initialize


onAfterUpdate()​

onAfterUpdate(): void

Defined in: sdk/autopilot/managers/APStateManager.ts:377

A method that is called on every autopilot update cycle after the autopilot directors are updated.

Returns​

void

Inherited from​

APStateManager.onAfterUpdate


onAPListenerRegistered()​

protected onAPListenerRegistered(): void

Defined in: workingtitle-instruments-epic2/shared/Autopilot/Epic2APStateManager.ts:36

A callback which is called when the Coherent autopilot listener has been registered.

Returns​

void

Overrides​

APStateManager.onAPListenerRegistered


onBeforeInitialize()​

protected onBeforeInitialize(): void

Defined in: sdk/autopilot/managers/APStateManager.ts:430

Method to override with steps to run before initialze method is run.

Returns​

void

Inherited from​

APStateManager.onBeforeInitialize


onBeforeUpdate()​

onBeforeUpdate(): void

Defined in: sdk/autopilot/managers/APStateManager.ts:336

A method that is called on every autopilot update cycle before the autopilot directors are updated.

Returns​

void

Inherited from​

APStateManager.onBeforeUpdate


onFlightDirectorSimStateChanged()​

protected onFlightDirectorSimStateChanged(index, state): void

Defined in: sdk/autopilot/managers/APStateManager.ts:362

Responds to when the sim state of a flight director changes.

Parameters​

ParameterTypeDescription
index1 | 2The index of the flight director whose state changed.
statebooleanThe flight director's new state.

Returns​

void

Inherited from​

APStateManager.onFlightDirectorSimStateChanged


onHEvent()​

protected onHEvent(event): void

Defined in: workingtitle-instruments-epic2/shared/Autopilot/Epic2APStateManager.ts:367

Handles AP H Events (we only use this for events that do not have a corresponding K event we can trigger).

Parameters​

ParameterTypeDescription
eventstringThe event string.

Returns​

void


onInitialAutopilotModes()​

protected onInitialAutopilotModes(modeFlags): void

Defined in: sdk/autopilot/managers/APStateManager.ts:280

A method that is called during initialization, after avionics managed mode has been enabled and this.onKeyEventManagerReady() has finished executing, which allows this state manager to handle the initial state of native sim autopilot modes.

Parameters​

ParameterTypeDescription
modeFlagsnumberBitflags representing the state of all native sim autopilot modes. MSFSAPStates enumerates all native sim autopilot mode flags.

Returns​

void

Inherited from​

APStateManager.onInitialAutopilotModes


onKeyEventManagerReady()​

protected onKeyEventManagerReady(manager): void

Defined in: sdk/autopilot/managers/APStateManager.ts:183

A callback which is called when the key event manager has been retrieved.

Parameters​

ParameterTypeDescription
managerKeyEventManagerThe key event manager.

Returns​

void

Inherited from​

APStateManager.onKeyEventManagerReady


pendSimFlightDirectorState()​

protected pendSimFlightDirectorState(index, state): void

Defined in: sdk/autopilot/managers/APStateManager.ts:329

Pends a flight director state to push to the sim.

Parameters​

ParameterTypeDescription
index1 | 2The index of the flight director for which to pend the state.
statebooleanThe state to pend.

Returns​

void

Inherited from​

APStateManager.pendSimFlightDirectorState


pushPendingFlightDirectorStateToSim()​

protected pushPendingFlightDirectorStateToSim(index): void

Defined in: sdk/autopilot/managers/APStateManager.ts:388

Pushes the pending state of a flight director to the sim.

Parameters​

ParameterTypeDescription
index1 | 2The index of the flight director for which to push the pending state.

Returns​

void

Inherited from​

APStateManager.pushPendingFlightDirectorStateToSim


sendApModeEvent()​

protected sendApModeEvent(type, mode?, set?): void

Defined in: sdk/autopilot/managers/APStateManager.ts:409

Sends AP Mode Events from the Intercept to the Autopilot.

Parameters​

ParameterTypeDescription
typeAPModeTypeis the AP Mode Type for this event
mode?numberis the mode to set/unset.
set?booleanis whether to actively set or unset this mode.

Returns​

void

Inherited from​

APStateManager.sendApModeEvent


setFlightDirector()​

setFlightDirector(state, index?): void

Defined in: sdk/autopilot/managers/APStateManager.ts:299

Sets the flight director state.

Parameters​

ParameterTypeDescription
statebooleanThe state to set: true = on, false = off.
index?2 | 1The index of the flight director to set. If not defined, then the state of all supported flight directors will be set. If an index is defined and the specified flight director is not supported, then no action will be taken. This parameter is ignored if the autopilot is not configured with independent flight directors, in which case the state of all supported flight directors will always be set.

Returns​

void

Inherited from​

APStateManager.setFlightDirector


setFlightDirectorState()​

protected setFlightDirectorState(index, state): void

Defined in: sdk/autopilot/managers/APStateManager.ts:320

Sets the state of a flight director.

Parameters​

ParameterTypeDescription
index1 | 2The index of the flight director to set.
statebooleanThe state to set.

Returns​

void

Inherited from​

APStateManager.setFlightDirectorState


setupFlightDirectorKeyIntercepts()​

protected setupFlightDirectorKeyIntercepts(manager): void

Defined in: sdk/autopilot/managers/APStateManager.ts:192

Sets up key intercepts necessary for managing the sim's flight director state.

Parameters​

ParameterTypeDescription
managerKeyEventManagerThe key event manager.

Returns​

void

Inherited from​

APStateManager.setupFlightDirectorKeyIntercepts


setupKeyIntercepts()​

protected setupKeyIntercepts(manager): void

Defined in: workingtitle-instruments-epic2/shared/Autopilot/Epic2APStateManager.ts:111

Sets up key intercepts for the simulation autopilot key events.

Parameters​

ParameterTypeDescription
managerKeyEventManagerThe key event manager.

Returns​

void

Overrides​

APStateManager.setupKeyIntercepts


toggleVnav()​

protected toggleVnav(): void

Defined in: sdk/autopilot/managers/APStateManager.ts:398

Toggles VNAV L Var value.

Returns​

void

Inherited from​

APStateManager.toggleVnav


updateFlightDirectorStateFromSim()​

protected updateFlightDirectorStateFromSim(index): void

Defined in: sdk/autopilot/managers/APStateManager.ts:347

Updates this manager's tracked flight director state from the sim.

Parameters​

ParameterTypeDescription
index1 | 2The index of the flight director to update.

Returns​

void

Inherited from​

APStateManager.updateFlightDirectorStateFromSim