From: Carlos P. <cpa...@ce...> - 2015-06-30 09:09:37
|
On Tue 30 June 2015 11:39:41 Kalyani Thigale wrote: > Hi, > I am new to PyTango and taurus. I want to create a Qlable which is > accepting values from device proxy in tango. When I use tauruslable, > the values are updated instantly but in case of Qlable values are not > updating. I want Qlable to be behave just like tauruslable. I am sure > there is something wrong from my side. Could you please correct me if > possible. I am attaching my python file GUI screen showing difference > in values, and java device server file please have a look at it. Hi, In your py code you are using PyTango to just set an initial value to the text of a QLabel. If you wanted the value to be refreshed you would need to register some method of your Qlabel as a callback for events in PyTango...and you would need to be careful in the event subscription/unsubscription... and also take care of many more details... ...BUT this is exactly the kind of stuff that taurus does for you. The key message here is : do *not* use a QLabel for doing what Tauruslabel can do (displaying values from Tango). A TaurusLabel is actually a QLabel (it inherits from QLabel), so most of its methods are accessible. If there is some behaviour of TaurusLabel that does not suit your needs, check if it is already configurable (many things such as background, etc are). If not, subclass TaurusLabel and modify that specific behaviour. I hope that helps Cheers, Carlos PS: apart from the above, from your code I suspect that you may be new to python as well (excuse me if that is not the case) so please allow me to suggest that you familiarize with the following (or equivalent) sources before trying to get into more complex developments: - http://www.taurus-scada.org/en/latest/devel/examples.html - https://docs.python.org/2/tutorial/ - http://www.informit.com/store/rapid-gui-programming-with-python-and-qt-the-definitive-9780132354189 -- +----------------------------------------------------+ Carlos Pascual Izarra Scientific Software Coordinator Computing Division ALBA Synchrotron [http://www.albasynchrotron.es] Carretera BP 1413 de Cerdanyola-Sant Cugat, Km. 3.3 E-08290 Cerdanyola del Valles (Barcelona), Spain E-mail: cpa...@ce... Phone: +34 93 592 4428 +----------------------------------------------------+ |