cut 3.4.1-rc1
Loading...
Searching...
No Matches
taurus.taurusledarray.TaurusLedArray Class Reference

Taurus-compatible widget that displays an array of LEDs bound to a Taurus model. More...

Inheritance diagram for taurus.taurusledarray.TaurusLedArray:
QeLedArray

Public Member Functions

 __init__ (self, parent=None, designMode=False)
 Initialize the TaurusLedArray widget.
 
 controller (self)
 Returns controller object for this widget.
 
 controllerUpdate (self)
 Ask the controller to update the widget with the current model data.
 
 handleEvent (self, evt_src, evt_type, evt_value)
 Overwritting Taurus Methods ###.
 
 isReadOnly (self)
 Overrides TaurusBaseComponent.isReadOnly method.
 
int getModelIndexValue (self)
 Getter for the modelIndex as int property.
 
str getModelIndex (self)
 Getter for the modelIndex as string property.
 
 setModelIndex (self, str modelIndex)
 Set the index inside the model value to be displayed.
 
 getModelMimeData (self)
 Retrieve the MIME data associated with the current model.
 
 resetModelIndex (self)
 Reset for the modelIndex property.
 
 setModel (self, m, **kwargs)
 Setter for model property, which is the URI to the datapoint to be read This should point to a Taurus Model that is an array or a single value datapoint.
 
str getBgRole (self)
 Getter for the bgRole property.
 
 setBgRole (self, str bgRole)
 Set the background role.
 
 resetBgRole (self)
 Reset the background role to its default value.
 
str getFgRole (self)
 Returns the foreground role value.
 
 setFgRole (self, str fgRole)
 Set what is shown as the foreground (the text) of the label Valid Roles are:
 
 resetFgRole (self)
 Reset the foreground role to its default value.
 
- Public Member Functions inherited from QeLedArray
std::vector< bool > GetStatesBoolVector () const
 GetStatesBoolVector Helper method to get current states.
 
QList< SignalType > GetSignalTypesEnumList ()
 GetSignalTypesEnumList Returns current signal types for each LED.
 
void SetToolTips (QList< QString > tooltips)
 SetToolTips sets tooltips for existing LEDs.
 
void SetSignalTypes (const QList< SignalType > &signal_types)
 SetSignalTypes method to set signal types using enum values of SignalType type.
 
void SetLabel (int index, QString label_text)
 SetLabel Sets label under specific index.
 
void SetState (int index, bool state)
 SetState Sets state of a single LED.
 
void SetSignalType (int index, SignalType signal_type)
 SetSignalType Sets signal type associated with the LED.
 

Static Public Attributes

 model
 Redefines the model property to override its setModel method.
 
 modelIndex
 Index inside the model value that should be displayed Access functions:
 
 fgRole
 Foreground role to use Access functions:
 
 bgRole
 Background role to use Access functions:
 

Protected Member Functions

 _calculate_controller_class (self)
 Overwritting Controlling Methods ###.
 

Additional Inherited Members

- Public Slots inherited from QeLedArray
void SetSignalTypes (const QStringList &signal_types)
 SetSignalTypes Converts QStrings to enum values of SignalType type and assigns them to existing LEDs in respective order.
 
- Signals inherited from QeLedArray
void OrderChanged (bool new_value)
 OrderChanged Communicates change of LEDs order.
 
void LabelsVisibilityChanged (bool new_value)
 LabelsVisibilityChanged Communicates change of LEDs' labels visibility.
 
void LedsCountChanged (int new_value)
 LedsCountChanged Communicates change of LEDs' numbers.
 
void StatesChanged (QStringList new_value)
 StatesChanged Communicates change of LEDs' states.
 
void LabelsChanged (QList< QString > labels)
 LabelsChanged Communicates change of LEDs' labels.
 
void SignalTypesChanged (QStringList new_values)
 SignalTypesChanged SignalTypesChanged.
 
- Properties inherited from QeLedArray
bool vertical
 Order of the LEDs in the widget.
 
bool labels_visible
 Show/hide LEDs labels.
 
int leds_count
 Number of LEDs in the array.
 
QStringList states
 States of LEDs.
 
QList< QString > labels
 QList of QStrings that are labels for each LED.
 
QStringList signal_types
 List of QStrings that are later converted to SignalType values which are assigned to corresponding LED (based on order of passed values).
 

Detailed Description

Taurus-compatible widget that displays an array of LEDs bound to a Taurus model.

Each LED in the array represents a state from the underlying Taurus model value. Supports boolean vectors, integers (converted to bit vectors), and string arrays. The widget binds to the Taurus model and automatically updates LED states when the model value changes.

Properties

model str URI as a string for the Taurus model to bind to. modelIndex str Index inside the model value that should be displayed. fgRole str Foreground role to use ('value', 'rvalue', 'none'). bgRole str Background role to use ('quality', 'none').

Constructor & Destructor Documentation

◆ __init__()

taurus.taurusledarray.TaurusLedArray.__init__ ( self,
parent = None,
designMode = False )

Initialize the TaurusLedArray widget.

Parameters
parentParent widget that holds this TaurusLedArray instance.
designModeTrue if created in Qt Designer.

Member Function Documentation

◆ _calculate_controller_class()

taurus.taurusledarray.TaurusLedArray._calculate_controller_class ( self)
protected

Overwritting Controlling Methods ###.

Determine the appropriate controller class based on the model type.

Returns
Controller class instance (TaurusLedArrayController).

◆ getBgRole()

str taurus.taurusledarray.TaurusLedArray.getBgRole ( self)

Getter for the bgRole property.

Returns the background role value

◆ getModelIndex()

str taurus.taurusledarray.TaurusLedArray.getModelIndex ( self)

Getter for the modelIndex as string property.

Get the model index as a string.

Returns
Model index as a string value.

◆ getModelIndexValue()

int taurus.taurusledarray.TaurusLedArray.getModelIndexValue ( self)

Getter for the modelIndex as int property.

Get the model index as an integer.

Returns
Model index as an integer value.

◆ getModelMimeData()

taurus.taurusledarray.TaurusLedArray.getModelMimeData ( self)

Retrieve the MIME data associated with the current model.

Returns
MIME data object containing the model text information.

◆ handleEvent()

taurus.taurusledarray.TaurusLedArray.handleEvent ( self,
evt_src,
evt_type,
evt_value )

Overwritting Taurus Methods ###.

Overrides TaurusBaseComponent.handleEvent method. Grab the the event value and based on the index set the radians values to be converted by the QeLedArray

Parameters
evt_srcName of the Attribute that generates the event
evt_typeType of Event according to taurus.core.taurusbasetypes.TaurusEventType
evt_valueValue of the event

◆ isReadOnly()

taurus.taurusledarray.TaurusLedArray.isReadOnly ( self)

Overrides TaurusBaseComponent.isReadOnly method.

Indicates that the widget is a read only widget.

Returns
True

◆ resetModelIndex()

taurus.taurusledarray.TaurusLedArray.resetModelIndex ( self)

Reset for the modelIndex property.

Reset the model index to its default value.

◆ setBgRole()

taurus.taurusledarray.TaurusLedArray.setBgRole ( self,
str bgRole )

Set the background role.

The label background will be set according to the current palette and the role. Valid roles are:

  • 'none' : no background
  • 'quality' a color depending on the attribute quality

◆ setFgRole()

taurus.taurusledarray.TaurusLedArray.setFgRole ( self,
str fgRole )

Set what is shown as the foreground (the text) of the label Valid Roles are:

  • 'rvalue' the read value of the attribute
  • 'none' : no text

◆ setModel()

taurus.taurusledarray.TaurusLedArray.setModel ( self,
m,
** kwargs )

Setter for model property, which is the URI to the datapoint to be read This should point to a Taurus Model that is an array or a single value datapoint.

Parameters
uriString that contains a URI for the Taurus Model.
indexElement number to be read in case it is an array datapoint value.

◆ setModelIndex()

taurus.taurusledarray.TaurusLedArray.setModelIndex ( self,
str modelIndex )

Set the index inside the model value to be displayed.

The index can be a single integer or a sequence of integers.

Parameters
modelIndexString representing model index (integer or sequence).

Member Data Documentation

◆ bgRole

taurus.taurusledarray.TaurusLedArray.bgRole
static
Initial value:
= Property(
"QString",
fget=getBgRole,
fset=setBgRole,
freset=resetBgRole,
doc="background role",
)

Background role to use Access functions:

◆ fgRole

taurus.taurusledarray.TaurusLedArray.fgRole
static
Initial value:
= Property(
"QString",
fget=getFgRole,
fset=setFgRole,
freset=resetFgRole,
doc="foreground role",
)

Foreground role to use Access functions:

◆ model

taurus.taurusledarray.TaurusLedArray.model
static
Initial value:
= Property(
"QString",
fget=TaurusBaseWidget.getModel,
fset=setModel,
freset=TaurusBaseWidget.resetModel,
doc="URI as a string for the taurus model",
)

Redefines the model property to override its setModel method.

Access functions:

  • TaurusBaseWidget.getModel
  • setModel
  • TaurusBaseWidget.resetModel

◆ modelIndex

taurus.taurusledarray.TaurusLedArray.modelIndex
static
Initial value:
= Property(
"QString",
fget=getModelIndex,
fset=setModelIndex,
freset=resetModelIndex,
doc="Model index",
)

Index inside the model value that should be displayed Access functions:


The documentation for this class was generated from the following file: