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": {