mxcubecore.HardwareObjects.abstract.AbstractActuator#
Abstract Actuator.
Classes
|
Abstract actuator defines methods common to all moving devices. |
- class mxcubecore.HardwareObjects.abstract.AbstractActuator.AbstractActuator(name: str)[source]#
Bases:
HardwareObject
Abstract actuator defines methods common to all moving devices.
The
_set_value
method is the only abtract method that needs to be overloaded in each implementation.- _nominal_limits#
Values specified by XML property, otherwise
None
.
- Emits:
valueChanged (tuple[int]) – Tuple whose first and only item is the new value. Emitted during initialization of the hardware object and when setting a new value.
limitsChanged (tuple[tuple[int, int]]) – Tuple whose first and only item is a two-item tuple of the new limits (low limit first and high limit second). Emitted by
update_limits
if limit values are changed.stateChanged (tuple) – Tuple whose first and only item is the new state. Emitted by
force_emit_signals
- Parameters:
name (str) –
- force_emit_signals() None [source]#
Force emission of all signals.
Method is called from GUI. Do not call it from within a hardware object.
- Return type:
None
- get_limits()[source]#
Return actuator low and high limits.
- Returns:
Two-item tuple (low limit, high limit).
- Return type:
(tuple)
- set_limits(limits: tuple) None [source]#
Set actuator low and high limits and emit signal
limitsChanged
.- Parameters:
limits (tuple) – Two-item tuple (low limit, high limit).
- Raises:
ValueError – Attempt to set limits for read-only actuator.
- Return type:
None
- set_value(value, timeout: float = 0) None [source]#
Set actuator to value.
If
timeout == 0
: return at once and do not wait (default). Iftimeout is None
: wait forever.- Parameters:
value – target value
timeout (float) – Optional timeout in seconds. Default is
0
: do not wait.
- Raises:
ValueError – Invalid value or attemp to set read only actuator.
RuntimeError – Timeout waiting for status ready (from
wait_ready
):
- Return type:
None
- update_limits(limits=None) None [source]#
Check if the limits have changed and emit signal
limitsChanged
.- Parameters:
limits (tuple) – Two-item tuple (low limit, high limit).
- Return type:
None