AlarmFilterEditAppendEquipment
- Last UpdatedJul 18, 2023
- 2 minute read
Appends the provided expression that can include equipment names to the current filter session content without validation.
Syntax
INT AlarmFilterEditAppendEquipment(INT hSession, STRING EquipmentFilter, STRING Ref)
hSession:
Session handle for the historical list previously returned by the function AlarmFilterEditOpen.
EquipmentFilter:
A comma-separated list of equipment names to filter alarms prior to applying the other filter specified on the FilterCriteria argument. This field has been extended to support wildcards, and hence accept partial filter strings.
Expression has been extended to allow:
"EQUIPMENT=XYZ" (this may have an asterisk as the last character, this is interpreted as a wildcard)
What this means is:
• "XYZ" becomes "EQUIPMENT=XYZ*"
• "EQUIPMENT=XYZ" stays as "EQUIPMENT=XYZ"
Note: Filters that take the form "XYZ" should no longer be used. It is recommended you use the "EQUIPMENT=XYZ" form, further "XYZ" can now be expressed as "EQUIPMENT=XYZ,EQUIPMENT=XYZ.*" as this will include all items on the "XYZ" equipment and all items on sub-equipment of the "XYZ" equipment.
Ref:
0 - Do not include alarms belonging to referenced equipment in Filter
1 - Include alarms belonging to referenced equipment in Filter
Return Value
0 (zero) if the alarm filter session exists, otherwise an error code is returned.
Example
// This example shows how to update an edit session.
// This example requires that the edit session hEdit exists.
// This example assumes that the ExampleEquipment has references to
// RefEquipment.RefItem1 and RefEquipment.RefItem2.
INT nError;
nError = AlarmFilterEditSet(hEdit, "");
nError = AlarmFilterEditAppendEquipment(hEdit, "EQUIPMENT=ExampleEquipment", 1);
nError = AlarmFilterEditCommit(hEdit);
sRet = AlarmFilterEditFirst(hEdit); // "((Cluster=Cluster1 AND Equipment=ExampleEquipment)
OR (Cluster=Cluster1 AND Equipment=RefEquipment AND
(ITEM=RefItem1 OR ITEM=RefItem2)))"