Skip to content

Commit c8b8db3

Browse files
authored
feat: Platform Info model (#67)
1 parent e82bb0f commit c8b8db3

File tree

5 files changed

+37
-16
lines changed

5 files changed

+37
-16
lines changed

models/csharp/EphysLinkModels.cs

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -65,21 +65,29 @@ string serial
6565
public struct GetManipulatorsResponse
6666
{
6767
public string[] Manipulators;
68-
public int NumAxes;
69-
public Vector4 Dimensions;
7068
public string Error;
7169

72-
public GetManipulatorsResponse(
73-
string[] manipulators,
74-
int numAxes,
75-
Vector4 dimensions,
76-
string error
77-
)
70+
public GetManipulatorsResponse(string[] manipulators, string error)
7871
{
7972
Manipulators = manipulators;
73+
Error = error;
74+
}
75+
}
76+
77+
[Serializable]
78+
public struct PlatformInfo
79+
{
80+
public string Name;
81+
public string CliName;
82+
public int NumAxes;
83+
public Vector4 Dimensions;
84+
85+
public PlatformInfo(string name, string cliName, int numAxes, Vector4 dimensions)
86+
{
87+
Name = name;
88+
CliName = cliName;
8089
NumAxes = numAxes;
8190
Dimensions = dimensions;
82-
Error = error;
8391
}
8492
}
8593

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"$defs": {"Vector4": {"description": "4D vector.\n\nAttributes:\n x: X component.\n y: Y component.\n z: Z component.\n w: W component.", "properties": {"x": {"default": 0.0, "title": "X", "type": "number"}, "y": {"default": 0.0, "title": "Y", "type": "number"}, "z": {"default": 0.0, "title": "Z", "type": "number"}, "w": {"default": 0.0, "title": "W", "type": "number"}}, "title": "Vector4", "type": "object"}}, "description": "Response format for requesting available manipulators.\n\nAttributes:\n manipulators: List of manipulators.\n num_axes: Number of axes for the manipulators.\n dimensions: Dimensions of the manipulators (3-axis manipulators should set w to 0).\n error: Error message if any.", "properties": {"Manipulators": {"items": {"type": "string"}, "title": "Manipulators", "type": "array"}, "NumAxes": {"default": 0, "minimum": -1, "title": "Numaxes", "type": "integer"}, "Dimensions": {"$ref": "#/$defs/Vector4", "default": {"x": 0.0, "y": 0.0, "z": 0.0, "w": 0.0}}, "Error": {"default": "", "title": "Error", "type": "string"}}, "title": "GetManipulatorsResponse", "type": "object"}
1+
{"description": "Response format for requesting available manipulators.\n\nAttributes:\n manipulators: List of manipulators by ID.\n error: Error message if any.", "properties": {"Manipulators": {"items": {"type": "string"}, "title": "Manipulators", "type": "array"}, "Error": {"default": "", "title": "Error", "type": "string"}}, "title": "GetManipulatorsResponse", "type": "object"}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"$defs": {"Vector4": {"description": "4D vector.\n\nAttributes:\n x: X component.\n y: Y component.\n z: Z component.\n w: W component.", "properties": {"x": {"default": 0.0, "title": "X", "type": "number"}, "y": {"default": 0.0, "title": "Y", "type": "number"}, "z": {"default": 0.0, "title": "Z", "type": "number"}, "w": {"default": 0.0, "title": "W", "type": "number"}}, "title": "Vector4", "type": "object"}}, "description": "Information about the manipulator platform.\n\nAttributes:\n name: Name of the manipulator platform.\n cli_name: CLI identifier for the manipulator platform (for the `-t` flag).\n num_axes: Number of axes on a manipulator.\n dimensions: Dimensions of the manipulators (3-axis manipulators should set w to 0).", "properties": {"Name": {"minLength": 1, "title": "Name", "type": "string"}, "CliName": {"minLength": 1, "title": "Cliname", "type": "string"}, "NumAxes": {"default": 0, "minimum": -1, "title": "Numaxes", "type": "integer"}, "Dimensions": {"$ref": "#/$defs/Vector4", "default": {"x": 0.0, "y": 0.0, "z": 0.0, "w": 0.0}}}, "required": ["Name", "CliName"], "title": "PlatformInfo", "type": "object"}

src/vbl_aquarium/__about__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "1.0.0b1"
1+
__version__ = "1.0.0b2"

src/vbl_aquarium/models/ephys_link.py

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,22 @@ class EphysLinkOptions(VBLBaseModel):
3535
serial: str = "no-e-stop"
3636

3737

38+
class PlatformInfo(VBLBaseModel):
39+
"""Information about the manipulator platform.
40+
41+
Attributes:
42+
name: Name of the manipulator platform.
43+
cli_name: CLI identifier for the manipulator platform (for the `-t` flag).
44+
num_axes: Number of axes on a manipulator.
45+
dimensions: Dimensions of the manipulators (3-axis manipulators should set w to 0).
46+
"""
47+
48+
name: str = Field(min_length=1)
49+
cli_name: str = Field(min_length=1)
50+
num_axes: int = Field(default=0, ge=-1)
51+
dimensions: Vector4 = Vector4()
52+
53+
3854
class SetPositionRequest(VBLBaseModel):
3955
"""Request format for moving a manipulator to a position.
4056
@@ -79,16 +95,12 @@ class GetManipulatorsResponse(VBLBaseModel):
7995
"""Response format for requesting available manipulators.
8096
8197
Attributes:
82-
manipulators: List of manipulators.
83-
num_axes: Number of axes for the manipulators.
84-
dimensions: Dimensions of the manipulators (3-axis manipulators should set w to 0).
98+
manipulators: List of manipulators by ID.
8599
error: Error message if any.
86100
"""
87101

88102
# noinspection PyDataclass
89103
manipulators: list[str] = Field(default_factory=list)
90-
num_axes: int = Field(default=0, ge=-1)
91-
dimensions: Vector4 = Vector4()
92104
error: str = ""
93105

94106

0 commit comments

Comments
 (0)