# `TaurusLed`

digraph inheritance7ce83b5eb7 { bgcolor=transparent; rankdir=UD; ratio=compress; size="8.0, 12.0"; "BaseConfigurableClass" [URL="taurus.qt.qtcore.configuration-BaseConfigurableClass.html#taurus.qt.qtcore.configuration.BaseConfigurableClass",color=dodgerblue1,fillcolor=white,fontcolor=black,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.5,shape=box,style=rounded,target="_top",tooltip="A base class defining the API for configurable objects."]; "Logger" [URL="taurus-Logger.html#taurus.Logger",color=dodgerblue1,fillcolor=white,fontcolor=black,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.5,shape=box,style=rounded,target="_top",tooltip="The taurus logger class. All taurus pertinent classes should inherit"]; "QLed" [URL="taurus.qt.qtgui.display-QLed.html#taurus.qt.qtgui.display.QLed",color=dodgerblue1,fillcolor=white,fontcolor=black,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.5,shape=box,style=rounded,target="_top",tooltip="A Led"]; "QPixmapWidget" -> "QLed" [arrowsize=0.5,style="setlinewidth(0.5)"]; "QObject" [color=dodgerblue1,fillcolor=white,fontcolor=black,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.5,shape=box,style=rounded,tooltip="QObject(parent: QObject|None = None)"]; "wrapper" -> "QObject" [arrowsize=0.5,style="setlinewidth(0.5)"]; "QPaintDevice" [color=dodgerblue1,fillcolor=white,fontcolor=black,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.5,shape=box,style=rounded,tooltip="QPaintDevice()"]; "simplewrapper" -> "QPaintDevice" [arrowsize=0.5,style="setlinewidth(0.5)"]; "QPixmapWidget" [URL="taurus.qt.qtgui.display-QPixmapWidget.html#taurus.qt.qtgui.display.QPixmapWidget",color=dodgerblue1,fillcolor=white,fontcolor=black,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.5,shape=box,style=rounded,target="_top",tooltip="This widget displays an image (pixmap). By default the pixmap is"]; "QWidget" -> "QPixmapWidget" [arrowsize=0.5,style="setlinewidth(0.5)"]; "QWidget" [color=dodgerblue1,fillcolor=white,fontcolor=black,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.5,shape=box,style=rounded,tooltip="QWidget(parent: QWidget|None = None, flags: Qt.WindowFlags|Qt.WindowType = Qt.WindowFlags())"]; "QObject" -> "QWidget" [arrowsize=0.5,style="setlinewidth(0.5)"]; "QPaintDevice" -> "QWidget" [arrowsize=0.5,style="setlinewidth(0.5)"]; "TaurusBaseComponent" [URL="taurus.qt.qtgui.base-TaurusBaseComponent.html#taurus.qt.qtgui.base.TaurusBaseComponent",color=dodgerblue1,fillcolor=white,fontcolor=black,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.5,shape=box,style=rounded,target="_top",tooltip="A generic Taurus component."]; "TaurusListener" -> "TaurusBaseComponent" [arrowsize=0.5,style="setlinewidth(0.5)"]; "BaseConfigurableClass" -> "TaurusBaseComponent" [arrowsize=0.5,style="setlinewidth(0.5)"]; "TaurusBaseWidget" [URL="taurus.qt.qtgui.base-TaurusBaseWidget.html#taurus.qt.qtgui.base.TaurusBaseWidget",color=dodgerblue1,fillcolor=white,fontcolor=black,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.5,shape=box,style=rounded,target="_top",tooltip="The base class for all Qt Taurus widgets."]; "TaurusBaseComponent" -> "TaurusBaseWidget" [arrowsize=0.5,style="setlinewidth(0.5)"]; "TaurusLed" [URL="#taurus.qt.qtgui.display.TaurusLed",color=dodgerblue1,fillcolor=white,fontcolor=black,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.5,shape=box,style=rounded,target="_top",tooltip="A widget designed to represent with a LED image the state of a device,"]; "QLed" -> "TaurusLed" [arrowsize=0.5,style="setlinewidth(0.5)"]; "TaurusBaseWidget" -> "TaurusLed" [arrowsize=0.5,style="setlinewidth(0.5)"]; "TaurusListener" [URL="taurus.core.tauruslistener-TaurusListener.html#taurus.core.tauruslistener.TaurusListener",color=dodgerblue1,fillcolor=white,fontcolor=black,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.5,shape=box,style=rounded,target="_top",tooltip="TaurusListener Interface"]; "Logger" -> "TaurusListener" [arrowsize=0.5,style="setlinewidth(0.5)"]; "simplewrapper" [color=dodgerblue1,fillcolor=white,fontcolor=black,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.5,shape=box,style=rounded]; "wrapper" [color=dodgerblue1,fillcolor=white,fontcolor=black,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.5,shape=box,style=rounded]; "simplewrapper" -> "wrapper" [arrowsize=0.5,style="setlinewidth(0.5)"]; }

class TaurusLed(parent=None, designMode=False)

  A widget designed to represent with a LED image the state of a device, the value of a boolean attribute or the quality of an attribute.

  Import from `taurus.qt.qtgui.display` as:

      from taurus.qt.qtgui.display import TaurusLed

  DefaultFgRole = 'rvalue'
  DefaultModelIndex = None
  DefaultOffColor = 'green'
  DefaultOnColor = 'green'
  controller()
  fgRole

    This property holds the foreground role. Valid values are:

    > 1. ‘value’ - the value is used

    > 2. ‘w_value’ - the write value is used

    > 3. ‘quality’ - the quality is used

    Access functions:

    > - `TaurusLed.getFgRole()`

    > - `TaurusLed.setFgRole()`

    > - `TaurusLed.resetFgRole()`

  getFgRole()
  getModelIndex()
  getModelIndexValue()

    Called inside getDisplayValue to use with spectrum attributes. By default not used, but some widget might want to support this feature.

    Note

    getModelIndexValue() is only supported for the default model key

    Override when needed.

  getOffColor()

    Returns the preferred led off color :return: led off color :rtype: str

  getOnColor()

    Returns the preferred led on color :return: led on color :rtype: str

  classmethod getQtDesignerPluginInfo()

    Returns pertinent information in order to be able to build a valid QtDesigner widget plugin.

    The dictionary returned by this method should contain at least the following keys and values:

    - ‘module’ : a string representing the full python module name (ex.: ‘taurus.qt.qtgui.base’)

    - ‘icon’ : a string representing valid resource icon (ex.: ‘designer:combobox.png’)

    - ‘container’a bool telling if this widget is a container widget or

        not.

    This default implementation returns the following dictionary:

        { 'group'     : 'Taurus [Unclassified]',
          'icon'      : 'logos:taurus.png',
          'container' : False }

    Returns:

      a map with pertinent designer information

    Return type:

      dict

  handleEvent(evt_src, evt_type, evt_value)

    very basic and generalistic handling of events.

    Override when necessary.

    Parameters:

      - evt_src (object or None) – object that triggered the event

      - evt_type (taurus.core.taurusbasetypes.TaurusEventType or None) – type of event

      - evt_value (object or None) – event value

  isReadOnly()

    Determines if this component is read-only or not in the sense that the user can interact with it. Default implementation returns True.

    Override when necessary.

    Returns:

      whether or not this component is read-only

    Return type:

      bool

  model

    This property holds the unique URI string representing the model name with which this widget will get its data from. The convention used for the string can be found here.

    Access functions:

    > - `TaurusBaseWidget.getModel()`

    > - `TaurusLabel.setModel()`

    > - `TaurusBaseWidget.resetModel()`

    See also

    Model concept

  modelIndex

    This property holds the index inside the model value that should be displayed

    Access functions:

    > - `TaurusLed.getModelIndex()`

    > - `TaurusLed.setModelIndex()`

    > - `TaurusLed.resetModelIndex()`

    See also

    Model concept

  offColor

    This property holds the preferred led color This value is used for the cases where the model value does not contain enough information to distinguish between different Off colors. For example, a bool attribute, when it is False it is displayed with the off led but when it is true it may be displayed On in any color. The prefered color would be used in this case.

    Access functions:

    > - `TaurusLed.getOffColor()`

    > - `TaurusLed.setOffColor()`

    > - `TaurusLed.resetOffColor()`

  onColor

    This property holds the preferred led color This value is used for the cases where the model value does not contain enough information to distinguish between different On colors. For example, a bool attribute, when it is False it is displayed with the off led but when it is true it may be displayed On in any color. The prefered color would be used in this case.

    Access functions:

    > - `TaurusLed.getOnColor()`

    > - `TaurusLed.setOnColor()`

    > - `TaurusLed.resetOnColor()`

  resetFgRole()
  resetModelIndex()
  resetOffColor()

    Resets the preferred led color

  resetOnColor()

    Resets the preferred led on color

  setFgRole(fgRole)
  setModel(m, **kwargs)

    Sets/unsets the model name for the given key. If key is MLIST, a model is set for each name in the model sequence, new model keys are automatically added to the object’s `modelList` attribute and the corresponding models are attached using those keys. The new keys are of the form `(MLIST, i)` where `i` is the index of the corresponding model name in the model sequence.

    Parameters:

      - model (str (or sequence of str if key is MLIST)) – the new model name. If key is MLIST, model is expected to be a sequence of model names.

      - key (object) – the model key. Defaults to first element of .modelKeys

  setModelIndex(modelIndex)
  setOffColor(color)

    Sets the preferred led off color

    Parameters:

      status (str) – the new off color

  setOnColor(color)

    Sets the preferred led on color

    Parameters:

      status (str) – the new on color

  useParentModel

    (deprecated))