Skip to main content

Class: Autopilot<Config>

Defined in: src/sdk/autopilot/Autopilot.ts:32

An Autopilot.

Extended by​

Type Parameters​

Type ParameterDefault type
Config extends APConfigAPConfig

Constructors​

Constructor​

new Autopilot<Config>(bus, flightPlanner, config, stateManager): Autopilot<Config>

Defined in: src/sdk/autopilot/Autopilot.ts:117

Creates an instance of the Autopilot.

Parameters​

ParameterTypeDescription
busEventBusThe event bus.
flightPlannerFlightPlannerThis autopilot's associated flight planner.
configConfigThis autopilot's configuration.
stateManagerAPStateManagerThis autopilot's state manager.

Returns​

Autopilot<Config>

Properties​

_apValues​

protected readonly _apValues: object

Defined in: src/sdk/autopilot/Autopilot.ts:73

activeSimDuration​

activeSimDuration: Subject<number>

apApproachModeOn​

apApproachModeOn: Subject<boolean>

apMasterOn​

apMasterOn: Subject<boolean>

approachHasGP​

approachHasGP: Subject<boolean>

approachIsActive​

approachIsActive: Subject<boolean>

capturedAltitude​

capturedAltitude: Subject<number>

cdiId​

cdiId: string

cdiSource​

cdiSource: Subject<Readonly<NavSourceId>>

dataProvider​

dataProvider: ControllableAPDataProvider

isSelectedSpeedInMach​

isSelectedSpeedInMach: Subject<boolean>

lateralActive​

lateralActive: Subject<APLateralModes>

lateralArmed​

lateralArmed: Subject<APLateralModes>

maxBankAngle​

maxBankAngle: Subject<number>

maxBankId​

maxBankId: Subject<number>

maxNoseDownPitchAngle​

maxNoseDownPitchAngle: Subject<number>

maxNoseUpPitchAngle​

maxNoseUpPitchAngle: Subject<number>

nav1HasGs: Subject<boolean>

nav2HasGs: Subject<boolean>

nav3HasGs: Subject<boolean>

nav4HasGs: Subject<boolean>

selectedAltitude​

selectedAltitude: Subject<number>

selectedFlightPathAngle​

selectedFlightPathAngle: Subject<number>

selectedHeading​

selectedHeading: Subject<number>

selectedIas​

selectedIas: Subject<number>

selectedMach​

selectedMach: Subject<number>

selectedPitch​

selectedPitch: Subject<number>

selectedVerticalSpeed​

selectedVerticalSpeed: Subject<number>

simRate​

simRate: Subject<number>

verticalActive​

verticalActive: Subject<APVerticalModes>

verticalArmed​

verticalArmed: Subject<APVerticalModes>


activeSimDurationSimVar​

protected readonly activeSimDurationSimVar: RegisteredSimVar<number>

Defined in: src/sdk/autopilot/Autopilot.ts:71


altCapArmed​

protected altCapArmed: boolean = false

Defined in: src/sdk/autopilot/Autopilot.ts:52


apDriver​

protected readonly apDriver: AutopilotDriver

Defined in: src/sdk/autopilot/Autopilot.ts:43

This autopilot's sim autopilot driver.


apValues​

readonly apValues: APValues

Defined in: src/sdk/autopilot/Autopilot.ts:106


autopilotInitialized​

protected autopilotInitialized: boolean = false

Defined in: src/sdk/autopilot/Autopilot.ts:108


bus​

protected readonly bus: EventBus

Defined in: src/sdk/autopilot/Autopilot.ts:118

The event bus.


cdiSource​

protected cdiSource: Readonly<NavSourceId>

Defined in: src/sdk/autopilot/Autopilot.ts:45


config​

protected readonly config: Config

Defined in: src/sdk/autopilot/Autopilot.ts:120

This autopilot's configuration.


currentAltitude​

protected currentAltitude: number = 0

Defined in: src/sdk/autopilot/Autopilot.ts:60


dataProvider​

protected readonly dataProvider: ControllableAPDataProvider

Defined in: src/sdk/autopilot/Autopilot.ts:68


flightPlanner​

protected readonly flightPlanner: FlightPlanner

Defined in: src/sdk/autopilot/Autopilot.ts:119

This autopilot's associated flight planner.


flightPlanSynced​

protected flightPlanSynced: boolean = false

Defined in: src/sdk/autopilot/Autopilot.ts:63


inClimb​

protected inClimb: boolean = false

Defined in: src/sdk/autopilot/Autopilot.ts:59


lateralModeFailed​

protected lateralModeFailed: boolean = false

Defined in: src/sdk/autopilot/Autopilot.ts:57

Deprecated​

Mode failure and reversion logic should be handled by subclasses of Autopilot.


lateralModes​

protected readonly lateralModes: Map<number, PlaneDirector>

Defined in: src/sdk/autopilot/Autopilot.ts:47


readonly navToNavManager: NavToNavManager2 | undefined

Defined in: src/sdk/autopilot/Autopilot.ts:34

This autopilot's nav-to-nav transfer manager.


requireApproachIsActiveForNavToNav​

protected requireApproachIsActiveForNavToNav: boolean = true

Defined in: src/sdk/autopilot/Autopilot.ts:66

Can be set to false in child classes to override behavior for certain aircraft.


simRateSimVar​

protected readonly simRateSimVar: RegisteredSimVar<number>

Defined in: src/sdk/autopilot/Autopilot.ts:70


stateManager​

readonly stateManager: APStateManager

Defined in: src/sdk/autopilot/Autopilot.ts:121

This autopilot's state manager.


variableBankManager​

readonly variableBankManager: Record<any, any> | undefined

Defined in: src/sdk/autopilot/Autopilot.ts:40

This autopilot's variable bank angle Manager.


verticalAltitudeArmed​

protected verticalAltitudeArmed: APAltitudeModes = APAltitudeModes.NONE

Defined in: src/sdk/autopilot/Autopilot.ts:50


verticalApproachArmed​

protected verticalApproachArmed: number = APVerticalModes.NONE

Defined in: src/sdk/autopilot/Autopilot.ts:51


verticalModes​

protected readonly verticalModes: Map<number, PlaneDirector>

Defined in: src/sdk/autopilot/Autopilot.ts:48


vnavCaptureType​

protected vnavCaptureType: VNavAltCaptureType = VNavAltCaptureType.None

Defined in: src/sdk/autopilot/Autopilot.ts:61


vnavManager​

readonly vnavManager: VNavManager | undefined

Defined in: src/sdk/autopilot/Autopilot.ts:37

This autopilot's VNav Manager.

Methods​

approachPressed()​

protected approachPressed(set?): void

Defined in: src/sdk/autopilot/Autopilot.ts:830

Handles input from the State Manager when the APPR button is pressed.

Parameters​

ParameterTypeDescription
set?booleanis whether this event commands a specific set

Returns​

void


checkModes()​

protected checkModes(): void

Defined in: src/sdk/autopilot/Autopilot.ts:1176

Checks if all the active and armed modes are still in their proper state and takes corrective action if not.

Returns​

void


checkPitchModeActive()​

protected checkPitchModeActive(): void

Defined in: src/sdk/autopilot/Autopilot.ts:1367

Checks if the sim autopilot's pitch mode is active and activates it if not.

Returns​

void


checkRollModeActive()​

protected checkRollModeActive(): void

Defined in: src/sdk/autopilot/Autopilot.ts:1358

Checks if the sim autopilot's roll (bank) mode is active and activates it if not.

Returns​

void


createDirectors()​

protected createDirectors(config): void

Defined in: src/sdk/autopilot/Autopilot.ts:174

Creates this autopilot's directors.

Parameters​

ParameterTypeDescription
configAPConfigThis autopilot's configuration.

Returns​

void


createLateralDirectors()​

protected createLateralDirectors(config): void

Defined in: src/sdk/autopilot/Autopilot.ts:183

Creates this autopilot's lateral mode directors.

Parameters​

ParameterTypeDescription
configAPConfigThis autopilot's configuration.

Returns​

void


createLateralNoneDirector()​

protected createLateralNoneDirector(): PlaneDirector

Defined in: src/sdk/autopilot/Autopilot.ts:198

Creates a director for the APLateralModes.NONE mode.

Returns​

PlaneDirector

A director for the APLateralModes.NONE mode.


createVerticalDirectors()​

protected createVerticalDirectors(config): void

Defined in: src/sdk/autopilot/Autopilot.ts:206

Creates this autopilot's vertical mode directors.

Parameters​

ParameterTypeDescription
configAPConfigThis autopilot's configuration.

Returns​

void


createVerticalNoneDirector()​

protected createVerticalNoneDirector(): PlaneDirector

Defined in: src/sdk/autopilot/Autopilot.ts:222

Creates a director for the APVerticalModes.NONE mode.

Returns​

PlaneDirector

A director for the APVerticalModes.NONE mode.


deactivateArmedOrActiveLateralMode()​

protected deactivateArmedOrActiveLateralMode(mode): boolean

Defined in: src/sdk/autopilot/Autopilot.ts:750

Attempts to deactivate an armed or active lateral mode.

Parameters​

ParameterTypeDescription
modenumberThe lateral mode to deactivate.

Returns​

boolean

Whether the specified mode was armed or active and deactivated by this method.


deactivateArmedOrActiveVerticalMode()​

protected deactivateArmedOrActiveVerticalMode(mode): boolean

Defined in: src/sdk/autopilot/Autopilot.ts:805

Attempts to deactivate an armed or active vertical mode.

Parameters​

ParameterTypeDescription
modenumberThe vertical mode to deactivate.

Returns​

boolean

Whether the specified mode was armed or active and deactivated by this method.


deactivateLateralActive()​

protected deactivateLateralActive(): void

Defined in: src/sdk/autopilot/Autopilot.ts:974

Deactivates the director for the current lateral active mode and arms the default lateral mode.

Returns​

void


deactivateLateralArmed()​

protected deactivateLateralArmed(): void

Defined in: src/sdk/autopilot/Autopilot.ts:1022

Deactivates the director for the current lateral armed mode and sets the lateral armed mode to APLateralModes.NONE. If the current lateral armed mode is already APLateralModes.NONE, then this method does nothing.

Returns​

void


deactivateVerticalActive()​

protected deactivateVerticalActive(): void

Defined in: src/sdk/autopilot/Autopilot.ts:1067

Deactivates the current vertical active mode and arms the default vertical mode.

Returns​

void


deactivateVerticalApproachArmed()​

protected deactivateVerticalApproachArmed(): void

Defined in: src/sdk/autopilot/Autopilot.ts:1157

Deactivates the current vertical approach armed mode and sets the vertical approach armed mode to APVerticalModes.NONE. If the current vertical approach armed mode is already APVerticalModes.NONE, then this method does nothing.

Returns​

void


deactivateVerticalArmed()​

protected deactivateVerticalArmed(): void

Defined in: src/sdk/autopilot/Autopilot.ts:1117

Deactivates the current vertical armed mode and sets the vertical armed mode to APVerticalModes.NONE. If the current vertical armed mode is already APVerticalModes.NONE, then this method does nothing.

Returns​

void


getArmableApproachType()​

protected getArmableApproachType(): number

Defined in: src/sdk/autopilot/Autopilot.ts:909

Returns the AP Lateral Mode that can be armed.

Returns​

number

The AP Lateral Mode that can be armed.


getDefaultLateralMode()​

protected getDefaultLateralMode(): APLateralModes

Defined in: src/sdk/autopilot/Autopilot.ts:1377

Get the default lateral mode from APConfig

Returns​

APLateralModes

default lateral mode


getDefaultVerticalMode()​

protected getDefaultVerticalMode(): APVerticalModes

Defined in: src/sdk/autopilot/Autopilot.ts:1389

Get the default vertical mode from APConfig

Returns​

APVerticalModes

default vertical mode


handleApFdStateChange()​

protected handleApFdStateChange(): void

Defined in: src/sdk/autopilot/Autopilot.ts:542

Manages the FD state and the modes when AP/FD are off.

Returns​

void


handleLateralActiveModeReversion()​

protected handleLateralActiveModeReversion(mode): void

Defined in: src/sdk/autopilot/Autopilot.ts:1223

Handles when the active lateral mode must be reverted to another mode.

Parameters​

ParameterTypeDescription
modenumberThe active lateral mode that must be reverted.

Returns​

void


handleVerticalActiveModeReversion()​

protected handleVerticalActiveModeReversion(mode): void

Defined in: src/sdk/autopilot/Autopilot.ts:1236

Handles when the active vertical mode must be reverted to another mode.

Parameters​

ParameterTypeDescription
modenumberThe active vertical mode that must be reverted.

Returns​

void


initLateralModeDirector()​

protected initLateralModeDirector(mode, director, setBank?, driveBank?): void

Defined in: src/sdk/autopilot/Autopilot.ts:245

Initializes a lateral mode director.

Parameters​

ParameterTypeDescription
modenumberThe director's mode.
directorPlaneDirectorThe director to initialize.
setBank?(bank) => voidA function that the director can use to set the flight director's commanded bank angle.
driveBank?(bank, rate?) => voidA function that the director can use to drive the flight director's commanded bank angle.

Returns​

void


initLateralModes()​

protected initLateralModes(): void

Defined in: src/sdk/autopilot/Autopilot.ts:229

Initializes this autopilot's lateral modes.

Returns​

void


initNavToNavManager()​

protected initNavToNavManager(): void

Defined in: src/sdk/autopilot/Autopilot.ts:359

Initializes the Autopilot with the available Nav To Nav Manager.

Returns​

void


initVerticalModeDirector()​

protected initVerticalModeDirector(mode, director, setPitch?, drivePitch?): void

Defined in: src/sdk/autopilot/Autopilot.ts:277

Initializes a vertical mode director.

Parameters​

ParameterTypeDescription
modenumberThe director's mode.
directorPlaneDirectorThe director to initialize.
setPitch?(pitch, resetServo?, maxNoseDownPitch?, maxNoseUpPitch?) => voidA function that the director can use to set the flight director's commanded pitch angle.
drivePitch?(pitch, adjustForAoa?, adjustForVerticalWind?, rate?, maxNoseDownPitch?, maxNoseUpPitch?) => voidA function that the director can use to drive the flight director's commanded pitch angle.

Returns​

void


initVerticalModes()​

protected initVerticalModes(): void

Defined in: src/sdk/autopilot/Autopilot.ts:261

Initializes this autopilot's vertical modes.

Returns​

void


initVNavManager()​

protected initVNavManager(): void

Defined in: src/sdk/autopilot/Autopilot.ts:375

Initializes the Autopilot with the available VNav Manager.

Returns​

void


isLateralModeActivatedOrArmed()​

protected isLateralModeActivatedOrArmed(mode): boolean

Defined in: src/sdk/autopilot/Autopilot.ts:741

Checks if a lateral mode is armed or active and if so, deactivates it.

Parameters​

ParameterTypeDescription
modenumberThe lateral mode to check and deactivate.

Returns​

boolean

Whether the specified mode was armed or active and deactivated by this method.

Deprecated​

Please use deactivateArmedOrActiveLateralMode() instead.


lateralPressed()​

protected lateralPressed(data): void

Defined in: src/sdk/autopilot/Autopilot.ts:637

Handles input from the State Manager when a lateral mode button is pressed.

Parameters​

ParameterTypeDescription
dataAPModePressEventis the AP Lateral Mode Event Data

Returns​

void


manageAltitudeCapture()​

protected manageAltitudeCapture(): void

Defined in: src/sdk/autopilot/Autopilot.ts:1278

Checks and sets the proper armed altitude mode.

Returns​

void


monitorAdditionalEvents()​

protected monitorAdditionalEvents(): void

Defined in: src/sdk/autopilot/Autopilot.ts:572

Additional events to be monitored (to be overridden).

Returns​

void


monitorApSpeedValues()​

protected monitorApSpeedValues(): void

Defined in: src/sdk/autopilot/Autopilot.ts:526

Overridable method for setting the selected speed values for the A/P to follow.

Returns​

void


monitorEvents()​

protected monitorEvents(): void

Defined in: src/sdk/autopilot/Autopilot.ts:403

Monitors subevents and bus events.

Returns​

void


onAfterUpdate()​

protected onAfterUpdate(): void

Defined in: src/sdk/autopilot/Autopilot.ts:622

This method runs each update cycle after the update occurs.

Returns​

void


onBeforeUpdate()​

protected onBeforeUpdate(): void

Defined in: src/sdk/autopilot/Autopilot.ts:615

This method runs each update cycle before the update occurs.

Returns​

void


onInitialized()​

protected onInitialized(): void

Defined in: src/sdk/autopilot/Autopilot.ts:629

This method runs whenever the initialized state of the Autopilot changes.

Returns​

void


setAltHold()​

protected setAltHold(): void

Defined in: src/sdk/autopilot/Autopilot.ts:1164

Method called when the ALT button is pressed.

Returns​

void


setLateralActive()​

protected setLateralActive(mode): void

Defined in: src/sdk/autopilot/Autopilot.ts:943

Sets the lateral active mode. If the new active mode is the current armed mode, then the lateral armed mode will be set to APLateralModes.NONE. If the current active mode is not equal to the new active mode, then the director for the current active mode will be deactivated.

Important: this method will not activate the director for the new active mode.

Parameters​

ParameterTypeDescription
modenumberThe mode to set.

Returns​

void


setLateralArmed()​

protected setLateralArmed(mode): void

Defined in: src/sdk/autopilot/Autopilot.ts:993

Sets the lateral armed mode. If the current armed mode is not equal to the new armed mode, then the director for the current armed mode will be deactivated (unless the current armed mode is APLateralModes.NONE, in which case the director will only be deactivated if the current lateral active mode is not also APLateralModes.NONE).

Important: this method will not arm the director for the new armed mode.

Parameters​

ParameterTypeDescription
modenumberThe mode to set.

Returns​

void


setVerticalActive()​

protected setVerticalActive(mode): void

Defined in: src/sdk/autopilot/Autopilot.ts:1035

Sets the vertical active mode. If the new active mode is the current vertical armed mode or vertical approach armed mode, then the vertical armed mode or vertical approach armed mode will be set to APVerticalModes.NONE. If the current active mode is not equal to the new active mode, then the director for the current active mode will be deactivated.

Important: this method will not activate the director for the new active mode.

Parameters​

ParameterTypeDescription
modenumberThe mode to set.

Returns​

void


setVerticalApproachArmed()​

protected setVerticalApproachArmed(mode): void

Defined in: src/sdk/autopilot/Autopilot.ts:1130

Sets the vertical approach armed mode. If the current vertical approach armed mode is not equal to the new armed mode, then the director for the current vertical approach armed mode will be deactivated (unless the current vertical approach armed mode is APVerticalModes.NONE, in which case the director will only be deactivated if the current vertical active mode and current vertical armed mode are not also APVerticalModes.NONE).

Important: this method will not arm the director for the new armed mode.

Parameters​

ParameterTypeDescription
modenumberThe mode to set.

Returns​

void


setVerticalArmed()​

protected setVerticalArmed(mode): void

Defined in: src/sdk/autopilot/Autopilot.ts:1087

Sets the vertical armed mode. If the current armed mode is not equal to the new armed mode, then the director for the current armed mode will be deactivated (unless the current armed mode is APVerticalModes.NONE, in which case the director will only be deactivated if the current vertical active mode is not also APVerticalModes.NONE).

Important: this method will not arm the director for the new armed mode.

Parameters​

ParameterTypeDescription
modenumberThe mode to set.

Returns​

void


togaPressed()​

protected togaPressed(): void

Defined in: src/sdk/autopilot/Autopilot.ts:861

Handles input from the State Manager when the TOGA button is pressed (K event AUTO_THROTTLE_TO_GA)

Returns​

void


update()​

update(): void

Defined in: src/sdk/autopilot/Autopilot.ts:579

Update method for the Autopilot.

Returns​

void


updateCachedAltitudeData()​

protected updateCachedAltitudeData(): void

Defined in: src/sdk/autopilot/Autopilot.ts:607

Updates this autopilot's cached altitude data.

Returns​

void


updateModes()​

protected updateModes(): void

Defined in: src/sdk/autopilot/Autopilot.ts:1243

Runs update on each of the active and armed modes.

Returns​

void


updateNavToNavManagerAfter()​

protected updateNavToNavManagerAfter(): void

Defined in: src/sdk/autopilot/Autopilot.ts:1327

Updates this autopilot's nav-to-nav manager after directors have been updated.

Returns​

void


updateNavToNavManagerBefore()​

protected updateNavToNavManagerBefore(): void

Defined in: src/sdk/autopilot/Autopilot.ts:1320

Updates this autopilot's nav-to-nav manager before directors have been updated.

Returns​

void


updateSimModes()​

protected updateSimModes(): void

Defined in: src/sdk/autopilot/Autopilot.ts:1334

Updates the sim autopilot's modes.

Returns​

void


verticalPressed()​

protected verticalPressed(data): void

Defined in: src/sdk/autopilot/Autopilot.ts:685

Handles input from the State Manager when a vertical mode button is pressed.

Parameters​

ParameterTypeDescription
dataAPModePressEventis the AP Vertical Mode Event Data

Returns​

void