PyDMEnumButton¶
-
class
pydm.widgets.enum_button.
PyDMEnumButton
(parent=None, init_channel=None)[source]¶ A QWidget that renders buttons for every option of Enum Items. For now three types of buttons can be rendered: - Push Button - Radio Button
- Parameters
parent (QWidget) – The parent widget for the Label
init_channel (str, optional) – The channel to be used by the widget.
Signals –
------- –
send_value_signal (int, float, str, bool or np.ndarray) – Emitted when the user changes the value.
-
check_enable_state
()[source]¶ Checks whether or not the widget should be disable. This method also disables the widget and add a Tool Tip with the reason why it is disabled.
-
enum_strings_changed
(new_enum_strings)[source]¶ Callback invoked when the Channel has new enum values. This callback also triggers a value_changed call so the new enum values to be broadcasted.
- Parameters
new_enum_strings (tuple) – The new list of values
-
handle_button_clicked
(id)[source]¶ Handles the event of a button being clicked.
- Parameters
id (int) – The clicked button id.
-
items
¶ Items to be displayed in the button group.
This property can be overridden by the items coming from the control system. Because C++ QStringList expects a list type, we need to make sure that None is never returned.
- Returns
- Return type
List[str]
-
minimumSizeHint
()[source]¶ This property holds the recommended minimum size for the widget.
- Returns
- Return type
QSize
-
orientation
¶ Whether to lay out the bit indicators vertically or horizontally.
- Returns
- Return type
int
-
rebuild_layout
()[source]¶ Method to reorganize the top-level widget and its contents according to the layout property values.
-
rebuild_widgets
()[source]¶ Rebuild the list of widgets based on a new enum or generates a default list of fake strings so we can see something at Designer.
-
value_changed
(new_val)[source]¶ Callback invoked when the Channel value is changed.
- Parameters
new_val (int) – The new value from the channel.
-
widgetType
¶ The widget type to be used when composing the group.
- Returns
- Return type
WidgetType