From dbe129caabe1eab91488d82d9d74b142cfda807c Mon Sep 17 00:00:00 2001 From: ZiWei <131428629+ZiWei09@users.noreply.github.com> Date: Wed, 26 Nov 2025 16:32:10 +0800 Subject: [PATCH] =?UTF-8?q?feat(bioyond):=20=E4=BC=98=E5=8C=96=E8=B0=83?= =?UTF-8?q?=E5=BA=A6=E5=99=A8=E5=90=AF=E5=8A=A8=E5=8A=9F=E8=83=BD=EF=BC=8C?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=BC=82=E5=B8=B8=E5=A4=84=E7=90=86=E5=B9=B6?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=9B=B8=E5=85=B3=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bioyond_studio/dispensing_station.py | 20 ++++++++----- .../bioyond_studio/reaction_station.py | 22 +++++++++----- .../devices/bioyond_dispensing_station.yaml | 29 +++++++++++++++++++ .../devices/reaction_station_bioyond.yaml | 29 +++++++++++++++++++ .../experiments/reaction_station_bioyond.json | 7 +++-- 5 files changed, 89 insertions(+), 18 deletions(-) diff --git a/unilabos/devices/workstation/bioyond_studio/dispensing_station.py b/unilabos/devices/workstation/bioyond_studio/dispensing_station.py index 18237a5..8557992 100644 --- a/unilabos/devices/workstation/bioyond_studio/dispensing_station.py +++ b/unilabos/devices/workstation/bioyond_studio/dispensing_station.py @@ -1303,16 +1303,20 @@ class BioyondDispensingStation(BioyondWorkstation): """启动调度器 - 启动Bioyond工作站的任务调度器,开始执行队列中的任务 Returns: - dict: 包含return_info的字典,return_info为整型(1=成功, 0=失败) + dict: 包含return_info的字典,return_info为整型(1=成功) + + Raises: + BioyondException: 调度器启动失败时抛出异常 """ - try: - result = self.hardware_interface.scheduler_start() - self.hardware_interface._logger.info(f"调度器启动结果: {result}") - return {"return_info": result} - except Exception as e: - error_msg = f"启动调度器失败: {str(e)}" + result = self.hardware_interface.scheduler_start() + self.hardware_interface._logger.info(f"调度器启动结果: {result}") + + if result != 1: + error_msg = "启动调度器失败: 有未处理错误,调度无法启动。请检查Bioyond系统状态。" self.hardware_interface._logger.error(error_msg) - return {"return_info": 0, "error": error_msg} + raise BioyondException(error_msg) + + return {"return_info": result} # 等待多个任务完成并获取实验报告 def wait_for_multiple_orders_and_get_reports(self, diff --git a/unilabos/devices/workstation/bioyond_studio/reaction_station.py b/unilabos/devices/workstation/bioyond_studio/reaction_station.py index bea8572..8e386a9 100644 --- a/unilabos/devices/workstation/bioyond_studio/reaction_station.py +++ b/unilabos/devices/workstation/bioyond_studio/reaction_station.py @@ -101,16 +101,22 @@ class BioyondReactionStation(BioyondWorkstation): """启动调度器 - 启动Bioyond工作站的任务调度器,开始执行队列中的任务 Returns: - dict: 包含return_info的字典,return_info为整型(1=成功, 0=失败) + dict: 包含return_info的字典,return_info为整型(1=成功) + + Raises: + BioyondException: 调度器启动失败时抛出异常 """ - try: - result = self.hardware_interface.scheduler_start() - self.hardware_interface._logger.info(f"调度器启动结果: {result}") - return {"return_info": result} - except Exception as e: - error_msg = f"启动调度器失败: {str(e)}" + from unilabos.devices.workstation.bioyond_studio.bioyond_rpc import BioyondException + + result = self.hardware_interface.scheduler_start() + self.hardware_interface._logger.info(f"调度器启动结果: {result}") + + if result != 1: + error_msg = "启动调度器失败: 有未处理错误,调度无法启动。请检查Bioyond系统状态。" self.hardware_interface._logger.error(error_msg) - return {"return_info": 0, "error": error_msg} + raise BioyondException(error_msg) + + return {"return_info": result} def reactor_taken_in( self, diff --git a/unilabos/registry/devices/bioyond_dispensing_station.yaml b/unilabos/registry/devices/bioyond_dispensing_station.yaml index 5ebad38..b3c6f98 100644 --- a/unilabos/registry/devices/bioyond_dispensing_station.yaml +++ b/unilabos/registry/devices/bioyond_dispensing_station.yaml @@ -519,6 +519,35 @@ bioyond_dispensing_station: title: DispenStationSolnPrep type: object type: DispenStationSolnPrep + scheduler_start: + feedback: {} + goal: {} + goal_default: {} + handles: {} + result: + return_info: return_info + schema: + description: 启动调度器 - 启动Bioyond配液站的任务调度器,开始执行队列中的任务 + properties: + feedback: {} + goal: + properties: {} + required: [] + type: object + result: + properties: + return_info: + description: 调度器启动结果,成功返回1,失败返回0 + type: integer + required: + - return_info + title: scheduler_start结果 + type: object + required: + - goal + title: scheduler_start参数 + type: object + type: UniLabJsonCommand transfer_materials_to_reaction_station: feedback: {} goal: diff --git a/unilabos/registry/devices/reaction_station_bioyond.yaml b/unilabos/registry/devices/reaction_station_bioyond.yaml index 84bcf4a..aee7844 100644 --- a/unilabos/registry/devices/reaction_station_bioyond.yaml +++ b/unilabos/registry/devices/reaction_station_bioyond.yaml @@ -471,6 +471,35 @@ reaction_station.bioyond: title: reactor_taken_out参数 type: object type: UniLabJsonCommand + scheduler_start: + feedback: {} + goal: {} + goal_default: {} + handles: {} + result: + return_info: return_info + schema: + description: 启动调度器 - 启动Bioyond工作站的任务调度器,开始执行队列中的任务 + properties: + feedback: {} + goal: + properties: {} + required: [] + type: object + result: + properties: + return_info: + description: 调度器启动结果,成功返回1,失败返回0 + type: integer + required: + - return_info + title: scheduler_start结果 + type: object + required: + - goal + title: scheduler_start参数 + type: object + type: UniLabJsonCommand solid_feeding_vials: feedback: {} goal: diff --git a/unilabos/test/experiments/reaction_station_bioyond.json b/unilabos/test/experiments/reaction_station_bioyond.json index bfb1c8a..dc3d89f 100644 --- a/unilabos/test/experiments/reaction_station_bioyond.json +++ b/unilabos/test/experiments/reaction_station_bioyond.json @@ -16,7 +16,7 @@ "class": "reaction_station.bioyond", "position": { "x": 0, - "y": 0, + "y": 1100, "z": 0 }, "config": { @@ -74,6 +74,9 @@ "_resource_type": "unilabos.resources.bioyond.decks:BIOYOND_PolymerReactionStation_Deck" } }, + "size_x": 2700.0, + "size_y": 1080.0, + "size_z": 2000.0, "protocol_type": [] }, "data": {} @@ -162,7 +165,7 @@ "class": "BIOYOND_PolymerReactionStation_Deck", "position": { "x": 0, - "y": 3800, + "y": 1100, "z": 0 }, "config": {