Skip to main content

Class: AbstractTerrainSystem<ID>

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.

Type parameters

NameType
IDextends string

Hierarchy

Implements

Constructors

constructor

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

Creates a new instance of AbstractTerrainSystem.

Type parameters

NameType
IDextends string

Parameters

NameTypeDescription
idIDThis terrain system's ID.
typestringThis terrain system's type.
busEventBusThe event bus.
dataProviderTerrainSystemDataProviderA provider of terrain system data.
prioritizedAlertSelector(alerts: Iterable<string>) => 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>

Defined in

src/garminsdk/terrain/AbstractTerrainSystem.ts:55

Properties

alertController

Protected Readonly alertController: TerrainSystemAlertController

Defined in

src/garminsdk/terrain/AbstractTerrainSystem.ts:35


alerts

Protected Readonly alerts: SetSubject<string>

Defined in

src/garminsdk/terrain/AbstractTerrainSystem.ts:30


bus

Protected Readonly bus: EventBus

The event bus.

Defined in

src/garminsdk/terrain/AbstractTerrainSystem.ts:58


dataProvider

Protected Readonly dataProvider: TerrainSystemDataProvider

A provider of terrain system data.

Defined in

src/garminsdk/terrain/AbstractTerrainSystem.ts:59


id

Readonly id: ID

This terrain system's ID.

Implementation of

TerrainSystem.id

Defined in

src/garminsdk/terrain/AbstractTerrainSystem.ts:56


idSuffix

Protected Readonly idSuffix: TerrainSystemEventSuffix<ID>

Defined in

src/garminsdk/terrain/AbstractTerrainSystem.ts:17


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


isInit

Protected isInit: boolean = false

Defined in

src/garminsdk/terrain/AbstractTerrainSystem.ts:42


modules

Protected Readonly modules: TerrainSystemModule[] = []

Defined in

src/garminsdk/terrain/AbstractTerrainSystem.ts:33


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


prioritizedAlertSelector

Protected Readonly prioritizedAlertSelector: (alerts: Iterable<string>) => null | string

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.

Type declaration

▸ (alerts): null | string

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
NameType
alertsIterable<string>
Returns

null | string

Defined in

src/garminsdk/terrain/AbstractTerrainSystem.ts:60


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


topicMap

Protected Readonly topicMap: Object

Type declaration

NameTypeDescription
terrainsys_active_alerts`terrainsys_active_alerts${TerrainSystemEventSuffix<ID>}`The terrain system's active alerts.
terrainsys_alert_activated`terrainsys_alert_activated${TerrainSystemEventSuffix<ID>}`An alert was activated by the terrain system.
terrainsys_alert_deactivated`terrainsys_alert_deactivated${TerrainSystemEventSuffix<ID>}`An alert was deactivated by the terrain system.
terrainsys_inhibit_added`terrainsys_inhibit_added${TerrainSystemEventSuffix<ID>}`An inhibit flag was added to the terrain system.
terrainsys_inhibit_flags`terrainsys_inhibit_flags${TerrainSystemEventSuffix<ID>}`The terrain system's active inhibit flags.
terrainsys_inhibit_removed`terrainsys_inhibit_removed${TerrainSystemEventSuffix<ID>}`An inhibit flag was removed from the terrain system.
terrainsys_operating_mode`terrainsys_operating_mode${TerrainSystemEventSuffix<ID>}`The current terrain system operating mode.
terrainsys_prioritized_alert`terrainsys_prioritized_alert${TerrainSystemEventSuffix<ID>}`The terrain system's current prioritized active alert.
terrainsys_status_added`terrainsys_status_added${TerrainSystemEventSuffix<ID>}`A status flag was added to the terrain system.
terrainsys_status_flags`terrainsys_status_flags${TerrainSystemEventSuffix<ID>}`The terrain system's active status flags.
terrainsys_status_removed`terrainsys_status_removed${TerrainSystemEventSuffix<ID>}`A status flag was removed from the terrain system.
terrainsys_type`terrainsys_type${TerrainSystemEventSuffix<ID>}`The terrain system type.

Defined in

src/garminsdk/terrain/AbstractTerrainSystem.ts:19


type

Readonly type: string

This terrain system's type.

Implementation of

TerrainSystem.type

Defined in

src/garminsdk/terrain/AbstractTerrainSystem.ts:57

Methods

activateAlert

activateAlert(alert): void

Activates an alert.

Parameters

NameTypeDescription
alertstringThe alert to activate.

Returns

void

Defined in

src/garminsdk/terrain/AbstractTerrainSystem.ts:370


addInhibit

addInhibit(inhibit): void

Adds an inhibit flag to this system.

Parameters

NameTypeDescription
inhibitstringThe flag to add.

Returns

void

Implementation of

TerrainSystem.addInhibit

Defined in

src/garminsdk/terrain/AbstractTerrainSystem.ts:241


addModule

addModule(module): void

Adds a module to this system.

Parameters

NameTypeDescription
moduleTerrainSystemModuleThe module to add.

Returns

void

Implementation of

TerrainSystem.addModule

Defined in

src/garminsdk/terrain/AbstractTerrainSystem.ts:87


deactivateAlert

deactivateAlert(alert): void

Deactivates an alert.

Parameters

NameTypeDescription
alertstringThe alert to deactivate.

Returns

void

Defined in

src/garminsdk/terrain/AbstractTerrainSystem.ts:380


destroy

destroy(): void

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

Returns

void

Implementation of

TerrainSystem.destroy

Defined in

src/garminsdk/terrain/AbstractTerrainSystem.ts:420


init

init(): void

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

Defined in

src/garminsdk/terrain/AbstractTerrainSystem.ts:99


initAlertPublishing

initAlertPublishing(): void

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

Returns

void

Defined in

src/garminsdk/terrain/AbstractTerrainSystem.ts:165


initControlEventListeners

initControlEventListeners(): void

Initializes listeners for control events published to the event bus.

Returns

void

Defined in

src/garminsdk/terrain/AbstractTerrainSystem.ts:179


initInhibitPublishing

initInhibitPublishing(): void

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

Returns

void

Defined in

src/garminsdk/terrain/AbstractTerrainSystem.ts:150


initModules

initModules(): void

Initializes this system's modules.

Returns

void

Defined in

src/garminsdk/terrain/AbstractTerrainSystem.ts:195


initOperatingModePublishing

initOperatingModePublishing(): void

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

Returns

void

Defined in

src/garminsdk/terrain/AbstractTerrainSystem.ts:128


initStatusPublishing

initStatusPublishing(): void

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

Returns

void

Defined in

src/garminsdk/terrain/AbstractTerrainSystem.ts:135


onAddInhibit

onAddInhibit(inhibit): void

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

Parameters

NameTypeDescription
inhibitstringThe flag to add.

Returns

void

Defined in

src/garminsdk/terrain/AbstractTerrainSystem.ts:347


onAlertsChanged

onAlertsChanged(alerts, type, alert): void

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

Parameters

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

Returns

void

Defined in

src/garminsdk/terrain/AbstractTerrainSystem.ts:298


onInit

onInit(): void

A method that is called when this system is initialized.

Returns

void

Defined in

src/garminsdk/terrain/AbstractTerrainSystem.ts:116


onOperatingModeChanged

onOperatingModeChanged(mode): void

Responds to when this system's operating mode changes.

Parameters

NameTypeDescription
modeTerrainSystemOperatingModeThe new operating mode.

Returns

void

Defined in

src/garminsdk/terrain/AbstractTerrainSystem.ts:283


onRemoveAllInhibits

onRemoveAllInhibits(): void

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

Returns

void

Defined in

src/garminsdk/terrain/AbstractTerrainSystem.ts:362


onRemoveInhibit

onRemoveInhibit(inhibit): void

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

Parameters

NameTypeDescription
inhibitstringThe flag to remove.

Returns

void

Defined in

src/garminsdk/terrain/AbstractTerrainSystem.ts:355


onStartTest

onStartTest(): void

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

Returns

void

Defined in

src/garminsdk/terrain/AbstractTerrainSystem.ts:339


onTurnOff

onTurnOff(): void

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

Returns

void

Defined in

src/garminsdk/terrain/AbstractTerrainSystem.ts:332


onTurnOn

onTurnOn(): void

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

Returns

void

Defined in

src/garminsdk/terrain/AbstractTerrainSystem.ts:325


onUpdate

onUpdate(): void

A method that is called when this system is updated.

Returns

void

Defined in

src/garminsdk/terrain/AbstractTerrainSystem.ts:400


publishAlert

publishAlert(alerts, type, alert): void

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

Parameters

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

Returns

void

Defined in

src/garminsdk/terrain/AbstractTerrainSystem.ts:312


removeAllInhibits

removeAllInhibits(): void

Removes all inhibit flags from this system.

Returns

void

Implementation of

TerrainSystem.removeAllInhibits

Defined in

src/garminsdk/terrain/AbstractTerrainSystem.ts:267


removeInhibit

removeInhibit(inhibit): void

Removes an inhibit flag from this system.

Parameters

NameTypeDescription
inhibitstringThe flag to remove.

Returns

void

Implementation of

TerrainSystem.removeInhibit

Defined in

src/garminsdk/terrain/AbstractTerrainSystem.ts:254


startTest

startTest(): void

Begins a self-test of this system.

Returns

void

Implementation of

TerrainSystem.startTest

Defined in

src/garminsdk/terrain/AbstractTerrainSystem.ts:228


turnOff

turnOff(): void

Turns this system off.

Returns

void

Implementation of

TerrainSystem.turnOff

Defined in

src/garminsdk/terrain/AbstractTerrainSystem.ts:215


turnOn

turnOn(): void

Turns this system on.

Returns

void

Implementation of

TerrainSystem.turnOn

Defined in

src/garminsdk/terrain/AbstractTerrainSystem.ts:202


update

update(): void

Updates this system.

Returns

void

Implementation of

TerrainSystem.update

Defined in

src/garminsdk/terrain/AbstractTerrainSystem.ts:385


updateModules

updateModules(): void

Updates this system's modules.

Returns

void

Defined in

src/garminsdk/terrain/AbstractTerrainSystem.ts:407