PyDMByteIndicator

class pydm.widgets.byte.PyDMByteIndicator(parent: Optional[QWidget] = None, init_channel=None)[source]

Bases: QWidget, PyDMWidget

Widget for graphical representation of bits from an integer number with support for Channels and more from PyDM

Parameters:
  • parent (QWidget) – The parent widget for the Label

  • init_channel (str, optional) – The channel to be used by the widget.

alarm_severity_changed(new_alarm_severity: int) None[source]

Callback invoked when the Channel alarm severity is changed.

Parameters:

new_alarm_severity (int) – The new severity where 0 = NO_ALARM, 1 = MINOR, 2 = MAJOR and 3 = INVALID

bigEndian

Whether the most significant bit is at the start or end of the widget.

Return type:

bool

circles

Draw indicators as circles, rather than rectangles.

Return type:

bool

clear() None[source]

Remove all inner widgets from the layout

connection_changed(connected: bool) None[source]

Callback invoked when the connection state of the Channel is changed. This callback acts on the connection state to enable/disable the widget and also trigger the change on alarm severity to ALARM_DISCONNECTED.

Parameters:

connected (bool) – When this value is False the channel is disconnected, True otherwise.

init_for_designer() None[source]

Method called after the constructor to tweak configurations for when using the widget with the Qt Designer

labelPosition

The side of the widget to display labels on.

Return type:

int

labels

Labels for each bit.

Return type:

list

numBits

Number of bits to interpret.

Return type:

int

offColor

The color for a bit in the ‘off’ state.

Return type:

QColor

onColor

The color for a bit in the ‘on’ state.

Return type:

QColor

orientation

Whether to lay out the bit indicators vertically or horizontally.

Return type:

int

paintEvent(_) None[source]

Paint events are sent to widgets that need to update themselves, for instance when part of a widget is exposed because a covering widget was moved.

At PyDMDrawing this method handles the alarm painting with parameters from the stylesheet, configures the brush, pen and calls `draw_item` so the specifics can be performed for each of the drawing classes.

Parameters:

event (QPaintEvent) –

rebuild_layout() None[source]

Method to reorganize the top-level widget and its contents according to the layout property values.

set_spacing() None[source]

Configures the correct spacing given the selected orientation.

shift

Bit shift.

Return type:

int

showLabels

Whether or not to show labels next to each bit indicator.

Return type:

bool

update_indicators() None[source]

Update the inner bit indicators accordingly with the new value.

value_changed(new_val: int) None[source]

Callback invoked when the Channel value is changed.

Parameters:

new_val (int) – The new value from the channel.

Note

See QWidget Documentation for all inherited properties and methods.