ophyd.status.DeviceStatus#

class ophyd.status.DeviceStatus(device, **kwargs)#

Track the status of a potentially-lengthy action like moving or triggering.

This adds the notion of a Device and minimal support for progress bars. (They only get notified of the Device name and the time of completion.) See MoveStatus for a richer implementation of progress bars.

Parameters:
timeout: float, optional

The amount of time to wait before marking the Status as failed. If None (default) wait forever. It is strongly encouraged to set a finite timeout. If settle_time below is set, that time is added to the effective timeout.

settle_time: float, optional

The amount of time to wait between the caller specifying that the status has completed to running callbacks. Default is 0.

__init__(device, **kwargs)#

Methods

__init__(device, **kwargs)

add_callback(callback)

Register a callback to be called once when the Status finishes.

exception([timeout])

Return the exception raised by the action.

set_exception(exc)

Mark as finished but failed with the given Exception.

set_finished()

Mark as finished successfully.

wait([timeout])

Block until the action completes.

watch(func)

Subscribe to notifications about partial progress.

Attributes

callbacks

Callbacks to be run when the status is marked as finished

done

Boolean indicating whether associated operation has completed.

finished_cb

settle_time

A delay between when set_finished() is when the Status is done.

success

Boolean indicating whether associated operation has completed.

timeout

The timeout for this action.