Skip to main content
Version: 8.1

Vision - Alarm Status Table Scripting Functions

This page details the various component and extension functions available for Vision's Alarm Status Table component.

Component Functions

.print(fitWidth, headerFormat, footerFormat, showDialog, landscape)

  • Description

    • This specialized print function will paginate the table onto multiple pages. This function accepts keyword-style invocation.
  • Keyword Args

    • boolean fitWidth - If true, the table's width will be stretched to fit across one page's width. Rows will still paginate normally. If false, the table will paginate columns onto extra pages. (default = true) [optional]

    • string headerFormat - A string to use as the table's page header. The substring "{0}" will be replaced with the current page number. (default = None) [optional]

    • string footerFormat - A string to use as the table's page footer. The substring "{0}" will be replaced with the current page number. (default = "Page {0}") [optional]

    • boolean showDialog - Whether or not the print dialog should be shown to the user. Default is true. [optional]

    • boolean landscape - Used to specify portrait (0) or landscape (1) mode. Default is portrait (0). [optional]

  • Return

    • Boolean- True if the print job was successful.

.getAlarms()

  • Description

    • Returns a dataset of the alarms currently displayed in the Alarm Status Table component. The columns will be: EventId, Source, DisplayPath, EventTime, State, and Priority.
  • Keyword Args

    • None
  • Return

    • Dataset - A dataset of alarms.

Extension Functions

createPopupMenu

  • Description

    • Returns a popup menu that will be displayed when the user triggers a popup menu (right click) in the table. Use system.gui.PopupMenu to create the popup menu.
  • Parameters

    • Component self- A reference to the component that is invoking this function.

    • List selectedAlarmEvents - The alarm events selected on the Alarm Status Table. For an individual alarm Event, call alarmEvent.get('propertyName') to inspect. Common properties: 'name', 'source', 'priority'.

  • Return

    • Object - the popup menu.

filterAlarm

  • Description

    • Called for each event loaded into the alarm status table. Return false to hide this event from the table. This code is executed in a background thread so it has a minimal impact on client performance.
  • Parameters

    • Component self- A reference to the component that is invoking this function.

    • PyAlarmEvent alarmEvent - The alarm event itself. Call alarmEvent.get('propertyName') to inspect. Common properties: 'name', 'source','priority'.

  • Return

    • Boolean- Returns true or false for every alarm event in the table. True will show the alarm. False will not show the alarm.

filterAlarm Example

The filterAlarm Extension Function can be used to filter results on the table based on Alarm Associated Data, allowing you to devise custom filtering criteria. For example, if you wanted the table to only show alarms that had an associated data property named "Production", you could add the following:

Filtering Example
group = alarmEvent.get("Group")
if group == "Production":
return True
return False # It is important to always include logic where False can be returned for alarm events that don't match your criteria

If the script fails to compile, then the table will show alarms as if a filterAlarm script was not configured.

isAcknowledgeEnabled

  • Description

    • Returns a boolean that represents whether the selected alarm can be acknowledged
  • Parameters

    • Component self- A reference to the component that is invoking this function.

    • List selectedAlarmEvents - The alarm events selected on the Alarm Status Table. For an individual alarmEvent, call alarmEvent.get('propertyName') to inspect. Common properties: 'name','source','priority'.

  • Return

    • Boolean- Returns true or false for every alarm event in the table.

isShelvedEnabled

  • Description

    • Returns a boolean that represents whether the selected alarm can be shelved.
  • Parameters

    • Component self- A reference to the component that is invoking this function.

    • List selectedAlarmEvents - The alarm events selected on the Alarm Status Table. For an individual alarmEvent, call alarmEvent.get('propertyName') to inspect. Common properties: 'name', 'source', 'priority'.

  • Return

    • Boolean- Returns true or false for every alarm event in the table.

onDoubleClicked

  • Description

    • Called when an alarm is double-clicked on to provide custom functionality.
  • Parameters

    • Component self- A reference to the component that is invoking this function.

    • Alarm Event alarmEvent - The alarm event that was double clicked. For an individual alarmEvent, call alarmEvent.get('propertyName') to inspect. Common properties: 'name', 'source', 'priority'.

  • Return

    • None

onAcknowledge

  • Description

    • Called when the Acknowledge button is pressed; the script runs before the ack happens. Return False to abort the acknowledgement, return True to continue as normal.
  • Parameters

    • Component self- A reference to the component that is invoking this function.

    • List alarms - A list of the alarms to be acknowledged.

  • Return

    • Boolean- Returns true or false for every alarm event that is selected.

onShelve

New in 8.1.25
  • Description

    • Called when the Apply button is pressed on the Shelving panel; the script runs before the shelving happens. Return False to abort shelving, return True to continue as normal.
  • Parameters

    • Component self - A reference to the component that is invoking this function.

    • List alarms - A list of the alarms to be shelved.

  • Return

    • Boolean - Returns true or false for every alarm event that is selected.