修改添加step mode

This commit is contained in:
q434343
2026-02-06 15:12:56 +08:00
parent e4d915c59c
commit abf5555e37
3 changed files with 37 additions and 5 deletions

View File

@@ -1315,7 +1315,7 @@ class LiquidHandlerAbstract(LiquidHandlerMiddleware):
if len(sources) != len(targets): if len(sources) != len(targets):
raise ValueError(f"Length of `sources` {len(sources)} must match `targets` {len(targets)}.") raise ValueError(f"Length of `sources` {len(sources)} must match `targets` {len(targets)}.")
if len(use_channels) == 1: if len(use_channels) != 1:
for _ in range(len(targets)): for _ in range(len(targets)):
tip = [] tip = []
for ___ in range(len(use_channels)): for ___ in range(len(use_channels)):

View File

@@ -45,6 +45,7 @@ from pylabrobot.resources import (
Trash, Trash,
PlateAdapter, PlateAdapter,
TubeRack, TubeRack,
create_homogeneous_resources,
) )
from unilabos.devices.liquid_handling.liquid_handler_abstract import ( from unilabos.devices.liquid_handling.liquid_handler_abstract import (
@@ -55,7 +56,8 @@ from unilabos.devices.liquid_handling.liquid_handler_abstract import (
TransferLiquidReturn, TransferLiquidReturn,
) )
from unilabos.registry.placeholder_type import ResourceSlot from unilabos.registry.placeholder_type import ResourceSlot
from unilabos.ros.nodes.base_device_node import BaseROS2DeviceNode from unilabos.resources.itemized_carrier import ItemizedCarrier
from unilabos.ros.nodes.base_device_node import BaseROS2DeviceNode, ROS2DeviceNode
class PRCXIError(RuntimeError): class PRCXIError(RuntimeError):
@@ -925,7 +927,10 @@ class PRCXI9300Handler(LiquidHandlerAbstract):
delays: Optional[List[int]] = None, delays: Optional[List[int]] = None,
none_keys: List[str] = [], none_keys: List[str] = [],
) -> TransferLiquidReturn: ) -> TransferLiquidReturn:
return await super().transfer_liquid( if self.step_mode:
self._unilabos_backend.create_protocol(f"step_mode_protocol_{time.time()}")
res =await super().transfer_liquid(
sources, sources,
targets, targets,
tip_racks, tip_racks,
@@ -947,7 +952,33 @@ class PRCXI9300Handler(LiquidHandlerAbstract):
mix_liquid_height=mix_liquid_height, mix_liquid_height=mix_liquid_height,
delays=delays, delays=delays,
none_keys=none_keys, none_keys=none_keys,
) )
self._unilabos_backend.run_protocol()
return res
else:
return await super().transfer_liquid(
sources,
targets,
tip_racks,
use_channels=use_channels,
asp_vols=asp_vols,
dis_vols=dis_vols,
asp_flow_rates=asp_flow_rates,
dis_flow_rates=dis_flow_rates,
offsets=offsets,
touch_tip=touch_tip,
liquid_height=liquid_height,
blow_out_air_volume=blow_out_air_volume,
spread=spread,
is_96_well=is_96_well,
mix_stage=mix_stage,
mix_times=mix_times,
mix_vol=mix_vol,
mix_rate=mix_rate,
mix_liquid_height=mix_liquid_height,
delays=delays,
none_keys=none_keys,
)
async def custom_delay(self, seconds=0, msg=None): async def custom_delay(self, seconds=0, msg=None):
return await super().custom_delay(seconds, msg) return await super().custom_delay(seconds, msg)

View File

@@ -22,11 +22,12 @@
"host": "10.20.30.184", "host": "10.20.30.184",
"port": 9999, "port": 9999,
"debug": false, "debug": false,
"setup": false, "setup": true,
"is_9320": true, "is_9320": true,
"timeout": 10, "timeout": 10,
"matrix_id": "5de524d0-3f95-406c-86dd-f83626ebc7cb", "matrix_id": "5de524d0-3f95-406c-86dd-f83626ebc7cb",
"simulator": false, "simulator": false,
"step_mode": false,
"channel_num": 2 "channel_num": 2
}, },
"data": { "data": {