Skip to content
Snippets Groups Projects

Add tangoState property to tango device objects

Closed 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

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Author Contributor

    Ready for integration. @taurus-org/integrators , anyone?

  • 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

  • Author Contributor

    @cmft :

    you can get the same behavior with: w.setBgRole('parentObj.stateObj.rvalue') IMO this new property is not necessary

    You 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.

Please register or sign in to reply
Loading