I'm trying to make a button visible only when there is an active alarm, and I'm using the
system.alarm.queryStatus method for this. However, I'm having trouble getting the
Visible property to recognize the expression. Is there another way to do this? I just want the button to be visible while there is an active alarm with a specific filter, for example:
if system.alarm.queryStatus(state=['Active'], displayPath="*BESS_1_1_1_1 : *"):
event.source.visible = True
event.source.visible = False
What you're using seems to be a Script, you can test it on the console and with some prints you might be able to see if it's working, if it works on the console, then you might have a problem that the trigger you've set your script to might not be working, for example, if you placed it on a mouseClicked event and there isn't a click happening on the component.
Anyway, try adding a expression binding to the Visible property and use the isAlarmActive() function.
Also, is it vision or perspective?
I was actually trying to do it through a script, but what I meant to ask was if there is a way to achieve the same thing using an expression. Sorry if I didn't explain myself clearly enough earlier.
and yees it's Vision properties that I'm working on.
On the other hand, isAlarmActive is exactly what I was looking for, in fact, the isAlarmActiveFiltered() method is even more useful for me. I really appreciate your response, greetings.