LibAlarmFilterForm
- Last UpdatedJul 18, 2023
- 2 minute read
Note: This function is only available if the Lib_Controls project is included in the user project.
Displays a generic alarm filter pop-up for specifying filtering criteria for either an alarm list or a named filter. This function uses the AlarmFilterEdit family of Cicode functions to set the filter.
Note: If the user passes in the Animation number of an alarm list as its FitlerSrc argument, the filter set by this function will override the filter set by function AlarmSetInfo() as both functions modify the internal filter associated with the alarm list.
Syntax
INT LibAlarmFilterForm([INT FormType [, STRING FilterSrc [, STRING Title [, INT Mode [, STRING AppliedCallbackFn]]]]])
FormType
Type of alarm filter form:
-1 – (Default) auto detect if the FilterSrc is set to a valid alarm list AN
0 – active alarm
1 – alarm summary
2 – disabled alarms
3 – sequence of events (SOE)
sFilterSrc
The source where the filter will be applied to. It can either be the Animation Number (AN) of an alarm list or the name of a filter created via the AlarmFilterOpen() Cicode function. If it is not specified, it is defaulted to -1 which refers to all alarm lists on the current page. If the FilterSrc cannot be opened, it will prompt the user to create the filter source.
sTitle
The title for the filter form. If it is not specified or left blank, the title is determined by the form type:
0 – Active Alarm Filter
1 – Summary Alarm Filter
2 – Disabled Alarm Filter
3 – SOE Filter
Any other value – (<FilterSrc> - Alarm Filter)
nMode
The mode of the form:
0 – (Default) Displays form in synchronous mode. The function waits for the user to close the form before returning. Under this mode, the "Apply" button is not shown on the form.
1 – Display form in asynchronous mode. The function does not wait for the user to close the form and returns immediately. Under this mode, the "Apply" button is shown on the form. Using this button, the user can apply filter to the alarm list(s) multiple times without closing the form.
sAppliedCallbackFn
The callback function statement to be called when the criteria (rules) specified in the form is applied either via the OK or Apply buttons. Like other callback functions available to other library controls genie. The callback function supports keyword substitutions during callback:
#Filter - The FilterSrc specified when showing the form
#Result – The result of the filter application. See return value for details.
Return Value
1 if filter has been applied, 0 if filter has been cleared, or -1 if no change is made.
Related Functions
Note: The Alarm Filter Help is available when using the Legacy Alarm Filter Form at Runtime.