From 3e4299846f660fbf4613a79e1df1b9c39c93c7e6 Mon Sep 17 00:00:00 2001 From: Kenneth Yang Date: Fri, 5 Jul 2024 13:26:23 -0700 Subject: [PATCH] chore: build models --- models/csharp/EphysLinkModels.cs | 91 ++++++++----------- .../schemas/ephys_link/CanWriteRequest.json | 1 - ...DepthRequest.json => SetDepthRequest.json} | 2 +- ...pthResponse.json => SetDepthResponse.json} | 2 +- ...equest.json => SetInsideBrainRequest.json} | 2 +- ...onRequest.json => SetPositionRequest.json} | 2 +- 6 files changed, 42 insertions(+), 58 deletions(-) delete mode 100644 models/schemas/ephys_link/CanWriteRequest.json rename models/schemas/ephys_link/{DriveToDepthRequest.json => SetDepthRequest.json} (87%) rename models/schemas/ephys_link/{DriveToDepthResponse.json => SetDepthResponse.json} (82%) rename models/schemas/ephys_link/{InsideBrainRequest.json => SetInsideBrainRequest.json} (82%) rename models/schemas/ephys_link/{GotoPositionRequest.json => SetPositionRequest.json} (91%) diff --git a/models/csharp/EphysLinkModels.cs b/models/csharp/EphysLinkModels.cs index 0c6d3e3..039b30b 100644 --- a/models/csharp/EphysLinkModels.cs +++ b/models/csharp/EphysLinkModels.cs @@ -27,49 +27,6 @@ public BooleanStateResponse(bool state, string error) } } -[Serializable] -public struct CanWriteRequest -{ - public string ManipulatorId; - public bool CanWrite; - public float Hours; - - public CanWriteRequest(string manipulatorId, bool canWrite, float hours) - { - ManipulatorId = manipulatorId; - CanWrite = canWrite; - Hours = hours; - } -} - -[Serializable] -public struct DriveToDepthRequest -{ - public string ManipulatorId; - public float Depth; - public float Speed; - - public DriveToDepthRequest(string manipulatorId, float depth, float speed) - { - ManipulatorId = manipulatorId; - Depth = depth; - Speed = speed; - } -} - -[Serializable] -public struct DriveToDepthResponse -{ - public float Depth; - public string Error; - - public DriveToDepthResponse(float depth, string error) - { - Depth = depth; - Error = error; - } -} - [Serializable] public struct EphysLinkOptions { @@ -115,27 +72,53 @@ public GetManipulatorsResponse(string[] manipulators, int numAxes, Vector4 dimen [Serializable] -public struct GotoPositionRequest +public struct PositionalResponse { - public string ManipulatorId; public Vector4 Position; + public string Error; + + public PositionalResponse(Vector4 position, string error) + { + Position = position; + Error = error; + } +} + +[Serializable] +public struct SetDepthRequest +{ + public string ManipulatorId; + public float Depth; public float Speed; - public GotoPositionRequest(string manipulatorId, Vector4 position, float speed) + public SetDepthRequest(string manipulatorId, float depth, float speed) { ManipulatorId = manipulatorId; - Position = position; + Depth = depth; Speed = speed; } } [Serializable] -public struct InsideBrainRequest +public struct SetDepthResponse +{ + public float Depth; + public string Error; + + public SetDepthResponse(float depth, string error) + { + Depth = depth; + Error = error; + } +} + +[Serializable] +public struct SetInsideBrainRequest { public string ManipulatorId; public bool Inside; - public InsideBrainRequest(string manipulatorId, bool inside) + public SetInsideBrainRequest(string manipulatorId, bool inside) { ManipulatorId = manipulatorId; Inside = inside; @@ -144,15 +127,17 @@ public InsideBrainRequest(string manipulatorId, bool inside) [Serializable] -public struct PositionalResponse +public struct SetPositionRequest { + public string ManipulatorId; public Vector4 Position; - public string Error; + public float Speed; - public PositionalResponse(Vector4 position, string error) + public SetPositionRequest(string manipulatorId, Vector4 position, float speed) { + ManipulatorId = manipulatorId; Position = position; - Error = error; + Speed = speed; } } diff --git a/models/schemas/ephys_link/CanWriteRequest.json b/models/schemas/ephys_link/CanWriteRequest.json deleted file mode 100644 index 701b68a..0000000 --- a/models/schemas/ephys_link/CanWriteRequest.json +++ /dev/null @@ -1 +0,0 @@ -{"description": "Request format for setting can write state.\n\n:param manipulator_id: ID of the manipulator to move.\n:type manipulator_id: str\n:param can_write: Whether the manipulator can write.\n:type can_write: bool\n:param hours: Number of hours the manipulator can write for (0 = indefinitely).\n:type hours: float", "properties": {"ManipulatorId": {"minLength": 1, "title": "Manipulatorid", "type": "string"}, "CanWrite": {"title": "Canwrite", "type": "boolean"}, "Hours": {"minimum": 0.0, "title": "Hours", "type": "number"}}, "required": ["ManipulatorId", "CanWrite", "Hours"], "title": "CanWriteRequest", "type": "object"} \ No newline at end of file diff --git a/models/schemas/ephys_link/DriveToDepthRequest.json b/models/schemas/ephys_link/SetDepthRequest.json similarity index 87% rename from models/schemas/ephys_link/DriveToDepthRequest.json rename to models/schemas/ephys_link/SetDepthRequest.json index 7e83dbe..416afac 100644 --- a/models/schemas/ephys_link/DriveToDepthRequest.json +++ b/models/schemas/ephys_link/SetDepthRequest.json @@ -1 +1 @@ -{"description": "Request format for driving a manipulator to depth.\n\n:param manipulator_id: ID of the manipulator to move.\n:type manipulator_id: str\n:param depth: Depth to drive to in mm.\n:type depth: float\n:param speed: Speed to drive at in mm/s.\n:type speed: float", "properties": {"ManipulatorId": {"minLength": 1, "title": "Manipulatorid", "type": "string"}, "Depth": {"title": "Depth", "type": "number"}, "Speed": {"exclusiveMinimum": 0.0, "title": "Speed", "type": "number"}}, "required": ["ManipulatorId", "Depth", "Speed"], "title": "DriveToDepthRequest", "type": "object"} \ No newline at end of file +{"description": "Request format for driving a manipulator to depth.\n\n:param manipulator_id: ID of the manipulator to move.\n:type manipulator_id: str\n:param depth: Depth to drive to in mm.\n:type depth: float\n:param speed: Speed to drive at in mm/s.\n:type speed: float", "properties": {"ManipulatorId": {"minLength": 1, "title": "Manipulatorid", "type": "string"}, "Depth": {"title": "Depth", "type": "number"}, "Speed": {"exclusiveMinimum": 0.0, "title": "Speed", "type": "number"}}, "required": ["ManipulatorId", "Depth", "Speed"], "title": "SetDepthRequest", "type": "object"} \ No newline at end of file diff --git a/models/schemas/ephys_link/DriveToDepthResponse.json b/models/schemas/ephys_link/SetDepthResponse.json similarity index 82% rename from models/schemas/ephys_link/DriveToDepthResponse.json rename to models/schemas/ephys_link/SetDepthResponse.json index 41c7b6a..faa8703 100644 --- a/models/schemas/ephys_link/DriveToDepthResponse.json +++ b/models/schemas/ephys_link/SetDepthResponse.json @@ -1 +1 @@ -{"description": "Response format for driving a manipulator to depth.\n\n:param depth: Depth the manipulator is at in mm.\n:type depth: float\n:param error: Error message if any.\n:type error: str", "properties": {"Depth": {"default": 0, "title": "Depth", "type": "number"}, "Error": {"default": "", "title": "Error", "type": "string"}}, "title": "DriveToDepthResponse", "type": "object"} \ No newline at end of file +{"description": "Response format for driving a manipulator to depth.\n\n:param depth: Depth the manipulator is at in mm.\n:type depth: float\n:param error: Error message if any.\n:type error: str", "properties": {"Depth": {"default": 0, "title": "Depth", "type": "number"}, "Error": {"default": "", "title": "Error", "type": "string"}}, "title": "SetDepthResponse", "type": "object"} \ No newline at end of file diff --git a/models/schemas/ephys_link/InsideBrainRequest.json b/models/schemas/ephys_link/SetInsideBrainRequest.json similarity index 82% rename from models/schemas/ephys_link/InsideBrainRequest.json rename to models/schemas/ephys_link/SetInsideBrainRequest.json index 475fd59..d753a0f 100644 --- a/models/schemas/ephys_link/InsideBrainRequest.json +++ b/models/schemas/ephys_link/SetInsideBrainRequest.json @@ -1 +1 @@ -{"description": "Request format for setting inside brain state.\n\n:param manipulator_id: ID of the manipulator to move.\n:type manipulator_id: str\n:param inside: Whether the manipulator is inside the brain.\n:type inside: bool", "properties": {"ManipulatorId": {"minLength": 1, "title": "Manipulatorid", "type": "string"}, "Inside": {"title": "Inside", "type": "boolean"}}, "required": ["ManipulatorId", "Inside"], "title": "InsideBrainRequest", "type": "object"} \ No newline at end of file +{"description": "Request format for setting inside brain state.\n\n:param manipulator_id: ID of the manipulator to move.\n:type manipulator_id: str\n:param inside: Whether the manipulator is inside the brain.\n:type inside: bool", "properties": {"ManipulatorId": {"minLength": 1, "title": "Manipulatorid", "type": "string"}, "Inside": {"title": "Inside", "type": "boolean"}}, "required": ["ManipulatorId", "Inside"], "title": "SetInsideBrainRequest", "type": "object"} \ No newline at end of file diff --git a/models/schemas/ephys_link/GotoPositionRequest.json b/models/schemas/ephys_link/SetPositionRequest.json similarity index 91% rename from models/schemas/ephys_link/GotoPositionRequest.json rename to models/schemas/ephys_link/SetPositionRequest.json index 283121a..5de4f81 100644 --- a/models/schemas/ephys_link/GotoPositionRequest.json +++ b/models/schemas/ephys_link/SetPositionRequest.json @@ -1 +1 @@ -{"$defs": {"Vector4": {"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": "Request format for moving a manipulator to a position.\n\n:param manipulator_id: ID of the manipulator to move.\n:type manipulator_id: str\n:param position: Position to move to in mm (X, Y, Z, W).\n:type position: Vector4\n:param speed: Speed to move at in mm/s.\n:type speed: float", "properties": {"ManipulatorId": {"minLength": 1, "title": "Manipulatorid", "type": "string"}, "Position": {"$ref": "#/$defs/Vector4"}, "Speed": {"exclusiveMinimum": 0.0, "title": "Speed", "type": "number"}}, "required": ["ManipulatorId", "Position", "Speed"], "title": "GotoPositionRequest", "type": "object"} \ No newline at end of file +{"$defs": {"Vector4": {"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": "Request format for moving a manipulator to a position.\n\n:param manipulator_id: ID of the manipulator to move.\n:type manipulator_id: str\n:param position: Position to move to in mm (X, Y, Z, W).\n:type position: Vector4\n:param speed: Speed to move at in mm/s.\n:type speed: float", "properties": {"ManipulatorId": {"minLength": 1, "title": "Manipulatorid", "type": "string"}, "Position": {"$ref": "#/$defs/Vector4"}, "Speed": {"exclusiveMinimum": 0.0, "title": "Speed", "type": "number"}}, "required": ["ManipulatorId", "Position", "Speed"], "title": "SetPositionRequest", "type": "object"} \ No newline at end of file