Add tangoState property to tango device objects
Update: this is not necessary, as @cmft pointed out in https://github.com/taurus-org/taurus/pull/672#issuecomment-360078346
Add TangoDevice.tangoState. It is a property that returns the value of the state attribute of the device.
This allows, e.g. to set the bgRole of a TaurusLabel to display the color of the tango state instead of the taurus state:
from taurus.qt.qtgui.application import TaurusApplication
from taurus.qt.qtgui.display import TaurusLabel
if __name__ == '__main__':
import sys
app = TaurusApplication()
w = TaurusLabel()
# Show the status attr in the foreground
w.setModel('sys/tg_test/1/status')
# show the *tango* state color as background
w.setBgRole('parentObj.tangoState')
w.show()
sys.exit(app.exec_())
Merge request reports
Activity
Hi @CPascual , I review the code and it is OK but you can get the same behavior with:
w.setBgRole('parentObj.stateObj.rvalue')
IMO this new property is not necessary
@cmft :
you can get the same behavior with:
w.setBgRole('parentObj.stateObj.rvalue')
IMO this new property is not necessaryYou are absolutely right! I was looking for this solution Yesterday and for some reason I couldn't get it...
So I am rejecting this PR since it is unnecessary.