Skip to main content

Class: ControlSurfacesPublisher

A publisher for control surfaces information.

Hierarchy

Constructors

constructor

new ControlSurfacesPublisher(bus, gearCount, pacer?): ControlSurfacesPublisher

Create an ControlSurfacesPublisher.

Parameters

NameTypeDescription
busEventBusThe EventBus to publish to.
gearCountnumberThe number of landing gear to support.
pacer?PublishPacer<ControlSurfacesEvents>An optional pacer to use to control the rate of publishing.

Returns

ControlSurfacesPublisher

Overrides

SimVarPublisher.constructor

Defined in

src/sdk/instruments/ControlSurfaces.ts:127

Properties

bus

Protected Readonly bus: EventBus

Inherited from

SimVarPublisher.bus

Defined in

src/sdk/instruments/BasePublishers.ts:10


indexedSimVars

Protected Readonly indexedSimVars: Map<"gear_position" | "gear_is_on_ground" | "flaps_handle_index" | "flaps_left_angle" | "flaps_right_angle" | "flaps_left_percent" | "flaps_right_percent" | "slats_left_angle" | "slats_right_angle" | "slats_left_percent" | "slats_right_percent" | "spoilers_left_percent" | "spoilers_right_percent" | "spoilers_without_spoilerons_left_percent" | "elevator_trim_angle" | "elevator_trim_pct" | "elevator_trim_neutral_pct" | "aileron_trim_angle" | "aileron_trim_pct" | "rudder_trim_angle" | "rudder_trim_pct" | "aileron_left_percent" | "aileron_right_percent" | "elevator_percent" | "elevator_position" | "rudder_percent" | "gear_handle_position" | `gear_position_${number}` | `gear_is_on_ground_${number}`, IndexedSimVarPublisherEntry<any>>

Inherited from

SimVarPublisher.indexedSimVars

Defined in

src/sdk/instruments/BasePublishers.ts:149


pacer

Protected Readonly pacer: undefined | PublishPacer<ControlSurfacesEvents>

Inherited from

SimVarPublisher.pacer

Defined in

src/sdk/instruments/BasePublishers.ts:13


publishActive

Protected publishActive: boolean

Inherited from

SimVarPublisher.publishActive

Defined in

src/sdk/instruments/BasePublishers.ts:12


publisher

Protected Readonly publisher: Publisher<ControlSurfacesEvents>

Inherited from

SimVarPublisher.publisher

Defined in

src/sdk/instruments/BasePublishers.ts:11


resolvedSimVars

Protected Readonly resolvedSimVars: Map<"gear_position" | "gear_is_on_ground" | "flaps_handle_index" | "flaps_left_angle" | "flaps_right_angle" | "flaps_left_percent" | "flaps_right_percent" | "slats_left_angle" | "slats_right_angle" | "slats_left_percent" | "slats_right_percent" | "spoilers_left_percent" | "spoilers_right_percent" | "spoilers_without_spoilerons_left_percent" | "elevator_trim_angle" | "elevator_trim_pct" | "elevator_trim_neutral_pct" | "aileron_trim_angle" | "aileron_trim_pct" | "rudder_trim_angle" | "rudder_trim_pct" | "aileron_left_percent" | "aileron_right_percent" | "elevator_percent" | "elevator_position" | "rudder_percent" | "gear_handle_position" | `gear_position_${number}` | `gear_is_on_ground_${number}`, ResolvedSimVarPublisherEntry<any>>

Inherited from

SimVarPublisher.resolvedSimVars

Defined in

src/sdk/instruments/BasePublishers.ts:147


subscribed

Protected Readonly subscribed: Set<"gear_position" | "gear_is_on_ground" | "flaps_handle_index" | "flaps_left_angle" | "flaps_right_angle" | "flaps_left_percent" | "flaps_right_percent" | "slats_left_angle" | "slats_right_angle" | "slats_left_percent" | "slats_right_percent" | "spoilers_left_percent" | "spoilers_right_percent" | "spoilers_without_spoilerons_left_percent" | "elevator_trim_angle" | "elevator_trim_pct" | "elevator_trim_neutral_pct" | "aileron_trim_angle" | "aileron_trim_pct" | "rudder_trim_angle" | "rudder_trim_pct" | "aileron_left_percent" | "aileron_right_percent" | "elevator_percent" | "elevator_position" | "rudder_percent" | "gear_handle_position" | `gear_position_${number}` | `gear_is_on_ground_${number}`>

Inherited from

SimVarPublisher.subscribed

Defined in

src/sdk/instruments/BasePublishers.ts:151


INDEXED_REGEX

Static Protected Readonly INDEXED_REGEX: RegExp

Inherited from

SimVarPublisher.INDEXED_REGEX

Defined in

src/sdk/instruments/BasePublishers.ts:145

Methods

getValue

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

Gets the current value for a topic.

Type parameters

NameType
Kextends "gear_position" | "gear_is_on_ground" | "flaps_handle_index" | "flaps_left_angle" | "flaps_right_angle" | "flaps_left_percent" | "flaps_right_percent" | "slats_left_angle" | "slats_right_angle" | "slats_left_percent" | "slats_right_percent" | "spoilers_left_percent" | "spoilers_right_percent" | "spoilers_without_spoilerons_left_percent" | "elevator_trim_angle" | "elevator_trim_pct" | "elevator_trim_neutral_pct" | "aileron_trim_angle" | "aileron_trim_pct" | "rudder_trim_angle" | "rudder_trim_pct" | "aileron_left_percent" | "aileron_right_percent" | "elevator_percent" | "elevator_position" | "rudder_percent" | "gear_handle_position" | `gear_position_${number}` | `gear_is_on_ground_${number}`

Parameters

NameTypeDescription
topicKA topic.

Returns

undefined | ControlSurfacesEvents[K]

The current value for the specified topic.

Inherited from

SimVarPublisher.getValue

Defined in

src/sdk/instruments/BasePublishers.ts:343


getValueFromEntry

getValueFromEntry<T>(entry): T

Gets the current value for a resolved topic entry.

Type parameters

Name
T

Parameters

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

Returns

T

The current value for the specified entry.

Inherited from

SimVarPublisher.getValueFromEntry

Defined in

src/sdk/instruments/BasePublishers.ts:357


handleSubscribedTopic

handleSubscribedTopic(topic): void

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

Parameters

NameTypeDescription
topicstringThe subscribed topic.

Returns

void

Inherited from

SimVarPublisher.handleSubscribedTopic

Defined in

src/sdk/instruments/BasePublishers.ts:193


isPublishing

isPublishing(): boolean

Tells whether or not the publisher is currently active.

Returns

boolean

True if the publisher is active, false otherwise.

Inherited from

SimVarPublisher.isPublishing

Defined in

src/sdk/instruments/BasePublishers.ts:45


onTopicSubscribed

onTopicSubscribed(topic): void

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

Parameters

NameTypeDescription
topic"gear_position" | "gear_is_on_ground" | "flaps_handle_index" | "flaps_left_angle" | "flaps_right_angle" | "flaps_left_percent" | "flaps_right_percent" | "slats_left_angle" | "slats_right_angle" | "slats_left_percent" | "slats_right_percent" | "spoilers_left_percent" | "spoilers_right_percent" | "spoilers_without_spoilerons_left_percent" | "elevator_trim_angle" | "elevator_trim_pct" | "elevator_trim_neutral_pct" | "aileron_trim_angle" | "aileron_trim_pct" | "rudder_trim_angle" | "rudder_trim_pct" | "aileron_left_percent" | "aileron_right_percent" | "elevator_percent" | "elevator_position" | "rudder_percent" | "gear_handle_position" | `gear_position_${number}` | `gear_is_on_ground_${number}`The topic that was subscribed to.

Returns

void

Inherited from

SimVarPublisher.onTopicSubscribed

Defined in

src/sdk/instruments/BasePublishers.ts:279


onUpdate

onUpdate(): void

Publish all subscribed data points to the bus.

Returns

void

Inherited from

SimVarPublisher.onUpdate

Defined in

src/sdk/instruments/BasePublishers.ts:315


publish

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

Publish a message if publishing is acpive

Type parameters

NameType
Kextends keyof ControlSurfacesEvents

Parameters

NameTypeDefault valueDescription
topicKundefinedThe topic key to publish to.
dataControlSurfacesEvents[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

Defined in

src/sdk/instruments/BasePublishers.ts:63


publishTopic

publishTopic(topic): void

Publishes data to the event bus for a topic.

Parameters

NameTypeDescription
topic"gear_position" | "gear_is_on_ground" | "flaps_handle_index" | "flaps_left_angle" | "flaps_right_angle" | "flaps_left_percent" | "flaps_right_percent" | "slats_left_angle" | "slats_right_angle" | "slats_left_percent" | "slats_right_percent" | "spoilers_left_percent" | "spoilers_right_percent" | "spoilers_without_spoilerons_left_percent" | "elevator_trim_angle" | "elevator_trim_pct" | "elevator_trim_neutral_pct" | "aileron_trim_angle" | "aileron_trim_pct" | "rudder_trim_angle" | "rudder_trim_pct" | "aileron_left_percent" | "aileron_right_percent" | "elevator_percent" | "elevator_position" | "rudder_percent" | "gear_handle_position" | `gear_position_${number}` | `gear_is_on_ground_${number}`The topic to publish.

Returns

void

Inherited from

SimVarPublisher.publishTopic

Defined in

src/sdk/instruments/BasePublishers.ts:325


resolveIndexedSimVar

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

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

NameTypeDescription
topic"gear_position" | "gear_is_on_ground" | "flaps_handle_index" | "flaps_left_angle" | "flaps_right_angle" | "flaps_left_percent" | "flaps_right_percent" | "slats_left_angle" | "slats_right_angle" | "slats_left_percent" | "slats_right_percent" | "spoilers_left_percent" | "spoilers_right_percent" | "spoilers_without_spoilerons_left_percent" | "elevator_trim_angle" | "elevator_trim_pct" | "elevator_trim_neutral_pct" | "aileron_trim_angle" | "aileron_trim_pct" | "rudder_trim_angle" | "rudder_trim_pct" | "aileron_left_percent" | "aileron_right_percent" | "elevator_percent" | "elevator_position" | "rudder_percent" | "gear_handle_position" | `gear_position_${number}` | `gear_is_on_ground_${number}`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

undefined | string

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

Inherited from

SimVarPublisher.resolveIndexedSimVar

Defined in

src/sdk/instruments/BasePublishers.ts:250


startPublish

startPublish(): void

Start publishing.

Returns

void

Inherited from

SimVarPublisher.startPublish

Defined in

src/sdk/instruments/BasePublishers.ts:30


stopPublish

stopPublish(): void

Stop publishing.

Returns

void

Inherited from

SimVarPublisher.stopPublish

Defined in

src/sdk/instruments/BasePublishers.ts:37


subscribe

subscribe(data): void

NOOP - For backwards compatibility.

Parameters

NameTypeDescription
datakeyof ControlSurfacesEventsKey of the event type in the simVarMap

Returns

void

Deprecated

Inherited from

SimVarPublisher.subscribe

Defined in

src/sdk/instruments/BasePublishers.ts:298


tryMatchIndexedSubscribedTopic

tryMatchIndexedSubscribedTopic(topic): void

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

Parameters

NameTypeDescription
topicstringThe subscribed topic to check.

Returns

void

Inherited from

SimVarPublisher.tryMatchIndexedSubscribedTopic

Defined in

src/sdk/instruments/BasePublishers.ts:208


unsubscribe

unsubscribe(data): void

NOOP - For backwards compatibility.

Parameters

NameTypeDescription
datakeyof ControlSurfacesEventsKey of the event type in the simVarMap

Returns

void

Deprecated

Inherited from

SimVarPublisher.unsubscribe

Defined in

src/sdk/instruments/BasePublishers.ts:308