Mixins
A couple of mixin classes were created to help us make it easy to create new symbol widgets and ensure that the code has an uniform behavior.
Interlock
- class pcdswidgets.vacuum.mixins.InterlockMixin(interlock_suffix, **kwargs)[source]
The InterlockMixin class adds the interlock channel and interlocked property to the widget.
The interlocked property can be used at stylesheet in the following manner:
*[interlocked="true"] { background-color: red; }
- Parameters:
interlock_suffix (str) – The suffix to be used along with the channelPrefix from PCDSSymbolBase to compose the interlock channel address.
- create_channels()[source]
This method invokes create_channels from the super classes and adds the interlock_channel to the widget along with a reset for the interlocked and interlock_connected variables.
- interlock_connection_changed(conn)[source]
Callback invoked when the connection status changes for the Interlock Channel.
- Parameters:
conn (bool) – True if connected, False otherwise.
Error
- class pcdswidgets.vacuum.mixins.ErrorMixin(error_suffix, **kwargs)[source]
The ErrorMixin class adds the error channel and error property to the widget.
The error property can be used at stylesheet in the following manner:
*[error="INVALID"] { color: purple; }
- Parameters:
error_suffix (str) – The suffix to be used along with the channelPrefix from PCDSSymbolBase to compose the error channel address.
- create_channels()[source]
This method invokes create_channels from the super classes and adds the error_channel to the widget along with a reset for the error and error_connected variables.
- error_connection_changed(conn)[source]
Callback invoked when the connection status changes for the Error Channel.
- Parameters:
conn (bool) – True if connected, False otherwise.
- error_enum_changed(items)[source]
Callback invoked when the enumeration strings change for the Error Channel. This callback triggers the update of the error message and also a repaint of the widget with the new stylesheet guidelines for the current error value.
- Parameters:
items (tuple) – The string items
State
- class pcdswidgets.vacuum.mixins.StateMixin(state_suffix, **kwargs)[source]
The StateMixin class adds the state channel and state property to the widget.
The state property can be used at stylesheet in the following manner:
*[state="Vented"] { border: 5px solid blue; }
- Parameters:
state_suffix (str) – The suffix to be used along with the channelPrefix from PCDSSymbolBase to compose the state channel address.
- create_channels()[source]
This method invokes create_channels from the super classes and adds the state_channel to the widget along with a reset for the state and state_connected variables.
- state_connection_changed(conn)[source]
Callback invoked when the connection status changes for the State Channel.
- Parameters:
conn (bool) – True if connected, False otherwise.
- state_enum_changed(items)[source]
Callback invoked when the enumeration strings change for the State Channel. This callback triggers the update of the state message and also a repaint of the widget with the new stylesheet guidelines for the current state value.
- Parameters:
items (tuple) – The string items
State - Open/Close
- class pcdswidgets.vacuum.mixins.OpenCloseStateMixin(open_suffix, close_suffix, **kwargs)[source]
The OpenCloseStateMixin class adds two channels (Open and Close State) and a state property based on a combination of the two channels to the widget.
The state property can be used at stylesheet in the following manner:
*[state="Close"] { background-color: blue; }
- Parameters:
- create_channels()[source]
This method invokes create_channels from the super classes and adds the state_open_channel and state_close_channel to the widget along with a reset for the state and interlock_connected variables.
- state
Property used to query the state of the widget.
- Returns:
The return string will either be Open, Close or INVALID when it was not possible to determine the state.
- Return type:
- state_connection_changed(which, conn)[source]
Callback invoked when the connection status changes for one of the channels in this mixin.
Label Control
- class pcdswidgets.vacuum.mixins.LabelControl(readback_suffix, readback_name, **kwargs)[source]
The LabelControl class adds a PyDMLabel to the widget for controls.
- Parameters: