From 5e7cbdb29b6e46b3cfe428fe9c1e7f34b50e79f5 Mon Sep 17 00:00:00 2001 From: Kenneth Yang Date: Tue, 10 Oct 2023 12:14:11 -0700 Subject: [PATCH] Reformat, set pathfinder to -1 --- src/ephys_link/common.py | 9 +++++++-- src/ephys_link/platform_handler.py | 4 +++- src/ephys_link/platforms/new_scale_handler.py | 8 ++++++-- .../platforms/new_scale_pathfinder_handler.py | 12 +++++++++++- 4 files changed, 27 insertions(+), 6 deletions(-) diff --git a/src/ephys_link/common.py b/src/ephys_link/common.py index 9ba245c..162a8db 100644 --- a/src/ephys_link/common.py +++ b/src/ephys_link/common.py @@ -81,10 +81,15 @@ class GetManipulatorsOutputData(dict): :code:`{"manipulators": ["1", "2"], "error": ""}` """ - def __init__(self, manipulators: list, num_axes: int, dimensions: list, error: str) -> None: + def __init__( + self, manipulators: list, num_axes: int, dimensions: list, error: str + ) -> None: """Constructor""" super(GetManipulatorsOutputData, self).__init__( - manipulators=manipulators, num_axes=num_axes, dimensions=dimensions, error=error + manipulators=manipulators, + num_axes=num_axes, + dimensions=dimensions, + error=error, ) diff --git a/src/ephys_link/platform_handler.py b/src/ephys_link/platform_handler.py index 183cba7..b8185da 100644 --- a/src/ephys_link/platform_handler.py +++ b/src/ephys_link/platform_handler.py @@ -76,7 +76,9 @@ def get_manipulators(self) -> com.GetManipulatorsOutputData: except Exception as e: print(f"[ERROR]\t\t Getting manipulators: {type(e)}: {e}\n") finally: - return com.GetManipulatorsOutputData(devices, self.num_axes, self.dimensions, error) + return com.GetManipulatorsOutputData( + devices, self.num_axes, self.dimensions, error + ) def register_manipulator(self, manipulator_id: str) -> str: """Register a manipulator diff --git a/src/ephys_link/platforms/new_scale_handler.py b/src/ephys_link/platforms/new_scale_handler.py index db22825..7f3d55c 100644 --- a/src/ephys_link/platforms/new_scale_handler.py +++ b/src/ephys_link/platforms/new_scale_handler.py @@ -122,7 +122,9 @@ def _set_can_write( ) return com.StateOutputData(can_write, "") - def _platform_space_to_unified_space(self, platform_position: list[float]) -> list[float]: + def _platform_space_to_unified_space( + self, platform_position: list[float] + ) -> list[float]: # unified <- platform # +x <- -x # +y <- +z @@ -136,7 +138,9 @@ def _platform_space_to_unified_space(self, platform_position: list[float]) -> li self.dimensions[3] - platform_position[3], ] - def _unified_space_to_platform_space(self, unified_position: list[float]) -> list[float]: + def _unified_space_to_platform_space( + self, unified_position: list[float] + ) -> list[float]: # platform <- unified # +x <- -x # +y <- +z diff --git a/src/ephys_link/platforms/new_scale_pathfinder_handler.py b/src/ephys_link/platforms/new_scale_pathfinder_handler.py index be620d1..c622869 100644 --- a/src/ephys_link/platforms/new_scale_pathfinder_handler.py +++ b/src/ephys_link/platforms/new_scale_pathfinder_handler.py @@ -71,7 +71,7 @@ def __init__(self, port: int = 8080) -> None: """ super().__init__() - self.type = "new_scale_pathfinder" + self.num_axes = -1 self.port = port @@ -219,3 +219,13 @@ def _set_can_write( sio: socketio.AsyncServer, ) -> com.StateOutputData: pass + + def _unified_space_to_platform_space( + self, unified_position: list[float] + ) -> list[float]: + pass + + def _platform_space_to_unified_space( + self, platform_position: list[float] + ) -> list[float]: + pass