GLG Toolkit, JavaScript Library  Version 4.6
GlgAlarmHandler Interface Reference

Alarm handler. More...

Detailed Description

Alarm handler.

An alarm handler is used to handle alarms attached to the GLG objects in the drawing and is installed via SetAlarmHandler.

Use CreateGlgAlarmHandler to create an alarm handler.

Public Member Functions

void Alarm (GlgObject data_obj, GlgObject alarm_obj, String alarm_label, String action, String subaction, Object reserved)
 Global alarm handling method. More...
 

Static Public Member Functions

static GlgAlarmHandler CreateGlgAlarmHandler (function alarm_handler_func)
 Constructor. More...
 

Member Function Documentation

◆ Alarm()

void Alarm ( GlgObject  data_obj,
GlgObject  alarm_obj,
String  alarm_label,
String  action,
String  subaction,
Object  reserved 
)

Global alarm handling method.

This application-supplied method is invoked to implement custom alarm processing when an alarm occurs.

Alarms are generated by the Alarm objects attached to objects in the drawing and activated when the controlled values go outside the ranges specified in the Alarm objects.

Parameters
data_objThe data object the alarm is attached to and whose value has changed.
alarm_objThe alarm object attached to the data object to monitor its value. It is the alarm that generated the alarm message.
alarm_labelThe value of the alarm's AlarmLabel attribute used to identify alarm object.
actionThe value of the alarm's AlarmAction attribute, provides details about the condition that caused the alarm.
subactionThe value of the alarm's AlarmSubaction attribute, provides details about the condition that caused the alarm.
reservedThis parameter is reserved for future implementations.

An alarm handler should not change object hierarchy by actions such as adding or deleting objects from the drawing or changing a factor of a series object.

Refer to the Alarm Object section of the GLG User's Guide and Builder Reference Manual for more information.

◆ CreateGlgAlarmHandler()

static GlgAlarmHandler CreateGlgAlarmHandler ( function  alarm_handler_func)
static

Constructor.

Creates an alarm handler that can be used as a parameter of SetAlarmHandler. The static method is invoked on the GLG Toolkit handle obtained via a 'new GlgToolkit()' call at the application start-up.

Parameters
alarm_handler_funcA custom alarm handler function to be invoked when an alarm occurs. The function's type signature must match the the type signature of the Alarm method.
Returns
An opaque internal object representing GlgAlarmHandler.