Skip to main content

Class: G3XNearestContext

Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/Nearest/G3XNearestContext.ts:17

A G3X Touch nearest facilities context. Maintains search subscriptions for the nearest airports, VORs, NDBs, intersections, and user waypoints to the airplane's position.

Properties​

airports​

readonly airports: NearestSubscription<AirportFacility>

Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/Nearest/G3XNearestContext.ts:26

The nearest airports.


intersections​

readonly intersections: NearestSubscription<IntersectionFacility>

Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/Nearest/G3XNearestContext.ts:32

The nearest intersections.


ndbs​

readonly ndbs: NearestSubscription<NdbFacility>

Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/Nearest/G3XNearestContext.ts:35

The nearest NDB stations.


updateEvent​

readonly updateEvent: ReadonlySubEvent<G3XNearestContext, void>

Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/Nearest/G3XNearestContext.ts:42

A subscribable event which fires when this context is updated.


usrs​

readonly usrs: NearestSubscription<UserFacility>

Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/Nearest/G3XNearestContext.ts:38

The nearest USR facilities.


vors​

readonly vors: NearestSubscription<VorFacility>

Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/Nearest/G3XNearestContext.ts:29

The nearest VOR stations.

Methods​

getNearest()​

getNearest<T>(facilityType): FacilityTypeMap[T] | undefined

Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/Nearest/G3XNearestContext.ts:198

Gets the nearest facility for a given type.

Type Parameters​

Type Parameter
T extends FacilityType

Parameters​

ParameterTypeDescription
facilityTypeTThe type of facility.

Returns​

FacilityTypeMap[T] | undefined

The nearest facility for a given type.


getRegionLetter()​

getRegionLetter(): string | undefined

Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/Nearest/G3XNearestContext.ts:189

Gets the airport region letter to use for the first character in waypoint inputs.

Returns​

string | undefined

The airport region letter.


update()​

update(): Promise<void>

Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/Nearest/G3XNearestContext.ts:205

Updates this context.

Returns​

Promise<void>


getInstance()​

static getInstance(): Promise<G3XNearestContext>

Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/Nearest/G3XNearestContext.ts:219

Gets the G3XNearestContext instance on the local instrument.

Returns​

Promise<G3XNearestContext>

A Promise which will be fulfilled with the G3XNearestContext instance on the local instrument once it is initialized.


initializeInstance()​

static initializeInstance(facilityLoader, bus, fmsPosIndex): G3XNearestContext

Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/Nearest/G3XNearestContext.ts:231

Initializes and returns the G3XNearestContext instance on the local instrument. If the instance is already initialized, this method returns the instance without performing any other actions.

Parameters​

ParameterTypeDescription
facilityLoaderFacilityLoaderA facility loader.
busEventBusThe event bus.
fmsPosIndexnumber | Subscribable<number>The index of the FMS geo-positioning system used by the context to get the airplane's position.

Returns​

G3XNearestContext

The initialized G3XNearestContext instance on the local instrument.