pcdsdevices.pv_positioner.PVPositionerNoInterrupt
- class pcdsdevices.pv_positioner.PVPositionerNoInterrupt(*args, **kwargs)
A PV positioner whose moves cannot be interrupted.
If we try to start a new move before the previous move completes, instead we will get a clear error advising us to wait.
- Parameters:
prefix (str, optional) – The device prefix used for all sub-positioners. This is optional as it may be desirable to specify full PV names for PVPositioners.
limits (2-element sequence, optional) – (low_limit, high_limit)
name (str) – The device name
egu (str, optional) – The engineering units (EGU) for the position
settle_time (float, optional) – The amount of time to wait after moves to report status completion
timeout (float, optional) – The default timeout to use for motion requests, in seconds.
- setpoint
The setpoint (request) signal
- Type:
Signal
- readback
The readback PV (e.g., encoder position PV)
- Type:
Signal or None
- actuate
The actuation PV to set when movement is requested
- Type:
Signal or None
- actuate_value
The actuation value, sent to the actuate signal when motion is requested
- Type:
any, optional
- stop_signal
The stop PV to set when motion should be stopped
- Type:
Signal or None
- stop_value
The value sent to stop_signal when a stop is requested
- Type:
any, optional
- done
A readback value indicating whether motion is finished
- Type:
Signal
- done_value
The value that the done pv should be when motion has completed
- Type:
any, optional
- put_complete
If set, the specified PV should allow for asynchronous put completion to indicate motion has finished. If
actuate
is specified, it will be used for put completion. Otherwise, thesetpoint
will be used. See the-c
option fromcaput
for more information.- Type:
bool, optional
Methods
- configure(d: Dict[str, Any]) Tuple[Dict[str, Any], Dict[str, Any]]
Configure the device for something during a run
This default implementation allows the user to change any of the
configuration_attrs
. Subclasses might override this to perform additional input validation, cleanup, etc.- Parameters:
d (dict) – The configuration dictionary. To specify the order that the changes should be made, use an OrderedDict.
- Returns:
(old, new) tuple of dictionaries
Where old and new are pre- and post-configure configuration states.
- describe() OrderedDictType[str, Dict[str, Any]]
Provide schema and meta-data for
read()
.This keys in the
OrderedDict
this method returns must match the keys in theOrderedDict
return byread()
.This provides schema related information, (ex shape, dtype), the source (ex PV name), and if available, units, limits, precision etc.
- Returns:
data_keys (OrderedDict) – The keys must be strings and the values must be dict-like with the
event_model.event_descriptor.data_key
schema.
- get(**kwargs)
Get the value of all components in the device
Keyword arguments are passed onto each signal.get(). Components beginning with an underscore will not be included.
- move(position: float, wait: bool = True, timeout: float | None = None, moved_cb: Callable[[PVPositionerNoInterrupt], None] | None = None)
Move to a specified position, optionally waiting for motion to complete. Unlike the standard move, this will fail with a clear error message when a move is already in progress.
- Parameters:
position (float) – Position to move to
moved_cb (callable) – Call this callback when movement has finished. This callback must accept one keyword argument: ‘obj’ which will be set to this positioner instance.
timeout (float, optional) – Maximum time to wait for the motion. If None, the default timeout for this positioner is used.
- Returns:
status (MoveStatus)
- Raises:
TimeoutError – When motion takes longer than
timeout
ValueError – On invalid positions
RuntimeError – If motion fails other than timing out, including when a move is attempted while another move is already in progress.
- read() OrderedDictType[str, Dict[str, Any]]
Read data from the device.
This method is expected to be as instantaneous as possible, with any substantial acquisition time taken care of in
trigger()
.The
OrderedDict
returned by this method must have identical keys (in the same order) as theOrderedDict
returned bydescribe()
.By convention, the first key in the return is the ‘primary’ key and maybe used by heuristics in
bluesky
.The values in the ordered dictionary must be dict (-likes) with the keys
{'value', 'timestamp'}
. The'value'
may have any type, the timestamp must be a float UNIX epoch timestamp in UTC.- Returns:
data (OrderedDict) – The keys must be strings and the values must be dict-like with the keys
{'value', 'timestamp'}
- read_configuration() OrderedDictType[str, Dict[str, Any]]
Dictionary mapping names to value dicts with keys: value, timestamp
To control which fields are included, change the Component kinds on the device, or modify the
configuration_attrs
list.
- set(new_position: Any, *, timeout: float | None = None, moved_cb: Callable | None = None, wait: bool = False) StatusBase
Set a value and return a Status object
- Parameters:
new_position (object) – The input here is whatever the device requires (this should be over-ridden by the implementation. For example a motor would take a float, a shutter the strings {‘Open’, ‘Close’}, and a goineometer (h, k, l) tuples
timeout (float, optional) – Maximum time to wait for the motion. If None, the default timeout for this positioner is used.
moved_cb (callable, optional) –
Deprecated
Call this callback when movement has finished. This callback must accept one keyword argument: ‘obj’ which will be set to this positioner instance.
wait (bool, optional) –
Deprecated
If the method should block until the Status object reports it is done.
Defaults to False
- Returns:
status (StatusBase) – Status object to indicate when the motion / set is done.
- stop(*, success=False)
Stop the Device and all (instantiated) subdevices
- summary()
- trigger() StatusBase
Trigger the device and return status object.
This method is responsible for implementing ‘trigger’ or ‘acquire’ functionality of this device.
If there is an appreciable time between triggering the device and it being able to be read (via the
read()
method) then this method is also responsible for arranging that theStatusBase
object returned by this method is notified when the device is ready to be read.If there is no delay between triggering and being readable, then this method must return a
StatusBase
object which is already completed.- Returns:
status (StatusBase) –
StatusBase
object which will be marked as complete when the device is ready to be read.
Attributes
- actuate = None
- actuate_value = 1
- configuration_attrs
- connected
- done = None
- done_value = 1
- egu
The engineering units (EGU) for a position
- high_limit
- hints
- kind
- limits
- low_limit
- moving
Whether or not the motor is moving
If a
done
PV is specified, it will be read directly to get the motion status. If not, it determined from the internal state of PVPositioner.- Returns:
bool
- position
The current position of the motor in its engineering units
- Returns:
position (any)
- put_complete
- readback = None
- setpoint = None
- settle_time
Amount of time to wait after moves to report status completion
- stop_signal = None
- stop_value = 1
- subscriptions: ClassVar[FrozenSet[str]] = frozenset({'_req_done', 'acq_done', 'done_moving', 'readback', 'start_moving'})
- timeout
Amount of time to wait before to considering a motion as failed