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
- 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
- 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) –
- prop_type
alias of
Orientation
- readBigEndian() bool [source]
Whether the most significant bit is at the start or end of the widget.
- Return type:
bool
- readLabelPosition() TabPosition [source]
The side of the widget to display labels on.
- Return type:
int
- readOrientation() int | PyQt5.QtCore.Qt.Orientation [source]
Whether to lay out the bit indicators vertically or horizontally.
- Return type:
int
- readShowLabels() bool [source]
Whether or not to show labels next to each bit indicator.
- Return type:
bool
- rebuild_layout() None [source]
Method to reorganize the top-level widget and its contents according to the layout property values.
- setBigEndian(is_big_endian: bool) None [source]
Whether the most significant bit is at the start or end of the widget.
- Parameters:
is_big_endian (bool) – If True, the Big Endian will be used, Little Endian otherwise
- setCircles(draw_circles: bool) None [source]
Draw indicators as circles, rather than rectangles.
- Parameters:
draw_circles (bool) – If True, bits will be represented as circles
- setLabelPosition(new_pos: TabPosition) None [source]
The side of the widget to display labels on.
- Parameters:
new_pos (QTabWidget.TabPosition, int) –
- setLabels(new_labels: List[str]) None [source]
Labels for each bit.
- Parameters:
new_labels (list) –
- setNumBits(new_num_bits: int) None [source]
Number of bits to interpret.
- Parameters:
new_num_bits (int) –
- setOffColor(new_color: QColor) None [source]
The color for a bit in the ‘off’ state.
- Parameters:
new_color (QColor) –
- setOnColor(new_color: QColor) None [source]
The color for a bit in the ‘on’ state.
- Parameters:
new_color (QColor) –
- setOrientation(new_orientation: Orientation) None [source]
Whether to lay out the bit indicators vertically or horizontally.
- Parameters:
new_orientation (Qt.Orientation, int) –
Note
See QWidget Documentation for all inherited properties and methods.