Skip to content

Add tangoState property to tango device objects

Carlos Pascual requested to merge github/fork/cpascual/tangoState into develop

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