class documentation

A Thing to manage a Sangaboard motor controller.

Internally, this uses the pysangaboard package from PyPi. This imports as sangaboard. As pysangaboard does not support some features added to the Sangaboard firmware v1 (LED flashing, aborting moves, etc) this functionality is accessed by directly querying the serial interface.

Method __enter__ Connect to the sangaboard when the Thing context manager is opened.
Method __exit__ Close the sangaboard connection when the Thing context manager is closed.
Method __init__ Initialise SangaboardThing.
Method flash_led Flash the LED to identify the board.
Method sangaboard Return the wrapped sangaboard.Sangaboard instance.
Method set_zero_position Make the current position zero in all axes.
Method update_position Read position from the stage and set the corresponding property.
Instance Variable axis_inverted Used to convert coordinates between the program frame and the hardware frame.
Instance Variable moving Whether the stage is in motion.
Instance Variable sangaboard_kwargs Undocumented
Method _hardware_move_absolute Make a absolute move in the coordinate system used by the sangaboard.
Method _hardware_move_relative Make a relative move in the coordinate system used by the sangaboard.
Instance Variable _hardware_position Undocumented
Instance Variable _sangaboard Undocumented
Instance Variable _sangaboard_lock 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 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.
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
Class Variable _axis_names Undocumented
def __enter__(self): (source)

Connect to the sangaboard when the Thing context manager is opened.

def __exit__(self, _exc_type, _exc_value, _traceback): (source)

Close the sangaboard connection when the Thing context manager is closed.

def __init__(self, port: str = None, **kwargs): (source)

Initialise SangaboardThing.

Initialise the "Thing", but do not initialise an underlying Sangaboard object from pysangaboard until the Thing context manager is started.

Parameters
port:strThe serial port for the Sangaboard. Optional, this is used to stop the Sangaboard object querying available devices.
**kwargsAny other keyword arguments to be passed to the Sangaboard class
@lt.thing_action
def flash_led(self, number_of_flashes: int = 10, dt: float = 0.5, led_channel: Literal['cc'] = 'cc'): (source)

Flash the LED to identify the board.

This is intended to be useful in situations where there are multiple Sangaboards in use, and it is necessary to identify which one is being addressed.

@contextmanager
def sangaboard(self) -> Iterator[sangaboard.Sangaboard]: (source)

Return the wrapped sangaboard.Sangaboard instance.

This is protected by a threading.RLock, which may change in future.

@lt.thing_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.

def update_position(self): (source)

Read position from the stage and set the corresponding property.

axis_inverted = (source)

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

moving: bool = (source)

Whether the stage is in motion.

sangaboard_kwargs = (source)

Undocumented

def _hardware_move_absolute(self, cancel: lt.deps.CancelHook, block_cancellation: bool = False, **kwargs: Mapping[str, int]): (source)

Make a absolute move in the coordinate system used by the sangaboard.

def _hardware_move_relative(self, cancel: lt.deps.CancelHook, block_cancellation: bool = False, **kwargs: Mapping[str, int]): (source)

Make a relative move in the coordinate system used by the sangaboard.

_sangaboard = (source)

Undocumented

_sangaboard_lock = (source)

Undocumented