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
| Parameter | Type | Description |
|---|---|---|
id | ID | This terrain system's ID. |
type | string | This terrain system's type. |
bus | EventBus | The event bus. |
dataProvider | TerrainSystemDataProvider | A provider of terrain system data. |
prioritizedAlertSelector | (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. |
Returns
AbstractTerrainSystem<ID>
Properties
activeAlerts
protectedreadonlyactiveAlerts:SetSubject<string>
Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:32
alertController
protectedreadonlyalertController:TerrainSystemAlertController
Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:37
bus
protectedreadonlybus:EventBus
Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:61
The event bus.
dataProvider
protectedreadonlydataProvider:TerrainSystemDataProvider
Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:62
A provider of terrain system data.
id
readonlyid:ID
Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:59
This terrain system's ID.
Implementation of
idSuffix
protectedreadonlyidSuffix:TerrainSystemEventSuffix<ID>
Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:17
inhibitedAlerts
protectedreadonlyinhibitedAlerts:SetSubject<string>
Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:31
inhibits
protectedreadonlyinhibits:SetSubject<string>
Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:28
isAlive
protectedisAlive:boolean=true
Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:44
isInit
protectedisInit:boolean=false
Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:45
modules
protectedreadonlymodules:TerrainSystemModule[] =[]
Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:35
operatingMode
protectedreadonlyoperatingMode:Subject<TerrainSystemOperatingMode>
Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:25
prioritizedAlert
protectedreadonlyprioritizedAlert:Subject<null|string>
Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:33
prioritizedAlertSelector()
protectedreadonlyprioritizedAlertSelector: (alerts) =>null|string
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
| Parameter | Type |
|---|---|
alerts | Iterable<string> |
Returns
null | string
publisher
protectedreadonlypublisher:Publisher<TerrainSystemEvents>
Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:23
statuses
protectedreadonlystatuses:SetSubject<string>
Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:27
subscriptions
protectedreadonlysubscriptions:Subscription[] =[]
Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:47
topicMap
protectedreadonlytopicMap: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
protectedreadonlytriggeredAlerts:SetSubject<string>
Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:30
type
readonlytype:string
Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:60
This terrain system's type.
Implementation of
Methods
addInhibit()
addInhibit(
inhibit):void
Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:252
Adds an inhibit flag to this system.
Parameters
| Parameter | Type | Description |
|---|---|---|
inhibit | string | The flag to add. |
Returns
void
Implementation of
addModule()
addModule(
module):void
Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:98
Adds a module to this system.
Parameters
| Parameter | Type | Description |
|---|---|---|
module | TerrainSystemModule | The module to add. |
Returns
void
Implementation of
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
inhibitAlert()
protectedinhibitAlert(alert):void
Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:471
Inhibits an alert.
Parameters
| Parameter | Type | Description |
|---|---|---|
alert | string | The 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
initAlertPublishing()
protectedinitAlertPublishing():void
Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:176
Initializes publishing of this system's active alerts to the event bus.
Returns
void
initControlEventListeners()
protectedinitControlEventListeners():void
Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:190
Initializes listeners for control events published to the event bus.
Returns
void
initInhibitPublishing()
protectedinitInhibitPublishing():void
Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:161
Initializes publishing of this system's inhibit flags to the event bus.
Returns
void
initModules()
protectedinitModules():void
Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:206
Initializes this system's modules.
Returns
void
initOperatingModePublishing()
protectedinitOperatingModePublishing():void
Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:139
Initializes publishing of this system's operating mode to the event bus.
Returns
void
initStatusPublishing()
protectedinitStatusPublishing():void
Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:146
Initializes publishing of this system's status flags to the event bus.
Returns
void
onActiveAlertsChanged()
protectedonActiveAlertsChanged(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
| Parameter | Type | Description |
|---|---|---|
alerts | ReadonlySet<string> | The set of active alerts. |
type | SubscribableSetEventType | The type of change that occurred. |
alert | string | The alert that was changed. |
Returns
void
onAddInhibit()
protectedonAddInhibit(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
| Parameter | Type | Description |
|---|---|---|
inhibit | string | The flag to add. |
Returns
void
onInhibitedAlertsChanged()
protectedonInhibitedAlertsChanged(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
| Parameter | Type | Description |
|---|---|---|
alerts | ReadonlySet<string> | The set of inhibited alerts. |
type | SubscribableSetEventType | The type of change that occurred. |
alert | string | The alert that was changed. |
Returns
void
onInit()
protectedonInit():void
Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:127
A method that is called when this system is initialized.
Returns
void
onOperatingModeChanged()
protectedonOperatingModeChanged(mode):void
Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:294
Responds to when this system's operating mode changes.
Parameters
| Parameter | Type | Description |
|---|---|---|
mode | TerrainSystemOperatingMode | The new operating mode. |
Returns
void
onRemoveAllInhibits()
protectedonRemoveAllInhibits():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()
protectedonRemoveInhibit(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
| Parameter | Type | Description |
|---|---|---|
inhibit | string | The flag to remove. |
Returns
void
onStartTest()
protectedonStartTest():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()
protectedonTriggeredAlertsChanged(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
| Parameter | Type | Description |
|---|---|---|
alerts | ReadonlySet<string> | The set of triggered alerts. |
type | SubscribableSetEventType | The type of change that occurred. |
alert | string | The alert that was changed. |
Returns
void
onTurnOff()
protectedonTurnOff():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()
protectedonTurnOn():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()
protectedonUpdate():void
Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:499
A method that is called when this system is updated.
Returns
void
publishActiveAlert()
protectedpublishActiveAlert(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
| Parameter | Type | Description |
|---|---|---|
alerts | ReadonlySet<string> | The set of active alerts. |
type | SubscribableSetEventType | The type of change that occurred. |
alert | string | The alert that was changed. |
Returns
void
publishInhibitedAlert()
protectedpublishInhibitedAlert(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
| Parameter | Type | Description |
|---|---|---|
alerts | ReadonlySet<string> | The set of active alerts. |
type | SubscribableSetEventType | The type of change that occurred. |
alert | string | The alert that was changed. |
Returns
void
publishTriggeredAlert()
protectedpublishTriggeredAlert(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
| Parameter | Type | Description |
|---|---|---|
alerts | ReadonlySet<string> | The set of active alerts. |
type | SubscribableSetEventType | The type of change that occurred. |
alert | string | The 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
| Parameter | Type | Description |
|---|---|---|
inhibit | string | The flag to remove. |
Returns
void
Implementation of
startTest()
startTest():
void
Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:239
Begins a self-test of this system.
Returns
void
Implementation of
triggerAlert()
protectedtriggerAlert(alert):void
Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:453
Triggers an alert.
Parameters
| Parameter | Type | Description |
|---|---|---|
alert | string | The alert to trigger. |
Returns
void
turnOff()
turnOff():
void
Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:226
Turns this system off.
Returns
void
Implementation of
turnOn()
turnOn():
void
Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:213
Turns this system on.
Returns
void
Implementation of
uninhibitAlert()
protecteduninhibitAlert(alert):void
Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:479
Uninhibits an alert.
Parameters
| Parameter | Type | Description |
|---|---|---|
alert | string | The alert to uninhibit. |
Returns
void
untriggerAlert()
protecteduntriggerAlert(alert):void
Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:463
Untriggers an alert.
Parameters
| Parameter | Type | Description |
|---|---|---|
alert | string | The alert to untrigger. |
Returns
void
update()
update():
void
Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:484
Updates this system.
Returns
void
Implementation of
updateModules()
protectedupdateModules():void
Defined in: src/garminsdk/terrain/AbstractTerrainSystem.ts:506
Updates this system's modules.
Returns
void