Class: Autopilot<Config>
Defined in: src/sdk/autopilot/Autopilot.ts:32
An Autopilot.
Extended by
Type Parameters
| Type Parameter | Default type |
|---|---|
Config extends APConfig | APConfig |
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
| Parameter | Type | Description |
|---|---|---|
bus | EventBus | The event bus. |
flightPlanner | FlightPlanner | This autopilot's associated flight planner. |
config | Config | This autopilot's configuration. |
stateManager | APStateManager | This autopilot's state manager. |
Returns
Autopilot<Config>
Properties
_apValues
protectedreadonly_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
nav1HasGs:
Subject<boolean>
nav2HasGs
nav2HasGs:
Subject<boolean>
nav3HasGs
nav3HasGs:
Subject<boolean>
nav4HasGs
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
protectedreadonlyactiveSimDurationSimVar:RegisteredSimVar<number>
Defined in: src/sdk/autopilot/Autopilot.ts:71
altCapArmed
protectedaltCapArmed:boolean=false
Defined in: src/sdk/autopilot/Autopilot.ts:52
apDriver
protectedreadonlyapDriver:AutopilotDriver
Defined in: src/sdk/autopilot/Autopilot.ts:43
This autopilot's sim autopilot driver.
apValues
readonlyapValues:APValues
Defined in: src/sdk/autopilot/Autopilot.ts:106
autopilotInitialized
protectedautopilotInitialized:boolean=false
Defined in: src/sdk/autopilot/Autopilot.ts:108
bus
protectedreadonlybus:EventBus
Defined in: src/sdk/autopilot/Autopilot.ts:118
The event bus.
cdiSource
protectedcdiSource:Readonly<NavSourceId>
Defined in: src/sdk/autopilot/Autopilot.ts:45
config
protectedreadonlyconfig:Config
Defined in: src/sdk/autopilot/Autopilot.ts:120
This autopilot's configuration.
currentAltitude
protectedcurrentAltitude:number=0
Defined in: src/sdk/autopilot/Autopilot.ts:60
dataProvider
protectedreadonlydataProvider:ControllableAPDataProvider
Defined in: src/sdk/autopilot/Autopilot.ts:68
flightPlanner
protectedreadonlyflightPlanner:FlightPlanner
Defined in: src/sdk/autopilot/Autopilot.ts:119
This autopilot's associated flight planner.
flightPlanSynced
protectedflightPlanSynced:boolean=false
Defined in: src/sdk/autopilot/Autopilot.ts:63
inClimb
protectedinClimb:boolean=false
Defined in: src/sdk/autopilot/Autopilot.ts:59
lateralModeFailed
protectedlateralModeFailed:boolean=false
Defined in: src/sdk/autopilot/Autopilot.ts:57
Deprecated
Mode failure and reversion logic should be handled by subclasses of Autopilot.
lateralModes
protectedreadonlylateralModes:Map<number,PlaneDirector>
Defined in: src/sdk/autopilot/Autopilot.ts:47
navToNavManager
readonlynavToNavManager:NavToNavManager2|undefined
Defined in: src/sdk/autopilot/Autopilot.ts:34
This autopilot's nav-to-nav transfer manager.
requireApproachIsActiveForNavToNav
protectedrequireApproachIsActiveForNavToNav: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
protectedreadonlysimRateSimVar:RegisteredSimVar<number>
Defined in: src/sdk/autopilot/Autopilot.ts:70
stateManager
readonlystateManager:APStateManager
Defined in: src/sdk/autopilot/Autopilot.ts:121
This autopilot's state manager.
variableBankManager
readonlyvariableBankManager:Record<any,any> |undefined
Defined in: src/sdk/autopilot/Autopilot.ts:40
This autopilot's variable bank angle Manager.
verticalAltitudeArmed
protectedverticalAltitudeArmed:APAltitudeModes=APAltitudeModes.NONE
Defined in: src/sdk/autopilot/Autopilot.ts:50
verticalApproachArmed
protectedverticalApproachArmed:number=APVerticalModes.NONE
Defined in: src/sdk/autopilot/Autopilot.ts:51
verticalModes
protectedreadonlyverticalModes:Map<number,PlaneDirector>
Defined in: src/sdk/autopilot/Autopilot.ts:48
vnavCaptureType
protectedvnavCaptureType:VNavAltCaptureType=VNavAltCaptureType.None
Defined in: src/sdk/autopilot/Autopilot.ts:61
vnavManager
readonlyvnavManager:VNavManager|undefined
Defined in: src/sdk/autopilot/Autopilot.ts:37
This autopilot's VNav Manager.
Methods
approachPressed()
protectedapproachPressed(set?):void
Defined in: src/sdk/autopilot/Autopilot.ts:830
Handles input from the State Manager when the APPR button is pressed.
Parameters
| Parameter | Type | Description |
|---|---|---|
set? | boolean | is whether this event commands a specific set |
Returns
void
checkModes()
protectedcheckModes():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()
protectedcheckPitchModeActive():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()
protectedcheckRollModeActive():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()
protectedcreateDirectors(config):void
Defined in: src/sdk/autopilot/Autopilot.ts:174
Creates this autopilot's directors.
Parameters
| Parameter | Type | Description |
|---|---|---|
config | APConfig | This autopilot's configuration. |
Returns
void
createLateralDirectors()
protectedcreateLateralDirectors(config):void
Defined in: src/sdk/autopilot/Autopilot.ts:183
Creates this autopilot's lateral mode directors.
Parameters
| Parameter | Type | Description |
|---|---|---|
config | APConfig | This autopilot's configuration. |
Returns
void
createLateralNoneDirector()
protectedcreateLateralNoneDirector():PlaneDirector
Defined in: src/sdk/autopilot/Autopilot.ts:198
Creates a director for the APLateralModes.NONE mode.
Returns
A director for the APLateralModes.NONE mode.
createVerticalDirectors()
protectedcreateVerticalDirectors(config):void
Defined in: src/sdk/autopilot/Autopilot.ts:206
Creates this autopilot's vertical mode directors.
Parameters
| Parameter | Type | Description |
|---|---|---|
config | APConfig | This autopilot's configuration. |
Returns
void
createVerticalNoneDirector()
protectedcreateVerticalNoneDirector():PlaneDirector
Defined in: src/sdk/autopilot/Autopilot.ts:222
Creates a director for the APVerticalModes.NONE mode.
Returns
A director for the APVerticalModes.NONE mode.
deactivateArmedOrActiveLateralMode()
protecteddeactivateArmedOrActiveLateralMode(mode):boolean
Defined in: src/sdk/autopilot/Autopilot.ts:750
Attempts to deactivate an armed or active lateral mode.
Parameters
| Parameter | Type | Description |
|---|---|---|
mode | number | The lateral mode to deactivate. |
Returns
boolean
Whether the specified mode was armed or active and deactivated by this method.
deactivateArmedOrActiveVerticalMode()
protecteddeactivateArmedOrActiveVerticalMode(mode):boolean
Defined in: src/sdk/autopilot/Autopilot.ts:805
Attempts to deactivate an armed or active vertical mode.
Parameters
| Parameter | Type | Description |
|---|---|---|
mode | number | The vertical mode to deactivate. |
Returns
boolean
Whether the specified mode was armed or active and deactivated by this method.
deactivateLateralActive()
protecteddeactivateLateralActive():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()
protecteddeactivateLateralArmed():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()
protecteddeactivateVerticalActive():void
Defined in: src/sdk/autopilot/Autopilot.ts:1067
Deactivates the current vertical active mode and arms the default vertical mode.
Returns
void
deactivateVerticalApproachArmed()
protecteddeactivateVerticalApproachArmed():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()
protecteddeactivateVerticalArmed():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()
protectedgetArmableApproachType():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()
protectedgetDefaultLateralMode():APLateralModes
Defined in: src/sdk/autopilot/Autopilot.ts:1377
Get the default lateral mode from APConfig
Returns
default lateral mode
getDefaultVerticalMode()
protectedgetDefaultVerticalMode():APVerticalModes
Defined in: src/sdk/autopilot/Autopilot.ts:1389
Get the default vertical mode from APConfig
Returns
default vertical mode
handleApFdStateChange()
protectedhandleApFdStateChange():void
Defined in: src/sdk/autopilot/Autopilot.ts:542
Manages the FD state and the modes when AP/FD are off.
Returns
void
handleLateralActiveModeReversion()
protectedhandleLateralActiveModeReversion(mode):void
Defined in: src/sdk/autopilot/Autopilot.ts:1223
Handles when the active lateral mode must be reverted to another mode.
Parameters
| Parameter | Type | Description |
|---|---|---|
mode | number | The active lateral mode that must be reverted. |
Returns
void
handleVerticalActiveModeReversion()
protectedhandleVerticalActiveModeReversion(mode):void
Defined in: src/sdk/autopilot/Autopilot.ts:1236
Handles when the active vertical mode must be reverted to another mode.
Parameters
| Parameter | Type | Description |
|---|---|---|
mode | number | The active vertical mode that must be reverted. |
Returns
void
initLateralModeDirector()
protectedinitLateralModeDirector(mode,director,setBank?,driveBank?):void
Defined in: src/sdk/autopilot/Autopilot.ts:245
Initializes a lateral mode director.
Parameters
| Parameter | Type | Description |
|---|---|---|
mode | number | The director's mode. |
director | PlaneDirector | The director to initialize. |
setBank? | (bank) => void | A function that the director can use to set the flight director's commanded bank angle. |
driveBank? | (bank, rate?) => void | A function that the director can use to drive the flight director's commanded bank angle. |
Returns
void
initLateralModes()
protectedinitLateralModes():void
Defined in: src/sdk/autopilot/Autopilot.ts:229
Initializes this autopilot's lateral modes.
Returns
void
initNavToNavManager()
protectedinitNavToNavManager():void
Defined in: src/sdk/autopilot/Autopilot.ts:359
Initializes the Autopilot with the available Nav To Nav Manager.
Returns
void
initVerticalModeDirector()
protectedinitVerticalModeDirector(mode,director,setPitch?,drivePitch?):void
Defined in: src/sdk/autopilot/Autopilot.ts:277
Initializes a vertical mode director.
Parameters
| Parameter | Type | Description |
|---|---|---|
mode | number | The director's mode. |
director | PlaneDirector | The director to initialize. |
setPitch? | (pitch, resetServo?, maxNoseDownPitch?, maxNoseUpPitch?) => void | A function that the director can use to set the flight director's commanded pitch angle. |
drivePitch? | (pitch, adjustForAoa?, adjustForVerticalWind?, rate?, maxNoseDownPitch?, maxNoseUpPitch?) => void | A function that the director can use to drive the flight director's commanded pitch angle. |
Returns
void
initVerticalModes()
protectedinitVerticalModes():void
Defined in: src/sdk/autopilot/Autopilot.ts:261
Initializes this autopilot's vertical modes.
Returns
void
initVNavManager()
protectedinitVNavManager():void
Defined in: src/sdk/autopilot/Autopilot.ts:375
Initializes the Autopilot with the available VNav Manager.
Returns
void
isLateralModeActivatedOrArmed()
protectedisLateralModeActivatedOrArmed(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
| Parameter | Type | Description |
|---|---|---|
mode | number | The 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()
protectedlateralPressed(data):void
Defined in: src/sdk/autopilot/Autopilot.ts:637
Handles input from the State Manager when a lateral mode button is pressed.
Parameters
| Parameter | Type | Description |
|---|---|---|
data | APModePressEvent | is the AP Lateral Mode Event Data |
Returns
void
manageAltitudeCapture()
protectedmanageAltitudeCapture():void
Defined in: src/sdk/autopilot/Autopilot.ts:1278
Checks and sets the proper armed altitude mode.
Returns
void
monitorAdditionalEvents()
protectedmonitorAdditionalEvents():void
Defined in: src/sdk/autopilot/Autopilot.ts:572
Additional events to be monitored (to be overridden).
Returns
void
monitorApSpeedValues()
protectedmonitorApSpeedValues():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()
protectedmonitorEvents():void
Defined in: src/sdk/autopilot/Autopilot.ts:403
Monitors subevents and bus events.
Returns
void
onAfterUpdate()
protectedonAfterUpdate():void
Defined in: src/sdk/autopilot/Autopilot.ts:622
This method runs each update cycle after the update occurs.
Returns
void
onBeforeUpdate()
protectedonBeforeUpdate():void
Defined in: src/sdk/autopilot/Autopilot.ts:615
This method runs each update cycle before the update occurs.
Returns
void
onInitialized()
protectedonInitialized():void
Defined in: src/sdk/autopilot/Autopilot.ts:629
This method runs whenever the initialized state of the Autopilot changes.
Returns
void
setAltHold()
protectedsetAltHold():void
Defined in: src/sdk/autopilot/Autopilot.ts:1164
Method called when the ALT button is pressed.
Returns
void
setLateralActive()
protectedsetLateralActive(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
| Parameter | Type | Description |
|---|---|---|
mode | number | The mode to set. |
Returns
void
setLateralArmed()
protectedsetLateralArmed(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
| Parameter | Type | Description |
|---|---|---|
mode | number | The mode to set. |
Returns
void
setVerticalActive()
protectedsetVerticalActive(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
| Parameter | Type | Description |
|---|---|---|
mode | number | The mode to set. |
Returns
void
setVerticalApproachArmed()
protectedsetVerticalApproachArmed(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
| Parameter | Type | Description |
|---|---|---|
mode | number | The mode to set. |
Returns
void
setVerticalArmed()
protectedsetVerticalArmed(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
| Parameter | Type | Description |
|---|---|---|
mode | number | The mode to set. |
Returns
void
togaPressed()
protectedtogaPressed():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()
protectedupdateCachedAltitudeData():void
Defined in: src/sdk/autopilot/Autopilot.ts:607
Updates this autopilot's cached altitude data.
Returns
void
updateModes()
protectedupdateModes():void
Defined in: src/sdk/autopilot/Autopilot.ts:1243
Runs update on each of the active and armed modes.
Returns
void
updateNavToNavManagerAfter()
protectedupdateNavToNavManagerAfter():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()
protectedupdateNavToNavManagerBefore():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()
protectedupdateSimModes():void
Defined in: src/sdk/autopilot/Autopilot.ts:1334
Updates the sim autopilot's modes.
Returns
void
verticalPressed()
protectedverticalPressed(data):void
Defined in: src/sdk/autopilot/Autopilot.ts:685
Handles input from the State Manager when a vertical mode button is pressed.
Parameters
| Parameter | Type | Description |
|---|---|---|
data | APModePressEvent | is the AP Vertical Mode Event Data |
Returns
void