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
Parameter | Type | Description |
---|---|---|
radio | TunableRadio | The 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
Parameter | Type | Description |
---|---|---|
radio | Radio | The 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
Parameter | Type | Description |
---|---|---|
radio | R | A radio. |
Returns
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
Parameter | Type | Description |
---|---|---|
radio | Radio | A 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
Parameter | Type | Description |
---|---|---|
radio | Radio | The radio to check. |
type | Type | The 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
Parameter | Type | Description |
---|---|---|
adfCount | number | The number of ADF radios supported by the airplane. |
dmeCount | number | The number of DME radios supported by the airplane. |
Returns
A function which formats radio names.
(
radio
):string
Parameters
Parameter | Type |
---|---|
radio | Radio |
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
Parameter | Type | Description |
---|---|---|
radio | ComRadio | The radio to set the receiving state of. |
receive | boolean | The 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
Parameter | Type | Description |
---|---|---|
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
Parameter | Type | Description |
---|---|---|
radio | TunableRadio | The radio for which to set the frequency. |
frequencyHz | number | The 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
Parameter | Type | Description |
---|---|---|
radio | TunableRadio | The radio whose frequencies are to be swapped. |
Returns
Promise
<void
>
A Promise which is fulfilled when the command to swap frequencies has been sent.