csaxs_bec.devices.epics.delay_generator_csaxs.delay_generator_csaxs.StatusBitsCompareStatus#
- class StatusBitsCompareStatus(signal: EpicsSignalRO, value: STATUSBITS, raise_states: list[STATUSBITS] | None = None, *args, event_type=None, timeout: float | None = None, add_delay: float | None = None, settle_time: float = 0, run: bool = True, **kwargs)[source]#
Bases:
SubscriptionStatusCompare status for STATUSBITS comparison.
Initialize the compare status with a signal.
Methods
Register a callback to be called once when the Status finishes.
Update the status object
Return the exception raised by the action.
Mark as finished but failed with the given Exception.
Mark as finished successfully.
Block until the action completes.
Attributes
Whether this status must resolve successfully for a composite to succeed.
Callbacks to be run when the status is marked as finished
Boolean indicating whether associated operation has completed.
finished_cbA delay between when
set_finished()is when the Status is done.Boolean indicating whether associated operation has completed.
The timeout for this action.
- add_callback(callback)#
Register a callback to be called once when the Status finishes.
The callback will be called exactly once. If the Status is finished before a callback is added, it will be called immediately. This is threadsafe.
The callback will be called regardless of success of failure. The callback has access to this status object, so it can distinguish success or failure by inspecting the object.
- Parameters:
callback (callable) –
Expected signature:
callback(status).The signature
callback()is also supported for backward-compatibility but will issue warnings. Support will be removed in a future release of ophyd.
- property blocks_success: bool#
Whether this status must resolve successfully for a composite to succeed.
- property callbacks#
Callbacks to be run when the status is marked as finished
- check_value(*args, **kwargs)#
Update the status object
- property done#
Boolean indicating whether associated operation has completed.
This is set to True at __init__ time or by calling
set_finished(),set_exception(), or (deprecated)_finished(). Once True, it can never become False.
- exception(timeout=None)#
Return the exception raised by the action.
If the action has completed successfully, return
None. If it has finished in error, return the exception.- Parameters:
timeout (Union[Number, None], optional) – If None (default) wait indefinitely until the status finishes.
- Raises:
WaitTimeoutError – If the status has not completed within
timeout(starting from when this method was called, not from the beginning of the action).
- set_exception(exc)#
Mark as finished but failed with the given Exception.
This method should generally not be called by the recipient of this Status object, but only by the object that created and returned it.
- Parameters:
exc (Exception)
- set_finished()#
Mark as finished successfully.
- property settle_time#
A delay between when
set_finished()is when the Status is done.This is set when the Status is created, and it cannot be changed.
- property success#
Boolean indicating whether associated operation has completed.
This is set to True at __init__ time or by calling
set_finished(),set_exception(), or (deprecated)_finished(). Once True, it can never become False.
- property timeout#
The timeout for this action.
This is set when the Status is created, and it cannot be changed.
- wait(timeout=None)#
Block until the action completes.
When the action has finished succesfully, return
None. If the action has failed, raise the exception.- Parameters:
timeout (Union[Number, None], optional) – If None (default) wait indefinitely until the status finishes.
- Raises:
WaitTimeoutError – If the status has not completed within
timeout(starting from when this method was called, not from the beginning of the action).StatusTimeoutError – If the status has failed because the timeout that it was initialized with has expired.
Exception – This is
status.exception(), raised if the status has finished with an error. This may includeTimeoutError, which indicates that the action itself raisedTimeoutError, distinct fromWaitTimeoutErrorabove.