[bugs:#800] DevShort attributes present wrong behaviour with the event changes
Status: open
Labels: change events
Created: Wed Jun 15, 2016 09:39 AM UTC by Carlos Falcon
Last Updated: Wed Jun 15, 2016 09:39 AM UTC
Owner: nobody
If you configure the TangoTest 'ushort_scalar' attribute to react to change events:
It can be configure with absolute or relative changes (to 1) with polling period to 3 s.
You receive the change events + some periodic events (at the same frecuency of the polling period).
Name = sys/tg_test/1 ; event type = change ; has_value = True ; time = 2016-06-15 08:20:49 Name = sys/tg_test/1 ; event type = change ; has_value = True ; time = 2016-06-15 08:20:50 Name = sys/tg_test/1 ; event type = change ; has_value = True ; time = 2016-06-15 08:20:59 Name = sys/tg_test/1 ; event type = change ; has_value = True ; time = 2016-06-15 08:21:02 Name = sys/tg_test/1 ; event type = change ; has_value = True ; time = 2016-06-15 08:21:05 Name = sys/tg_test/1 ; event type = change ; has_value = True ; time = 2016-06-15 08:21:08 Name = sys/tg_test/1 ; event type = change ; has_value = True ; time = 2016-06-15 08:21:11
Name = sys/tg_test/1 ; event type = change ; has_value = True ; time = 2016-06-15 08:55:21 Name = sys/tg_test/1 ; event type = change ; has_value = True ; time = 2016-06-15 08:55:23 Name = sys/tg_test/1 ; event type = change ; has_value = True ; time = 2016-06-15 08:55:26 Name = sys/tg_test/1 ; event type = change ; has_value = True ; time = 2016-06-15 08:55:29 Name = sys/tg_test/1 ; event type = change ; has_value = True ; time = 2016-06-15 08:55:32
You can reproduce the error with this code:
import PyTango from time import gmtime, strftime, sleep import sys device = 'sys/tg_test/1' attr = 'ushort_scalar' def cb(*args, **kargs): e_data = args[0] attr_value = getattr(e_data, 'attr_value') print 'Name = ', d.name(), '; event type =',e_data.event, '; has_value =', hasattr(attr_value, 'value'), '; time = ', strftime("%Y-%m-%d %H:%M:%S", gmtime()) d = PyTango.DeviceProxy(device) id = d.subscribe_event(attr, PyTango.EventType.CHANGE_EVENT, cb) d.write_attribute(attr, 3) d.write_attribute(attr, 5)
Sent from sourceforge.net because Tango-cs...@lists.sf.net is subscribed to https://sourceforge.net/p/tango-cs/bugs/
To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/tango-cs/admin/bugs/options. Or, if this is a mailing list, you can unsubscribe from the mailing list.
I tried with a cpp client and it also happens. But this doesn't seem to be a bug: the attribute value is really changing.
Attachments:
[bugs:#800] DevShort attributes present wrong behaviour with the event changes
Status: open
Labels: change events
Created: Wed Jun 15, 2016 09:39 AM UTC by Carlos Falcon
Last Updated: Thu Jun 16, 2016 09:17 AM UTC
Owner: nobody