Skip to main content

Class: G3XNavSimVarPublisher

Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/Navigation/G3XNavEvents.ts:47

A publisher for G3X Touch navigation SimVar events.

Extends​

Constructors​

Constructor​

new G3XNavSimVarPublisher(bus, pacer?): G3XNavSimVarPublisher

Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/Navigation/G3XNavEvents.ts:58

Creates a new instance of G3XNavSimVarPublisher.

Parameters​

ParameterTypeDescription
busEventBusThe event bus to which to publish.
pacer?PublishPacer<G3XNavEvents>An optional pacer to control the rate of publishing.

Returns​

G3XNavSimVarPublisher

Overrides​

SimVarPublisher.constructor

Properties​

bus​

protected readonly bus: EventBus

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

Inherited from​

SimVarPublisher.bus


indexedSimVars​

protected readonly indexedSimVars: Map<"g3x_active_nav_source" | "g3x_active_navigator_index", IndexedSimVarPublisherEntry<any>>

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

Inherited from​

SimVarPublisher.indexedSimVars


pacer​

protected readonly pacer: PublishPacer<G3XNavEvents> | undefined

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

Inherited from​

SimVarPublisher.pacer


publishActive​

protected publishActive: boolean

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

Inherited from​

SimVarPublisher.publishActive


publisher​

protected readonly publisher: Publisher<G3XNavEvents>

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

Inherited from​

SimVarPublisher.publisher


resolvedSimVars​

protected readonly resolvedSimVars: Map<"g3x_active_nav_source" | "g3x_active_navigator_index", ResolvedSimVarPublisherEntry<any>>

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

Inherited from​

SimVarPublisher.resolvedSimVars


subscribed​

protected readonly subscribed: Map<"g3x_active_nav_source" | "g3x_active_navigator_index", ResolvedSimVarPublisherEntry<any>>

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

Inherited from​

SimVarPublisher.subscribed


INDEXED_REGEX​

protected readonly static INDEXED_REGEX: RegExp

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

Inherited from​

SimVarPublisher.INDEXED_REGEX

Methods​

getValue()​

protected getValue<K>(topic): G3XNavEvents[K] | undefined

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

Gets the current value for a topic.

Type Parameters​

Type Parameter
K extends "g3x_active_nav_source" | "g3x_active_navigator_index"

Parameters​

ParameterTypeDescription
topicKA topic.

Returns​

G3XNavEvents[K] | undefined

The current value for the specified topic.

Inherited from​

SimVarPublisher.getValue


getValueFromEntry()​

protected getValueFromEntry<T>(entry): T

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

Gets the current value for a resolved topic entry.

Type Parameters​

Type Parameter
T

Parameters​

ParameterTypeDescription
entryResolvedSimVarPublisherEntry<T>An entry for a resolved topic.

Returns​

T

The current value for the specified entry.

Inherited from​

SimVarPublisher.getValueFromEntry


handleSubscribedTopic()​

protected handleSubscribedTopic(topic): void

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

Handles when an event bus topic is subscribed to for the first time.

Parameters​

ParameterTypeDescription
topicstringThe subscribed topic.

Returns​

void

Inherited from​

SimVarPublisher.handleSubscribedTopic


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​

SimVarPublisher.isPublishing


onTopicSubscribed()​

protected onTopicSubscribed(topic): void

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

Responds to when one of this publisher's topics is subscribed to for the first time.

Parameters​

ParameterTypeDescription
topic"g3x_active_nav_source" | "g3x_active_navigator_index"The topic that was subscribed to.

Returns​

void

Inherited from​

SimVarPublisher.onTopicSubscribed


onUpdate()​

onUpdate(): void

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

Publish all subscribed data points to the bus.

Returns​

void

Inherited from​

SimVarPublisher.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 G3XNavEvents

Parameters​

ParameterTypeDefault valueDescription
topicKundefinedThe topic key to publish to.
dataG3XNavEvents[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​

SimVarPublisher.publish


publishTopic()​

protected publishTopic(topic, entry): void

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

Publishes data to the event bus for a topic.

Parameters​

ParameterTypeDescription
topic"g3x_active_nav_source" | "g3x_active_navigator_index"The topic to publish.
entryResolvedSimVarPublisherEntry<any> | undefinedThe entry corresponding to the topic

Returns​

void

Inherited from​

SimVarPublisher.publishTopic


resolveIndexedSimVar()​

protected resolveIndexedSimVar(topic, entry, index): string | undefined

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

Attempts to resolve an indexed topic with an index, generating a version of the topic which is mapped to an indexed simvar. The resolved indexed topic can then be published.

Parameters​

ParameterTypeDescription
topic"g3x_active_nav_source" | "g3x_active_navigator_index"The topic to resolve.
entryIndexedSimVarPublisherEntry<any>The entry of the topic to resolve.
indexnumberThe index with which to resolve the topic. If not defined, the topic will resolve to itself (without a suffix) and will be mapped the index-1 version of its simvar.

Returns​

string | undefined

The resolved indexed topic, or undefined if the topic could not be resolved with the specified index.

Inherited from​

SimVarPublisher.resolveIndexedSimVar


startPublish()​

startPublish(): void

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

Start publishing.

Returns​

void

Inherited from​

SimVarPublisher.startPublish


stopPublish()​

stopPublish(): void

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

Stop publishing.

Returns​

void

Inherited from​

SimVarPublisher.stopPublish


tryMatchIndexedSubscribedTopic()​

protected tryMatchIndexedSubscribedTopic(topic): void

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

Checks if a subscribed topic matches one of this publisher's indexed topics, and if so resolves and starts publishing the indexed topic.

Parameters​

ParameterTypeDescription
topicstringThe subscribed topic to check.

Returns​

void

Inherited from​

SimVarPublisher.tryMatchIndexedSubscribedTopic