Hi,
I am trying to implement a logic when current alarm count is greater than previous alarm count audio should play.
I have written change script on a numeric input field value for testing purpose and manually updating the numeric field and in both condition either the alarm count is greater or lesser than previous count audio is playing.
def valueChanged(self, previousValue, currentValue, origin, missedEvents):
system.perspective.print(("Previous Value :", previousValue))
system.perspective.print(("current Value :", currentValue))
if currentValue > previousValue :
self.getSibling("Audio").props.play = True
else:
self.getSibling("Audio").props.play = False
system.perspective.print("--------------------------------------------------------")
and in console I am getting below output. (change the value from 7 to 10 in numeric field)
('Previous Value :', [7, Good, Wed Oct 11 15:46:01 IST 2023 (1697019361552)])
('current Value :', [10, Good_Unspecified, Wed Oct 11 15:46:06 IST 2023 (1697019366321)])
('Previous Value :', [10, Good_Unspecified, Wed Oct 11 15:46:06 IST 2023 (1697019366321)])
('current Value :', [10, Good, Wed Oct 11 15:46:06 IST 2023 (1697019366328)])
I don't understand why 2 times print statement executing and why audio is playing in both condition.
Any suggestions, thanks