Skip to main content

Class: Warning

The main logic for a system warning.

Constructors

constructor

new Warning(type, condition, shortText?, longText?, soundId?, once?): Warning

Creates an instance of a Warning.

Parameters

NameTypeDescription
typeWarningTypeThe type of warning this is.
conditionCompositeLogicXMLElementAn XML logic element with the trigger logic.
shortText?stringThe warning message in short form.
longText?stringThe warning message in long form.
soundId?stringThe sound name to use with this warning.
once?booleanTrue if this warning only fires once

Returns

Warning

Defined in

src/sdk/components/Warnings/Warning.ts:40

Properties

condition

Readonly condition: CompositeLogicXMLElement

The XML logic element triggering this warning if true.

Defined in

src/sdk/components/Warnings/Warning.ts:23


longText

Optional Readonly longText: string

The long-form text.

Defined in

src/sdk/components/Warnings/Warning.ts:19


once

Optional Readonly once: boolean

Does this only fire once?

Defined in

src/sdk/components/Warnings/Warning.ts:25


shortText

Optional Readonly shortText: string

The short-form text.

Defined in

src/sdk/components/Warnings/Warning.ts:17


soundId

Optional Readonly soundId: string

The name of a sound to play along with the visual warning.

Defined in

src/sdk/components/Warnings/Warning.ts:21


type

Readonly type: WarningType

The category of the warnining.

Defined in

src/sdk/components/Warnings/Warning.ts:15

Accessors

canTrigger

get canTrigger(): boolean

Can this alert fire?

Returns

boolean

True if the current configuration allows the alert to fire.

Defined in

src/sdk/components/Warnings/Warning.ts:88


description

get description(): string

A text description for the warning, for debugging purposes.

Returns

string

A string

Defined in

src/sdk/components/Warnings/Warning.ts:72


eventId

get eventId(): undefined | Name_Z

The event ID Coherent returns when this sound has been played.

Returns

undefined | Name_Z

A Name_Z based on the sound ID.

Defined in

src/sdk/components/Warnings/Warning.ts:96


hasText

get hasText(): boolean

Whether or not we have any text at all.

Returns

boolean

True if any non-empty text strings are set.

Defined in

src/sdk/components/Warnings/Warning.ts:57


triggered

get triggered(): boolean

Whether or not the warning has been triggered in this session.

Returns

boolean

True if the warning has been triggered.

Defined in

src/sdk/components/Warnings/Warning.ts:80

Methods

trigger

trigger(): void

The alert is being fired, take action.

Returns

void

Defined in

src/sdk/components/Warnings/Warning.ts:64