ephys_link.platforms.new_scale_manipulator
New Scale Manipulator class
Handles logic for calling New Scale API functions. Also includes extra logic for safe
function calls, error handling, managing per-manipulator attributes, and returning the
appropriate callback parameters like in ephys_link.new_scale_handler
.
Classes
- class NewScaleManipulator(manipulator_id: str, x_axis: NstCtrlAxis, y_axis: NstCtrlAxis, z_axis: NstCtrlAxis)[source]
Bases:
PlatformManipulator
- get_pos() PositionalOutputData [source]
Get the current position of the manipulator and convert it into mm.
- Returns:
Position of manipulator in (x, y, z, z) in mm (or an empty array on error) and error message (if any).
- Return type:
- async goto_pos(position: list[float], speed: float) PositionalOutputData [source]
Move manipulator to position.
- Parameters:
position (list[float]) – The position to move to in mm.
speed (float) – The speed to move at (in mm/s).
- Returns:
Resulting position of manipulator in (x, y, z, z) in mm (or an empty array on error) and error message (if any).
- Return type:
- async drive_to_depth(depth: float, speed: float) DriveToDepthOutputData [source]
Drive the manipulator to a certain depth.
- Parameters:
depth (float) – The depth to drive to in mm.
speed (float) – The speed to drive at in mm/s.
- Returns:
Resulting depth of manipulator in mm (or 0 on error) and error message (if any).
- Return type:
- get_calibrated() bool [source]
Return the calibration state of the manipulator.
- Returns:
True if the manipulator is calibrated, False otherwise.
- Return type:
bool
- set_can_write(can_write: bool, hours: float, sio: socketio.AsyncServer) None [source]
Set if the manipulator can move.
- Parameters:
can_write (bool) – True if the manipulator can move, False otherwise.
hours (float) – The number of hours to allow the manipulator to move (0 = forever).
sio (
socketio.AsyncServer
) – SocketIO object from server to emit reset event.
- Returns:
None
- get_can_write() bool [source]
Return if the manipulator can move.
- Returns:
True if the manipulator can move, False otherwise.
- Return type:
bool
- reset_can_write(sio: socketio.AsyncServer) None [source]
Reset the
can_write
flag.- Parameters:
sio (
socketio.AsyncServer
) – SocketIO object from server to emit reset event.- Returns:
None