Skip to main content

Class: RegisteredSimVarUtils

Defined in: src/sdk/data/SimVars.ts:489

A utility class for working with registered SimVars.

Constructors

Constructor

new RegisteredSimVarUtils(): RegisteredSimVarUtils

Returns

RegisteredSimVarUtils

Methods

create()

static create<T, U>(name, unit, dataSource): T extends undefined ? U extends string ? RegisteredSimVar<SimVarUnitToType<U<U>>> : never : RegisteredSimVar<NoInfer<T>>

Defined in: src/sdk/data/SimVars.ts:497

Creates a new registered SimVar instance.

Type Parameters

Type ParameterDefault type
Tundefined
U extends stringstring

Parameters

ParameterTypeDefault valueDescription
namestringundefinedThe name of the SimVar.
unitUundefinedThe unit type of the SimVar.
dataSourcestring''The data source to link to the SimVar instance. Defaults to the empty string.

Returns

T extends undefined ? U extends string ? RegisteredSimVar<SimVarUnitToType<U<U>>> : never : RegisteredSimVar<NoInfer<T>>

A new registered SimVar instance.


createBoolean()

static createBoolean(name, dataSource): RegisteredSimVar<boolean>

Defined in: src/sdk/data/SimVars.ts:528

Creates a new boolean-valued registered SimVar instance. The unit type of the SimVar will be set to SimVarValueType.Bool. When getting the SimVar value, zero will be interpreted as false, and any other value will be interpreted as true. When setting the SimVar value, true will be converted to 1 and false will be converted to 0.

Parameters

ParameterTypeDefault valueDescription
namestringundefinedThe name of the SimVar.
dataSourcestring''The data source to link to the SimVar instance. Defaults to the empty string.

Returns

RegisteredSimVar<boolean>

A new boolean-valued registered SimVar instance.