Customize Acknowledge button to ack selected alarms in alarm status table

Hello,

The ack button comes at bottom of the alarm status table and customer wants it to be on side of the table. So I am using a new button and want to configure it for acknowledge.

I saw a post : Acknowledge button for touchscreen

But this acknowledges only one alarm at a time and doesnt work for multiple selection.

Can anyone suggest the script for this button for multiple selection and also the script for binding enabled property of button, as system.alarm.acknowledge will give error when there are no selected alarms.

Thanks

Is this for Vision or Perspective?

For Vision

For one of my touchscreen projects i created a button that acknowledges all alarms that are ActiveUnacked or ClearUnacked, you could probably modify it to filter only selected.

stringlist = []
list = system.alarm.queryStatus(state=[“ActiveUnacked”, “ClearUnacked”])
for id in list:
stringlist.append(str(id.getId()))
system.alarm.acknowledge(stringlist,’’)

Hi All,

I used the code below on the button - action performed script :
results=event.source.parent.getComponent(‘Alarm Status Table’).selectedAlarms
resultsLength = results.getRowCount()
for i in range(0,resultsLength):
uuids=[str(results.getValueAt(i,‘EventId’))]
system.alarm.acknowledge(uuids,“None”)

And the code below on enabled property of the button:
if(len({Root Container.Alarm Status Table.selectedAlarms}) = 0, false, true)

This worked perfectly fine.

1 Like