Skip to main content

Class: GNSSPublisher

Defined in: src/sdk/instruments/GNSS.ts:99

A publisher for global positioning and inertial data.

Extends​

Constructors​

Constructor​

new GNSSPublisher(bus, pacer): GNSSPublisher

Defined in: src/sdk/instruments/GNSS.ts:161

Create an GNSSPublisher

Parameters​

ParameterTypeDefault valueDescription
busEventBusundefinedThe EventBus to publish to
pacerPublishPacer<GNSSEvents> | undefinedundefinedAn optional pacer to use to control the rate of publishing

Returns​

GNSSPublisher

Overrides​

BasePublisher.constructor

Properties​

bus​

protected readonly bus: EventBus

Defined in: src/sdk/instruments/BasePublishers.ts:10

Inherited from​

BasePublisher.bus


pacer​

protected readonly pacer: PublishPacer<GNSSEvents> | undefined

Defined in: src/sdk/instruments/BasePublishers.ts:13

Inherited from​

BasePublisher.pacer


publishActive​

protected publishActive: boolean

Defined in: src/sdk/instruments/BasePublishers.ts:12

Inherited from​

BasePublisher.publishActive


publisher​

protected readonly publisher: Publisher<GNSSEvents>

Defined in: src/sdk/instruments/BasePublishers.ts:11

Inherited from​

BasePublisher.publisher

Methods​

isPublishing()​

isPublishing(): boolean

Defined in: src/sdk/instruments/BasePublishers.ts:45

Tells whether or not the publisher is currently active.

Returns​

boolean

True if the publisher is active, false otherwise.

Inherited from​

BasePublisher.isPublishing


onUpdate()​

onUpdate(): void

Defined in: src/sdk/instruments/GNSS.ts:229

A callback called when the publisher receives an update cycle.

Returns​

void

Overrides​

BasePublisher.onUpdate


publish()​

protected publish<K>(topic, data, sync, isCached): void

Defined in: src/sdk/instruments/BasePublishers.ts:63

Publish a message if publishing is acpive

Type Parameters​

Type Parameter
K extends keyof GNSSEvents

Parameters​

ParameterTypeDefault valueDescription
topicKundefinedThe topic key to publish to.
dataGNSSEvents[K]undefinedThe data type for chosen topic.
syncbooleanfalseWhether or not the event should be synced to other instruments. Defaults to false.
isCachedbooleantrueWhether or not the event should be cached. Defaults to true.

Returns​

void

Inherited from​

BasePublisher.publish


startPublish()​

startPublish(): void

Defined in: src/sdk/instruments/GNSS.ts:215

Start publishing.

Returns​

void

Overrides​

BasePublisher.startPublish


stopPublish()​

stopPublish(): void

Defined in: src/sdk/instruments/GNSS.ts:222

Stop publishing.

Returns​

void

Overrides​

BasePublisher.stopPublish


getInstantaneousTrack()​

static getInstantaneousTrack(defaultTrack?, groundSpeedThreshold?): number

Defined in: src/sdk/instruments/GNSS.ts:352

Gets the airplane's instantaneous true ground track, in degrees.

Parameters​

ParameterTypeDefault valueDescription
defaultTrack?numberundefinedThe default value to return if the airplane's ground speed is less than the threshold. If not defined, then the airplane's true heading (obtained from the PLANE HEADING DEGREES TRUE SimVar) will be used as the default value.
groundSpeedThreshold?number0The ground speed, in knots, at or below which the default value is returned instead of the ground track.

Returns​

number

The airplane's instantaneous true ground track, in degrees, or the default value if the airplane's ground speed is less than or equal to the specified threshold.