I know there are several and simple ways of doing this, but I’m working on a template and my bindings are indirect. Depending of memory tags that are high and low alarm values. I want the background to blink. I have made my scripting;property change to be indirect and my background does change but is static to red but I want it to blink for example 1s.
Of course I can solve this with a timer and make some binds with custom property and use an “if” statement but I want to make it like an animation. Exactly like Style Customer does.
The code that turns background to red is:
if value <= lowAlarm: event.source.background = system.gui.color(255,0,0) elif value >= highAlarm: event.source.background = system.gui.color(255,0,0)
The code I was trying but cause the client to crash.
import time def animated(): event.source.background = system.gui.color(255,0,0)#red time.sleep(1) event.source.background = system.gui.color(255,255,255)#white time.sleep(1) if value <= lowAlarm: animated() elif value >= highAlarm: animated()
I know there should be a break statement somewhere but I can’t make it work
Please some help.