mirror of
https://github.com/dptech-corp/Uni-Lab-OS.git
synced 2026-02-04 13:25:13 +00:00
feat(bioyond): 添加调度器启动功能,支持任务队列执行并处理异常
This commit is contained in:
@@ -1299,6 +1299,21 @@ class BioyondDispensingStation(BioyondWorkstation):
|
||||
'actualVolume': actual_volume
|
||||
}
|
||||
|
||||
def scheduler_start(self) -> dict:
|
||||
"""启动调度器 - 启动Bioyond工作站的任务调度器,开始执行队列中的任务
|
||||
|
||||
Returns:
|
||||
dict: 包含return_info的字典,return_info为整型(1=成功, 0=失败)
|
||||
"""
|
||||
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)}"
|
||||
self.hardware_interface._logger.error(error_msg)
|
||||
return {"return_info": 0, "error": error_msg}
|
||||
|
||||
# 等待多个任务完成并获取实验报告
|
||||
def wait_for_multiple_orders_and_get_reports(self,
|
||||
batch_create_result: str = None,
|
||||
|
||||
@@ -97,6 +97,21 @@ class BioyondReactionStation(BioyondWorkstation):
|
||||
print(f"当前队列长度: {len(self.pending_task_params)}")
|
||||
return json.dumps({"suc": True})
|
||||
|
||||
def scheduler_start(self) -> dict:
|
||||
"""启动调度器 - 启动Bioyond工作站的任务调度器,开始执行队列中的任务
|
||||
|
||||
Returns:
|
||||
dict: 包含return_info的字典,return_info为整型(1=成功, 0=失败)
|
||||
"""
|
||||
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)}"
|
||||
self.hardware_interface._logger.error(error_msg)
|
||||
return {"return_info": 0, "error": error_msg}
|
||||
|
||||
def reactor_taken_in(
|
||||
self,
|
||||
assign_material_name: str,
|
||||
|
||||
Reference in New Issue
Block a user