GLG Toolkit, C / C++ API Library  Version 4.6

Detailed Description

Functions

GlgObject GlgCreateAlarmList (GlgObject object)
 Creates and returns a list of alarms defined in the drawing. More...
 
GlgAlarmHandler GlgSetAlarmHandler (GlgAlarmHandler handler)
 Installs a global alarm handler function that will be invoked to process alarms. More...
 

Function Documentation

◆ GlgCreateAlarmList()

GlgObject GlgCreateAlarmList ( GlgObject  object)

Creates and returns a list of alarms defined in the drawing.

Parameters
objectAn object whose alarms are queried. The top level viewport may be used to query a list of alarms of the whole drawing.
Returns
A group containing all alarm objects, or NULL if no alarm objects were found. The returned group object must be dereferenced using GlgDropObject when it is no longer needed.

Each element of the returned group is an data object that has an alarm attached. The GlgGetElement and GlgGetSize functions of the Intermediate API may be used within the Standard API to handle the returned group object.

If object is not a viewport, the returned alarm list will include only alarms contained inside the object. For a viewport, the alarm list will contain all alarms defined in the viewport's drawing.

Example

The following code prints information about all alarms defined in the drawing:

char * alarm_label;
GlgObject alarm_list = GlgCreateAlarmList( viewport );
if( alarm_list )
{
int size = GlgGetSize( alarm_list );
for( int i=0; i<size; ++i )
{
// The data object the alarm is attached to.
GlgObject data_object = GlgGetElement( alarm_list, i );
// AlarmLabel may be unnamed, extract it as the XformAttr1 resource of the alarm object.
GlgGetSResource( data_object, "Alarm/XformAttr1", &alarm_label );
printf( "AlarmLabel: %s\n", alarm_label );
}
GlgGropObject( alarm_list );
}
GlgObject GlgCreateAlarmList(GlgObject object)
Creates and returns a list of alarms defined in the drawing.
struct GlgObjectData * GlgObject
Opaque GlgObject type that represents all GLG objects in the GLG C API.
Definition: GlgApi.h:3465
GlgObject GlgGetElement(GlgObject container, GlgLong index)
Returns the object at the specified position in a container.
GlgLong GlgGetSize(GlgObject container)
Returns size of a container object.
GlgBoolean GlgGetSResource(GlgObject object, char *resource_name, char **value)
Returns the current value of a S (string) resource.

◆ GlgSetAlarmHandler()

GlgAlarmHandler GlgSetAlarmHandler ( GlgAlarmHandler  handler)

Installs a global alarm handler function that will be invoked to process alarms.

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

Parameters
handlerSpecifies a function that will be invoked to process alarm messages generated by the application's drawings.
Returns
The previously installed alarm handler function, or NULL.

See GlgAlarmHandler for more information.