From d5b4f07406a4c3cc79008b58ca21083d89079f63 Mon Sep 17 00:00:00 2001 From: zhangshixiang <554662886@qq.com> Date: Thu, 22 Jan 2026 18:45:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9tube=5Frack=E7=9A=84=E5=88=9D?= =?UTF-8?q?=E5=A7=8B=E5=8C=96=EF=BC=8C=E4=BB=A5=E5=8F=8Amove=5Fplate?= =?UTF-8?q?=E6=96=B9=E6=B3=95=E5=87=BA=E7=8E=B0=E7=9A=84=E7=89=A9=E6=96=99?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- unilabos/devices/liquid_handling/prcxi/prcxi.py | 6 +++--- unilabos/ros/nodes/base_device_node.py | 2 ++ unilabos/test/experiments/prcxi_9320_with_res_test.json | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/unilabos/devices/liquid_handling/prcxi/prcxi.py b/unilabos/devices/liquid_handling/prcxi/prcxi.py index ba3ff6a..446d03c 100644 --- a/unilabos/devices/liquid_handling/prcxi/prcxi.py +++ b/unilabos/devices/liquid_handling/prcxi/prcxi.py @@ -364,8 +364,8 @@ class PRCXI9300TubeRack(TubeRack): def __init__(self, name: str, size_x: float, size_y: float, size_z: float, category: str = "tube_rack", items: Optional[Dict[str, Any]] = None, - ordered_items: Optional[OrderedDict] = None, - ordering: Optional[OrderedDict] = None, + ordered_items: collections.OrderedDict = None, + ordering: Optional[collections.OrderedDict] = None, model: Optional[str] = None, material_info: Optional[Dict[str, Any]] = None, **kwargs): @@ -380,7 +380,7 @@ class PRCXI9300TubeRack(TubeRack): # ordering 的值是字符串,这种情况下我们让 TubeRack 使用默认行为 # 不在初始化时创建 items,而是在 deserialize 后处理 items_to_pass = None - ordering_param = collections.OrderedDict() # 提供空的 ordering 来满足要求 + ordering_param = collections.OrderedDict((k, None) for k in ordering.keys()) # 提供空的 ordering 来满足要求 # 保存 ordering 信息以便后续处理 self._temp_ordering = ordering else: diff --git a/unilabos/ros/nodes/base_device_node.py b/unilabos/ros/nodes/base_device_node.py index c248882..d8e3f87 100644 --- a/unilabos/ros/nodes/base_device_node.py +++ b/unilabos/ros/nodes/base_device_node.py @@ -1468,6 +1468,8 @@ class BaseROS2DeviceNode(Node, Generic[T]): if isinstance(rs, list): for r in rs: res = self.resource_tracker.parent_resource(r) # 获取 resource 对象 + elif type(rs).__name__ == "ResourceHolder": + pass else: res = self.resource_tracker.parent_resource(rs) if id(res) not in seen: diff --git a/unilabos/test/experiments/prcxi_9320_with_res_test.json b/unilabos/test/experiments/prcxi_9320_with_res_test.json index bcb5b08..e7b18d9 100644 --- a/unilabos/test/experiments/prcxi_9320_with_res_test.json +++ b/unilabos/test/experiments/prcxi_9320_with_res_test.json @@ -16283,7 +16283,7 @@ "size_y": 85.8, "size_z": 42.66, "barcode": null, - "category": null, + "category": "tube_rack", "ordering": { "A1": "PlateT6_0_0", "A2": "PlateT6_1_0",