ephys_link.common

Commonly used functions and dictionaries

Contains globally used helper functions and typed dictionaries (to be used as callback parameters)

Functions

dprint

Print message if debug is enabled

set_debug

Set debug flag

Classes

AngularOutputData

Output format for (angles, error)

CanWriteInputDataFormat

Data format for server.set_can_write()

DriveToDepthInputDataFormat

Data format for server.drive_to_depth()

DriveToDepthOutputData

Output format for depth driving (depth, error)

GetManipulatorsOutputData

Output format for (manipulators)

GotoPositionInputDataFormat

Data format for server.goto_pos()

InsideBrainInputDataFormat

Data format for server.set_inside_brain()

PositionalOutputData

Output format for (position, error)

StateOutputData

Output format for (state, error)

set_debug(debug: bool) None[source]

Set debug flag

Parameters:

debug (bool) – True to enable debug mode, False to disable

Returns:

None

dprint(message: str) None[source]

Print message if debug is enabled

Parameters:

message (str) – Message to print

Returns:

None

class GotoPositionInputDataFormat[source]

Bases: TypedDict

Data format for server.goto_pos()

manipulator_id: str
pos: list[float]
speed: int
class InsideBrainInputDataFormat[source]

Bases: TypedDict

Data format for server.set_inside_brain()

manipulator_id: str
inside: bool
class DriveToDepthInputDataFormat[source]

Bases: TypedDict

Data format for server.drive_to_depth()

manipulator_id: str
depth: float
speed: int
class CanWriteInputDataFormat[source]

Bases: TypedDict

Data format for server.set_can_write()

manipulator_id: str
can_write: bool
hours: float
class GetManipulatorsOutputData(manipulators: list, manipulator_type: str, error: str)[source]

Bases: dict

Output format for (manipulators)

Parameters:
  • manipulators (list) – Tuple of manipulator IDs (as strings)

  • manipulator_type (str) – Type of the output data (temporary solution until #165 is implemented)

  • error (str) – Error message

Example:

Example generated dictionary {"manipulators": ["1", "2"], "error": ""}

class PositionalOutputData(position: list, error: str)[source]

Bases: dict

Output format for (position, error)

Parameters:
  • position (list) – Position in mm (as a tuple, can be empty) in X, Y, Z, W order

  • error (str) – Error message

Example:

Example generated dictionary {"position": [10.429, 12.332, 2.131, 12.312], "error": ""}

class AngularOutputData(angles: list, error: str)[source]

Bases: dict

Output format for (angles, error)

Parameters:
  • angles (list) – Angles in degrees (as a tuple, can be empty) in yaw, pitch, roll order

  • error (str) – Error message

class DriveToDepthOutputData(depth: float, error: str)[source]

Bases: dict

Output format for depth driving (depth, error)

Parameters:
  • depth (float) – Depth in mm

  • error (str) – Error message

Example:

Example generated dictionary {"depth": 0.123, "error": ""}

class StateOutputData(state: bool, error: str)[source]

Bases: dict

Output format for (state, error)

Parameters:
  • state (bool) – State of the event

  • error (str) – Error message

Example:

Example generated dictionary {"state": True, "error": ""}