PyDMSpinbox¶
-
class
pydm.widgets.spinbox.
PyDMSpinbox
(parent=None, init_channel=None)[source]¶ A QDoubleSpinBox 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.
-
ctrl_limit_changed
(which, new_limit)[source]¶ Callback invoked when the Channel receives new control limit values.
- Parameters
which (str) – Which control limit was changed. “UPPER” or “LOWER”
new_limit (float) – New value for the control limit
-
keyPressEvent
(ev)[source]¶ Method invoked when a key press event happens on the QDoubleSpinBox.
- For PyDMSpinBox we are interested on the Keypress events for:
CTRL + Left/Right : Increase or Decrease the step exponent;
Up / Down : Add or Remove singleStep units to the value;
PageUp / PageDown : Add or Remove 10 times singleStep units to the value;
Return or Enter : Send the value to the channel using the send_value_signal.
- Parameters
ev (QEvent) –
-
precision_changed
(new_precision)[source]¶ Callback invoked when the Channel has new precision value. This callback also triggers an update_format_string call so the new precision value is considered.
- Parameters
new_precison (int or float) – The new precision value
-
send_value
()[source]¶ Method invoked to send the current value on the QDoubleSpinBox to the channel using the send_value_signal.
-
showStepExponent
¶ Whether to show or not the step exponent
- Returns
- Return type
bool
-
update_format_string
()[source]¶ Reconstruct the format string to be used when representing the output value.
- Returns
- Return type
None
-
value_changed
(new_val)[source]¶ Callback invoked when the Channel value is changed.
- Parameters
new_val (int or float) – The new value from the channel.
Fetch the Widget specific context menu which will be populated with additional tools by assemble_tools_menu.
- Returns
If the return of this method is None a new QMenu will be created by assemble_tools_menu.
- Return type
QMenu or None