class documentation

A dummy stage for testing purposes.

This stage should work similarly to a Sangaboard stage, but without any hardware attached.

Method __enter__ Register the stage position and start move thread running.
Method __exit__ Stop the move thread.
Method __init__ Initialise the Dummy stage, setting the step_time to adjust the speed.
Method set_zero_position Make the current position zero in all axes.
Instance Variable axis_inverted Used to convert coordinates between the program frame and the hardware frame.
Instance Variable instantaneous_position Undocumented
Instance Variable moving Whether the stage is in motion.
Instance Variable step_time Undocumented
Method _check_for_new_move_request Check for new move request to the move_loop.
Method _estimate_move_duration Calculate the expected duration of a move with the given displacement.
Method _hardware_move_absolute Make an absolute move. Keyword arguments should be axis names.
Method _hardware_move_relative Make a relative move. Keyword arguments should be axis names.
Method _hardware_start_move_relative Start a relative move.
Method _hardware_stop Undocumented
Method _hardware_update_position Read position from the stage and set internal attribute _hardware_position.
Method _move_loop Run the move loop. This should be run in a thread on enter.
Method _poll_moving Determine if the stage is still moving.
Method _set_pos_during_move Set the instantaneous position based on the completed fraction of an ongoing move.
Instance Variable _abort_move Undocumented
Instance Variable _hardware_position Undocumented
Instance Variable _inst_pos_lock Undocumented
Instance Variable _move_queue Undocumented
Instance Variable _move_thread Undocumented
Instance Variable _movement_enabled Undocumented
Instance Variable _movement_ongoing Undocumented

Inherited from BaseStage:

Method get_xyz_position Return a tuple containing (x, y, z) position.
Method invert_axis_direction Invert the direction setting of the given axis.
Method jog Make a relative move that may be interrupted by a future jog.
Method move_absolute Make an absolute move. Keyword arguments should be axis names.
Method move_relative Make a relative move. Keyword arguments should be axis names.
Method move_to_xyz_position Move to the location specified by an (x, y, z) tuple.
Method update_position Update the position property from the stage.
Class Variable backlash_steps The number of steps to elimate backlash. The sign sets the direction.
Property axis_names The names of the stage's axes, in order.
Property position Current position of the stage.
Property thing_state Summary metadata describing the current state of the stage.
Method _apply_axis_direction Undocumented
Method _get_from_jog_queue Get the next JogCommand from the jog queue.
Method _jog_loop Execute jog commands in a background thread.
Method _move_with_backlash_correction Make a movement with backlash correction.
Method _send_jog_command Send a jog command to the background jog thread.
Class Variable _axis_names Undocumented
Instance Variable _backlash_state Undocumented
Instance Variable _hardware_lock Undocumented
Instance Variable _jog_lock Undocumented
Instance Variable _jog_queue Undocumented
Instance Variable _jog_thread Undocumented
def __enter__(self) -> Self: (source)

Register the stage position and start move thread running.

def __exit__(self, _exc_type: type[BaseException], _exc_value: BaseException | None, _traceback: TracebackType | None): (source)

Stop the move thread.

def __init__(self, thing_server_interface: lt.ThingServerInterface, step_time: float = 0.001, **kwargs: Any): (source)

Initialise the Dummy stage, setting the step_time to adjust the speed.

Parameters
thing_server_interface:lt.ThingServerInterfaceUndocumented
step_time:floatThe time in seconds per "motor" step. The default of 0.001 works well for the live simulation. For unit testing it is very slow so the speed can be increased. Increasing it too far is problematic if also doing computationally heavy tasks like simulated image blurring.
**kwargs:AnyUndocumented
@lt.action
def set_zero_position(self): (source)

Make the current position zero in all axes.

This action does not move the stage, but resets the position to zero. It is intended for use after manually or automatically recentring the stage.

axis_inverted: dict[str, bool] = (source)

Used to convert coordinates between the program frame and the hardware frame.

instantaneous_position: Mapping[str, int] = (source)

Undocumented

moving: bool = (source)

Whether the stage is in motion.

step_time = (source)

Undocumented

def _check_for_new_move_request(self) -> DummyStageMovement | None: (source)

Check for new move request to the move_loop.

def _estimate_move_duration(self, displacement: Sequence[int]) -> float: (source)

Calculate the expected duration of a move with the given displacement.

def _hardware_move_absolute(self, block_cancellation: bool = False, **kwargs: int): (source)

Make an absolute move. Keyword arguments should be axis names.

def _hardware_move_relative(self, block_cancellation: bool = False, **kwargs: int): (source)

Make a relative move. Keyword arguments should be axis names.

def _hardware_start_move_relative(self, displacement: Sequence[int]): (source)

Start a relative move.

This starts the stage moving, but does not wait for the move to complete. It sets self.moving to True: resetting it is the responsibility of the calling code.

def _hardware_update_position(self): (source)

Read position from the stage and set internal attribute _hardware_position.

_hardware_position should only be set in this function.

def _move_loop(self): (source)

Run the move loop. This should be run in a thread on enter.

This controls all movement of the dummy stage.

def _poll_moving(self) -> bool: (source)

Determine if the stage is still moving.

def _set_pos_during_move(self, displacement: Sequence[int], fraction_complete: float): (source)

Set the instantaneous position based on the completed fraction of an ongoing move.

_abort_move = (source)

Undocumented

_inst_pos_lock = (source)

Undocumented

_move_queue = (source)

Undocumented

_move_thread: threading.Thread | None = (source)

Undocumented

_movement_enabled: bool = (source)

Undocumented

_movement_ongoing: bool = (source)

Undocumented