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:60

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) => null | stringA 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:63

The event bus.


dataProvider

protected readonly dataProvider: TerrainSystemDataProvider

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

A provider of terrain system data.


id

readonly id: ID

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

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:46


isInit

protected isInit: boolean = false

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


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<null | string>

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


prioritizedAlertSelector()

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

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

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

null | string


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:49


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:62

This terrain system's type.

Implementation of

TerrainSystem.type

Methods

addInhibit()

addInhibit(inhibit): void

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

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:100

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:521

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:473

Inhibits an alert.

Parameters

ParameterTypeDescription
alertstringThe alert to inhibit.

Returns

void


init()

init(): void

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

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:178

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:192

Initializes listeners for control events published to the event bus.

Returns

void


initInhibitPublishing()

protected initInhibitPublishing(): void

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

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:208

Initializes this system's modules.

Returns

void


initOperatingModePublishing()

protected initOperatingModePublishing(): void

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

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:148

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:351

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:432

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:331

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:129

A method that is called when this system is initialized.

Returns

void


onOperatingModeChanged()

protected onOperatingModeChanged(mode): void

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

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:447

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:440

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:424

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:311

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:417

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:410

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:501

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:397

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:381

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:365

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:280

Removes all inhibit flags from this system.

Returns

void

Implementation of

TerrainSystem.removeAllInhibits


removeInhibit()

removeInhibit(inhibit): void

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

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:241

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:455

Triggers an alert.

Parameters

ParameterTypeDescription
alertstringThe alert to trigger.

Returns

void


turnOff()

turnOff(): void

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

Turns this system off.

Returns

void

Implementation of

TerrainSystem.turnOff


turnOn()

turnOn(): void

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

Turns this system on.

Returns

void

Implementation of

TerrainSystem.turnOn


uninhibitAlert()

protected uninhibitAlert(alert): void

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

Uninhibits an alert.

Parameters

ParameterTypeDescription
alertstringThe alert to uninhibit.

Returns

void


untriggerAlert()

protected untriggerAlert(alert): void

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

Untriggers an alert.

Parameters

ParameterTypeDescription
alertstringThe alert to untrigger.

Returns

void


update()

update(): void

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

Updates this system.

Returns

void

Implementation of

TerrainSystem.update


updateModules()

protected updateModules(): void

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

Updates this system's modules.

Returns

void