Skip to main content

Class: RadioFrequencyFormatter

Defined in: src/sdk/graphics/text/RadioFrequencyFormatter.ts:6

A utility class for creating radio frequency formatters.

Constructors​

Constructor​

new RadioFrequencyFormatter(): RadioFrequencyFormatter

Returns​

RadioFrequencyFormatter

Methods​

createAdf()​

static createAdf(nanString): (freqHz) => string

Defined in: src/sdk/graphics/text/RadioFrequencyFormatter.ts:45

Creates a function which formats ADF radio frequencies in hertz. The formatted string created by the function displays the frequency in kilohertz to one decimal place.

Parameters​

ParameterTypeDefault valueDescription
nanStringstring'NaN'The string to output for an input of NaN. Defaults to 'NaN'.

Returns​

A function which formats ADF radio frequencies in hertz.

(freqHz): string

Parameters​
ParameterType
freqHznumber
Returns​

string


createCom()​

static createCom(spacing, nanString): (freqHz) => string

Defined in: src/sdk/graphics/text/RadioFrequencyFormatter.ts:27

Creates a function which formats COM radio frequencies in hertz. The formatted string created by the function displays the frequency in megahertz to either two decimal places (with the third decimal place truncated) for 25 kHz spacing, or three decimal places for 8.33 kHz spacing.

Parameters​

ParameterTypeDefault valueDescription
spacingComSpacingundefinedThe COM channel spacing mode to use.
nanStringstring'NaN'The string to output for an input of NaN. Defaults to 'NaN'.

Returns​

A function which formats COM radio frequencies in hertz.

(freqHz): string

Parameters​
ParameterType
freqHznumber
Returns​

string


createNav()​

static createNav(nanString): (freqHz) => string

Defined in: src/sdk/graphics/text/RadioFrequencyFormatter.ts:13

Creates a function which formats NAV radio frequencies in hertz. The formatted string created by the function displays the frequency in megahertz to two decimal places.

Parameters​

ParameterTypeDefault valueDescription
nanStringstring'NaN'The string to output for an input of NaN. Defaults to 'NaN'.

Returns​

A function which formats NAV radio frequencies in hertz.

(freqHz): string

Parameters​
ParameterType
freqHznumber
Returns​

string