Skip to main content

Abstract Class: AbstractTerrainSystem<ID>

Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:15

An abstract implementation of TerrainSystem. This class handles adding, initializing, updating, and destroying modules. It also handles publishing topics to the event bus in responses to changes in state. Finally, it handles listening to and responding to control events published to the event bus.

Extended by​

Type Parameters​

Type Parameter
ID extends string

Implements​

Constructors​

Constructor​

new AbstractTerrainSystem<ID>(id, type, bus, dataProvider, prioritizedAlertSelector): AbstractTerrainSystem<ID>

Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:58

Creates a new instance of AbstractTerrainSystem.

Parameters​

ParameterTypeDescription
idIDThis terrain system's ID.
typestringThis terrain system's type.
busEventBusThe event bus.
dataProviderTerrainSystemDataProviderA provider of terrain system data.
prioritizedAlertSelector(alerts) => string | nullA function that this system uses to select a prioritized alert from an iterable of active alerts each time the set of active alerts changes.

Returns​

AbstractTerrainSystem<ID>

Properties​

activeAlerts​

protected readonly activeAlerts: SetSubject<string>

Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:32


alertController​

protected readonly alertController: TerrainSystemAlertController

Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:37


bus​

protected readonly bus: EventBus

Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:61

The event bus.


dataProvider​

protected readonly dataProvider: TerrainSystemDataProvider

Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:62

A provider of terrain system data.


id​

readonly id: ID

Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:59

This terrain system's ID.

Implementation of​

TerrainSystem.id


idSuffix​

protected readonly idSuffix: TerrainSystemEventSuffix<ID>

Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:17


inhibitedAlerts​

protected readonly inhibitedAlerts: SetSubject<string>

Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:31


inhibits​

protected readonly inhibits: SetSubject<string>

Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:28


isAlive​

protected isAlive: boolean = true

Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:44


isInit​

protected isInit: boolean = false

Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:45


modules​

protected readonly modules: TerrainSystemModule[] = []

Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:35


operatingMode​

protected readonly operatingMode: Subject<TerrainSystemOperatingMode>

Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:25


prioritizedAlert​

protected readonly prioritizedAlert: Subject<string | null>

Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:33


prioritizedAlertSelector()​

protected readonly prioritizedAlertSelector: (alerts) => string | null

Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:63

A function that this system uses to select a prioritized alert from an iterable of active alerts each time the set of active alerts changes.

Parameters​

ParameterType
alertsIterable<string>

Returns​

string | null


publisher​

protected readonly publisher: Publisher<TerrainSystemEvents>

Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:23


statuses​

protected readonly statuses: SetSubject<string>

Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:27


subscriptions​

protected readonly subscriptions: Subscription[] = []

Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:47


topicMap​

protected readonly topicMap: object

Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:19

terrainsys_active_alerts​

terrainsys_active_alerts: `terrainsys_active_alerts${TerrainSystemEventSuffix<ID>}`

The terrain system's active alerts.

terrainsys_alert_activated​

terrainsys_alert_activated: `terrainsys_alert_activated${TerrainSystemEventSuffix<ID>}`

An alert was activated by the terrain system.

terrainsys_alert_deactivated​

terrainsys_alert_deactivated: `terrainsys_alert_deactivated${TerrainSystemEventSuffix<ID>}`

An alert was deactivated by the terrain system.

terrainsys_alert_inhibited​

terrainsys_alert_inhibited: `terrainsys_alert_inhibited${TerrainSystemEventSuffix<ID>}`

An alert was inhibited by the terrain system.

terrainsys_alert_triggered​

terrainsys_alert_triggered: `terrainsys_alert_triggered${TerrainSystemEventSuffix<ID>}`

An alert was triggered by the terrain system.

terrainsys_alert_uninhibited​

terrainsys_alert_uninhibited: `terrainsys_alert_uninhibited${TerrainSystemEventSuffix<ID>}`

An alert was uninhibited by the terrain system.

terrainsys_alert_untriggered​

terrainsys_alert_untriggered: `terrainsys_alert_untriggered${TerrainSystemEventSuffix<ID>}`

An alert was untriggered by the terrain system.

terrainsys_inhibit_added​

terrainsys_inhibit_added: `terrainsys_inhibit_added${TerrainSystemEventSuffix<ID>}`

An inhibit flag was added to the terrain system.

terrainsys_inhibit_flags​

terrainsys_inhibit_flags: `terrainsys_inhibit_flags${TerrainSystemEventSuffix<ID>}`

The terrain system's active inhibit flags.

terrainsys_inhibit_removed​

terrainsys_inhibit_removed: `terrainsys_inhibit_removed${TerrainSystemEventSuffix<ID>}`

An inhibit flag was removed from the terrain system.

terrainsys_inhibited_alerts​

terrainsys_inhibited_alerts: `terrainsys_inhibited_alerts${TerrainSystemEventSuffix<ID>}`

The terrain system's inhibited alerts.

terrainsys_operating_mode​

terrainsys_operating_mode: `terrainsys_operating_mode${TerrainSystemEventSuffix<ID>}`

The current terrain system operating mode.

terrainsys_prioritized_alert​

terrainsys_prioritized_alert: `terrainsys_prioritized_alert${TerrainSystemEventSuffix<ID>}`

The terrain system's current prioritized active alert.

terrainsys_status_added​

terrainsys_status_added: `terrainsys_status_added${TerrainSystemEventSuffix<ID>}`

A status flag was added to the terrain system.

terrainsys_status_flags​

terrainsys_status_flags: `terrainsys_status_flags${TerrainSystemEventSuffix<ID>}`

The terrain system's active status flags.

terrainsys_status_removed​

terrainsys_status_removed: `terrainsys_status_removed${TerrainSystemEventSuffix<ID>}`

A status flag was removed from the terrain system.

terrainsys_triggered_alerts​

terrainsys_triggered_alerts: `terrainsys_triggered_alerts${TerrainSystemEventSuffix<ID>}`

The terrain system's triggered alerts.

terrainsys_type​

terrainsys_type: `terrainsys_type${TerrainSystemEventSuffix<ID>}`

The terrain system type.


triggeredAlerts​

protected readonly triggeredAlerts: SetSubject<string>

Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:30


type​

readonly type: string

Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:60

This terrain system's type.

Implementation of​

TerrainSystem.type

Methods​

addInhibit()​

addInhibit(inhibit): void

Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:252

Adds an inhibit flag to this system.

Parameters​

ParameterTypeDescription
inhibitstringThe flag to add.

Returns​

void

Implementation of​

TerrainSystem.addInhibit


addModule()​

addModule(module): void

Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:98

Adds a module to this system.

Parameters​

ParameterTypeDescription
moduleTerrainSystemModuleThe module to add.

Returns​

void

Implementation of​

TerrainSystem.addModule


destroy()​

destroy(): void

Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:519

Destroys this system. Once destroyed, this system can no longer be updated.

Returns​

void

Implementation of​

TerrainSystem.destroy


inhibitAlert()​

protected inhibitAlert(alert): void

Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:471

Inhibits an alert.

Parameters​

ParameterTypeDescription
alertstringThe alert to inhibit.

Returns​

void


init()​

init(): void

Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:110

Initializes this system. Once the system is initialized, it can begin updating its internal state and issuing alerts and will publish its state to the event bus.

Returns​

void

Implementation of​

TerrainSystem.init


initAlertPublishing()​

protected initAlertPublishing(): void

Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:176

Initializes publishing of this system's active alerts to the event bus.

Returns​

void


initControlEventListeners()​

protected initControlEventListeners(): void

Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:190

Initializes listeners for control events published to the event bus.

Returns​

void


initInhibitPublishing()​

protected initInhibitPublishing(): void

Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:161

Initializes publishing of this system's inhibit flags to the event bus.

Returns​

void


initModules()​

protected initModules(): void

Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:206

Initializes this system's modules.

Returns​

void


initOperatingModePublishing()​

protected initOperatingModePublishing(): void

Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:139

Initializes publishing of this system's operating mode to the event bus.

Returns​

void


initStatusPublishing()​

protected initStatusPublishing(): void

Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:146

Initializes publishing of this system's status flags to the event bus.

Returns​

void


onActiveAlertsChanged()​

protected onActiveAlertsChanged(alerts, type, alert): void

Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:349

Responds to when the set of this system's active alerts changes.

Parameters​

ParameterTypeDescription
alertsReadonlySet<string>The set of active alerts.
typeSubscribableSetEventTypeThe type of change that occurred.
alertstringThe alert that was changed.

Returns​

void


onAddInhibit()​

protected onAddInhibit(inhibit): void

Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:430

A method that is called when this system receives a command to add an inhibit flag.

Parameters​

ParameterTypeDescription
inhibitstringThe flag to add.

Returns​

void


onInhibitedAlertsChanged()​

protected onInhibitedAlertsChanged(alerts, type, alert): void

Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:329

Responds to when the set of this system's inhibited alerts changes.

Parameters​

ParameterTypeDescription
alertsReadonlySet<string>The set of inhibited alerts.
typeSubscribableSetEventTypeThe type of change that occurred.
alertstringThe alert that was changed.

Returns​

void


onInit()​

protected onInit(): void

Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:127

A method that is called when this system is initialized.

Returns​

void


onOperatingModeChanged()​

protected onOperatingModeChanged(mode): void

Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:294

Responds to when this system's operating mode changes.

Parameters​

ParameterTypeDescription
modeTerrainSystemOperatingModeThe new operating mode.

Returns​

void


onRemoveAllInhibits()​

protected onRemoveAllInhibits(): void

Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:445

A method that is called when this system receives a command to remove all inhibit flags.

Returns​

void


onRemoveInhibit()​

protected onRemoveInhibit(inhibit): void

Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:438

A method that is called when this system receives a command to remove an inhibit flag.

Parameters​

ParameterTypeDescription
inhibitstringThe flag to remove.

Returns​

void


onStartTest()​

protected onStartTest(): void

Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:422

A method that is called when this system receives a command to start a self-test.

Returns​

void


onTriggeredAlertsChanged()​

protected onTriggeredAlertsChanged(alerts, type, alert): void

Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:309

Responds to when the set of this system's triggered alerts changes.

Parameters​

ParameterTypeDescription
alertsReadonlySet<string>The set of triggered alerts.
typeSubscribableSetEventTypeThe type of change that occurred.
alertstringThe alert that was changed.

Returns​

void


onTurnOff()​

protected onTurnOff(): void

Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:415

A method that is called when this system receives a command to turn off.

Returns​

void


onTurnOn()​

protected onTurnOn(): void

Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:408

A method that is called when this system receives a command to turn on.

Returns​

void


onUpdate()​

protected onUpdate(): void

Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:499

A method that is called when this system is updated.

Returns​

void


publishActiveAlert()​

protected publishActiveAlert(alerts, type, alert): void

Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:395

Publishes data to event bus alert topics based on a change to this system's active alerts.

Parameters​

ParameterTypeDescription
alertsReadonlySet<string>The set of active alerts.
typeSubscribableSetEventTypeThe type of change that occurred.
alertstringThe alert that was changed.

Returns​

void


publishInhibitedAlert()​

protected publishInhibitedAlert(alerts, type, alert): void

Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:379

Publishes data to event bus alert topics based on a change to this system's active alerts.

Parameters​

ParameterTypeDescription
alertsReadonlySet<string>The set of active alerts.
typeSubscribableSetEventTypeThe type of change that occurred.
alertstringThe alert that was changed.

Returns​

void


publishTriggeredAlert()​

protected publishTriggeredAlert(alerts, type, alert): void

Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:363

Publishes data to event bus alert topics based on a change to this system's active alerts.

Parameters​

ParameterTypeDescription
alertsReadonlySet<string>The set of active alerts.
typeSubscribableSetEventTypeThe type of change that occurred.
alertstringThe alert that was changed.

Returns​

void


removeAllInhibits()​

removeAllInhibits(): void

Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:278

Removes all inhibit flags from this system.

Returns​

void

Implementation of​

TerrainSystem.removeAllInhibits


removeInhibit()​

removeInhibit(inhibit): void

Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:265

Removes an inhibit flag from this system.

Parameters​

ParameterTypeDescription
inhibitstringThe flag to remove.

Returns​

void

Implementation of​

TerrainSystem.removeInhibit


startTest()​

startTest(): void

Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:239

Begins a self-test of this system.

Returns​

void

Implementation of​

TerrainSystem.startTest


triggerAlert()​

protected triggerAlert(alert): void

Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:453

Triggers an alert.

Parameters​

ParameterTypeDescription
alertstringThe alert to trigger.

Returns​

void


turnOff()​

turnOff(): void

Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:226

Turns this system off.

Returns​

void

Implementation of​

TerrainSystem.turnOff


turnOn()​

turnOn(): void

Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:213

Turns this system on.

Returns​

void

Implementation of​

TerrainSystem.turnOn


uninhibitAlert()​

protected uninhibitAlert(alert): void

Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:479

Uninhibits an alert.

Parameters​

ParameterTypeDescription
alertstringThe alert to uninhibit.

Returns​

void


untriggerAlert()​

protected untriggerAlert(alert): void

Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:463

Untriggers an alert.

Parameters​

ParameterTypeDescription
alertstringThe alert to untrigger.

Returns​

void


update()​

update(): void

Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:484

Updates this system.

Returns​

void

Implementation of​

TerrainSystem.update


updateModules()​

protected updateModules(): void

Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:506

Updates this system's modules.

Returns​

void