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

Detailed Description

Functions

GlgObject CreateAlarmList (void)
 Creates and returns a list of alarms defined in this object. More...
 
GlgObject GetAlarmObject (char *alarm_label, GlgBoolean single_alarm)
 Returns an alarm object with a specified alarm label, or a list of alarms matching the specified alarm label pattern. More...
 

Function Documentation

◆ CreateAlarmList()

GlgObject CreateAlarmList ( void  )

Creates and returns a list of alarms defined in this object.

The top level viewport may be used to query the list of alarms of the whole drawing. This is a wrapper for GlgCreateAlarmList.

Returns
A group containing all alarm objects, or NULL if no alarm objects were found. The returned group is a GlgObject object that must be explicitly dereferenced. If it is assigned to a GlgObjectC instance, use the instance's Drop method to dereference the returned group as shown in the example below.

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

If this object is not a viewport, the returned alarm list will include only the 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;
GlgObjectC alarm_list = viewport.CreateAlarmList();
alarm_list.Drop();
if( !alarm_list.IsNull() )
{
int size = alarm_list.GetSize();
for( int i=0; i<size; ++i )
{
// The data object the alarm is attached to.
GlgObjectC data_object = alarm_list.GetElement( i );
// AlarmLabel may be unnamed, extract it as the XformAttr1 resource of the alarm object.
data_object.GetSResource( "Alarm/XformAttr1", &alarm_label );
printf( "AlarmLabel: %s\n", alarm_label );
}
}
The main class of the GLG C++ bindings.
Definition: GlgClass.h:638
GlgObject CreateAlarmList(void)
Creates and returns a list of alarms defined in this object.
GlgLong GetSize(void)
Returns size of this container object.
GlgObject GetElement(GlgLong index)
Returns the object at the specified position in this container.
GlgBoolean GetSResource(char *resource_name, char **value)
Returns the current value of a S (string) resource of this object.
void Drop(void)
Explicitly dereferences the GLG object contained in this instance.
GlgBoolean IsNull(void)
Checks if a non-null object is stored in this instance.

◆ GetAlarmObject()

GlgObject GetAlarmObject ( char *  alarm_label,
GlgBoolean  single_alarm 
)

Returns an alarm object with a specified alarm label, or a list of alarms matching the specified alarm label pattern.

This is a wrapper for GlgGetAlarmObject.

Parameters
alarm_labelA string or a pattern for the search, supporting wildcards: ? (matches any single character) and * (matches any sequence of characters).
single_alarmDefines a single alarm (True) or multiple alarm (False) mode.
Returns
  • In the single alarm mode, returns an data object that has an attached alarm with the alarm label matching the search criterion.
  • In the multiple alarm mode, returns a group containing all data objects that have attached alarms with matching alarm labels. The returned group is a GlgObject object that must be explicitly dereferenced. If it is assigned to a GlgObjectC instance, use the instance's Drop method to dereference the returned group.

The GetElement and GetSize methods may be used to handle the returned group object.