Perspective Alarm Status Table - Scripting Functions

Hello There:

I am just wondering if there are any exposed scripting functions for Perspective’s Alarm Status Table. We would like to add a “Acknowledge All” button to the view in which our alarm status table resides on - however I am not seeing any scripting functions in the documentation. Hoping someone could point me in the right direction on where I could find these.

Many Thanks

Here’s what I came up with using these manual pages:

def runAction(self, event):
	This event is fired when the 'action' of the component occurs.

		self: A reference to the component that is invoking this function.
		event: An empty event object.
	#Alarm states to be cleared
	state = ["ActiveUnacked", "ClearUnacked"]
	#Create Dataset containing alarms in desired state
	result = system.alarm.queryStatus(state = state).getDataset()
	#Convert to python dataset
	alarmDataset = system.dataset.toPyDataSet(result)
	alarmNames = []
	#Iterate over dataset to get a list of alarm names
	for x in alarmDataset:
    #pass alarm name list, comment, username
	system.alarm.acknowledge(alarmNames, "Batch Ack", "Admin")

This goes in the Event Script on your button.

1 Like

Not currently, no, although those would make great feature requests on :slight_smile:

1 Like