Skip to main content

Class: G3000RadioUtils

Defined in: src/workingtitle-instruments-g3000/html_ui/Shared/Radio/G3000RadioUtils.ts:7

A utility class for working with G3000 radios.

Constructors

Constructor

new G3000RadioUtils(): G3000RadioUtils

Returns

G3000RadioUtils

Methods

changeRadioFrequency()

static changeRadioFrequency(radio, freqComponent, dir): Promise<void>

Defined in: src/workingtitle-instruments-g3000/html_ui/Shared/Radio/G3000RadioUtils.ts:175

Increments or decrements a radio's frequency.

Parameters

ParameterTypeDescription
radioTunableRadioThe radio to adjust the frequency of.
freqComponent"WHOLE" | "FRACT"Whether to adjust the MHz (WHOLE) or kHz (FRACT) component of the frequency.
dir"INC" | "DEC"Whether to increment or decrement the frequency.

Returns

Promise<void>

A Promise which is fulfilled when the command to change the frequency has been sent.


changeRadioVolume()

static changeRadioVolume(radio, dir): Promise<void>

Defined in: src/workingtitle-instruments-g3000/html_ui/Shared/Radio/G3000RadioUtils.ts:149

Increments or decrements a radio's volume.

Parameters

ParameterTypeDescription
radioRadioThe radio to adjust the volume of.
dir"INC" | "DEC"Whether to increment or decrement the volume.

Returns

Promise<void>

A Promise which is fulfilled when the command to change the volume has been sent.


getRadioType()

static getRadioType<R>(radio): G3000RadioTypeMapReverse[R]

Defined in: src/workingtitle-instruments-g3000/html_ui/Shared/Radio/G3000RadioUtils.ts:14

Gets the type of a radio.

Type Parameters

Type Parameter
R extends Radio

Parameters

ParameterTypeDescription
radioRA radio.

Returns

G3000RadioTypeMapReverse[R]

The type of the specified radio.

Throws

Error if radio is not a valid radio.


getSimRadioType()

static getSimRadioType(radio): RadioType

Defined in: src/workingtitle-instruments-g3000/html_ui/Shared/Radio/G3000RadioUtils.ts:51

Gets the sim radio type of a radio.

Parameters

ParameterTypeDescription
radioRadioA radio.

Returns

RadioType

The sim radio type of the specified radio.

Throws

Error if radio is not a valid radio.


isRadioType()

static isRadioType<Type>(radio, type): radio is G3000RadioTypeMap[Type]

Defined in: src/workingtitle-instruments-g3000/html_ui/Shared/Radio/G3000RadioUtils.ts:41

Checks if a radio is of a certain type.

Type Parameters

Type Parameter
Type extends G3000RadioType

Parameters

ParameterTypeDescription
radioRadioThe radio to check.
typeTypeThe radio type to check.

Returns

radio is G3000RadioTypeMap[Type]

Whether the specified radio is of the specified type.

Throws

Error if radio is not a valid radio.


radioNameFormatter()

static radioNameFormatter(adfCount, dmeCount): (radio) => string

Defined in: src/workingtitle-instruments-g3000/html_ui/Shared/Radio/G3000RadioUtils.ts:77

Creates a function which formats radio names.

Parameters

ParameterTypeDescription
adfCountnumberThe number of ADF radios supported by the airplane.
dmeCountnumberThe number of DME radios supported by the airplane.

Returns

A function which formats radio names.

(radio): string

Parameters
ParameterType
radioRadio
Returns

string


setComRadioReceiveState()

static setComRadioReceiveState(radio, receive): Promise<void>

Defined in: src/workingtitle-instruments-g3000/html_ui/Shared/Radio/G3000RadioUtils.ts:105

Sets the receiving state of a COM radio.

Parameters

ParameterTypeDescription
radioComRadioThe radio to set the receiving state of.
receivebooleanThe receiving state to set.

Returns

Promise<void>

A Promise which is fulfilled when the command to set the receiving state has been sent.


setComRadioTransmitting()

static setComRadioTransmitting(radio): Promise<void>

Defined in: src/workingtitle-instruments-g3000/html_ui/Shared/Radio/G3000RadioUtils.ts:95

Sets the transmitting COM radio.

Parameters

ParameterTypeDescription
radio"COM1" | "COM2"The com radio to set as transmitting.

Returns

Promise<void>

A Promise which is fulfilled when the command to set the transmitting radio has been sent.


setStandbyRadioFrequency()

static setStandbyRadioFrequency(radio, frequencyHz): Promise<void>

Defined in: src/workingtitle-instruments-g3000/html_ui/Shared/Radio/G3000RadioUtils.ts:115

Sets a standby radio frequency.

Parameters

ParameterTypeDescription
radioTunableRadioThe radio for which to set the frequency.
frequencyHznumberThe frequency to set, in hertz.

Returns

Promise<void>

A Promise which is fulfilled when the command to set the frequency has been sent.


swapRadioFrequency()

static swapRadioFrequency(radio): Promise<void>

Defined in: src/workingtitle-instruments-g3000/html_ui/Shared/Radio/G3000RadioUtils.ts:139

Swaps active and standby radio frequencies.

Parameters

ParameterTypeDescription
radioTunableRadioThe radio whose frequencies are to be swapped.

Returns

Promise<void>

A Promise which is fulfilled when the command to swap frequencies has been sent.