Skip to main content

Class: ThrottleLeverManager

A manager for virtual throttle levers. Intercepts key events that control engine throttle settings and uses them to move virtual throttle levers instead. The positions of the virtual throttle levers are published on the event bus.

Constructors

constructor

new ThrottleLeverManager(bus, onInitCallback?, throttleLeverHandler?): ThrottleLeverManager

Constructor.

Parameters

NameTypeDescription
busEventBusThe event bus.
onInitCallback?() => voidA callback function to be executed once this manager is initialized.
throttleLeverHandler?(index: number, currentPos: number, newPos: number, keyEvent: undefined | string) => numberA callback function which handles requested changes to throttle lever position. The function should take three arguments: the index of the throttle lever, the current lever position (-1 to +1), and the requested new lever position (-1 to +1), and return the position the lever should be set to. If not defined, all requested changes to throttle lever position will be processed as-is.

Returns

ThrottleLeverManager

Defined in

src/sdk/fadec/ThrottleLeverManager.ts:59

Methods

changeThrottleLeverPos

changeThrottleLeverPos(index, delta): number

Changes the position of a throttle lever.

Parameters

NameTypeDescription
indexnumberThe index of the throttle lever to change, from 1 to 4, inclusive.
deltanumberThe amount by which to change the lever position. The full lever range is expressed as -1 to +1.

Returns

number

The throttle lever position at the end of the operation, in the range -1 to +1.

Throws

Error if index is out of bounds.

Defined in

src/sdk/fadec/ThrottleLeverManager.ts:175


changeThrottleLeverPosRaw

changeThrottleLeverPosRaw(index, delta): number

Changes the raw position of a throttle lever.

Parameters

NameTypeDescription
indexnumberThe index of the throttle lever to change, from 1 to 4, inclusive.
deltanumberThe amount by which to change the raw lever position. The full lever range is expressed as -16384 to +16384.

Returns

number

The raw throttle lever position at the end of the operation, in the range -16384 to +16384.

Throws

Error if index is out of bounds.

Defined in

src/sdk/fadec/ThrottleLeverManager.ts:217


getThrottleLeverPos

getThrottleLeverPos(index): number

Gets the position of a throttle lever.

Parameters

NameTypeDescription
indexnumberThe index of the throttle lever to get, from 1 to 4, inclusive.

Returns

number

The throttle lever position, in the range -1 to +1.

Defined in

src/sdk/fadec/ThrottleLeverManager.ts:164


getThrottleLeverPosRaw

getThrottleLeverPosRaw(index): number

Gets the raw position of a throttle lever.

Parameters

NameTypeDescription
indexnumberThe index of the throttle lever to get, from 1 to 4, inclusive.

Returns

number

The raw throttle lever position, in the range -16384 to +16384.

Throws

Error if index is out of bounds.

Defined in

src/sdk/fadec/ThrottleLeverManager.ts:201


setThrottleLeverPos

setThrottleLeverPos(index, pos): number

Sets the position of a throttle lever.

Parameters

NameTypeDescription
indexnumberThe index of the throttle lever to set, from 1 to 4, inclusive.
posnumberThe position to set, in the range -1 to +1.

Returns

number

The throttle lever position at the end of the operation, in the range -1 to +1.

Throws

Error if index is out of bounds.

Defined in

src/sdk/fadec/ThrottleLeverManager.ts:155


setThrottleLeverPosRaw

setThrottleLeverPosRaw(index, pos): number

Sets the raw position of a throttle lever.

Parameters

NameTypeDescription
indexnumberThe index of the throttle lever to set, from 1 to 4, inclusive.
posnumberThe raw position to set, in the range -16384 to +16384.

Returns

number

The raw throttle lever position at the end of the operation, in the range -16384 to +16384.

Throws

Error if index is out of bounds.

Defined in

src/sdk/fadec/ThrottleLeverManager.ts:186