对laiyu移液站进行部分修改,取消多次初始化的问题

This commit is contained in:
zhangshixiang
2025-12-10 15:10:15 +08:00
parent 0d150f7acd
commit 896f287d92
3 changed files with 49 additions and 8 deletions

View File

@@ -128,6 +128,7 @@ class PipetteController:
baudrate=115200
)
self.pipette = SOPAPipette(self.config)
self.pipette_port = port
self.tip_status = TipStatus.NO_TIP
self.current_volume = 0.0
self.max_volume = 1000.0 # 默认1000ul
@@ -154,7 +155,7 @@ class PipetteController:
logger.info("移液器连接成功")
# 连接XYZ步进电机控制器如果提供了端口
if self.xyz_port:
if self.xyz_port != self.pipette_port:
try:
self.xyz_controller = XYZController(self.xyz_port)
if self.xyz_controller.connect():
@@ -168,7 +169,12 @@ class PipetteController:
self.xyz_controller = None
self.xyz_connected = False
else:
logger.info("未配置XYZ步进电机端口跳过运动控制器连接")
try:
self.xyz_controller = XYZController(self.xyz_port, auto_connect=False)
self.xyz_controller.serial_conn = self.pipette.serial_port
self.xyz_controller.is_connected = True
except Exception as e:
logger.info("未配置XYZ步进电机端口跳过运动控制器连接")
return True
except Exception as e: