Class: ThrottleLeverManager
Defined in: src/sdk/fadec/ThrottleLeverManager.ts:32
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
Defined in: src/sdk/fadec/ThrottleLeverManager.ts:59
Constructor.
Parameters
Parameter | Type | Description |
---|---|---|
bus | EventBus | The event bus. |
onInitCallback? | () => void | A callback function to be executed once this manager is initialized. |
throttleLeverHandler? | (index , currentPos , newPos , keyEvent ) => number | A 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
Methods
changeThrottleLeverPos()
changeThrottleLeverPos(
index
,delta
):number
Defined in: src/sdk/fadec/ThrottleLeverManager.ts:175
Changes the position of a throttle lever.
Parameters
Parameter | Type | Description |
---|---|---|
index | number | The index of the throttle lever to change, from 1 to 4, inclusive. |
delta | number | The 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.
changeThrottleLeverPosRaw()
changeThrottleLeverPosRaw(
index
,delta
):number
Defined in: src/sdk/fadec/ThrottleLeverManager.ts:217
Changes the raw position of a throttle lever.
Parameters
Parameter | Type | Description |
---|---|---|
index | number | The index of the throttle lever to change, from 1 to 4, inclusive. |
delta | number | The 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.
getThrottleLeverPos()
getThrottleLeverPos(
index
):number
Defined in: src/sdk/fadec/ThrottleLeverManager.ts:164
Gets the position of a throttle lever.
Parameters
Parameter | Type | Description |
---|---|---|
index | number | The index of the throttle lever to get, from 1 to 4, inclusive. |
Returns
number
The throttle lever position, in the range -1 to +1.
getThrottleLeverPosRaw()
getThrottleLeverPosRaw(
index
):number
Defined in: src/sdk/fadec/ThrottleLeverManager.ts:201
Gets the raw position of a throttle lever.
Parameters
Parameter | Type | Description |
---|---|---|
index | number | The 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.
setThrottleLeverPos()
setThrottleLeverPos(
index
,pos
):number
Defined in: src/sdk/fadec/ThrottleLeverManager.ts:155
Sets the position of a throttle lever.
Parameters
Parameter | Type | Description |
---|---|---|
index | number | The index of the throttle lever to set, from 1 to 4, inclusive. |
pos | number | The 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.
setThrottleLeverPosRaw()
setThrottleLeverPosRaw(
index
,pos
):number
Defined in: src/sdk/fadec/ThrottleLeverManager.ts:186
Sets the raw position of a throttle lever.
Parameters
Parameter | Type | Description |
---|---|---|
index | number | The index of the throttle lever to set, from 1 to 4, inclusive. |
pos | number | The 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.