From 0bd3025d73dd8235a6d785f1fe626a8217ab65f2 Mon Sep 17 00:00:00 2001 From: Xuwznln <18435084+Xuwznln@users.noreply.github.com> Date: Fri, 18 Jul 2025 02:38:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9Eset=20liquid=E6=96=B9?= =?UTF-8?q?=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../liquid_handler_abstract.py | 5 +++ .../devices/liquid_handling/prcxi/prcxi.py | 3 ++ unilabos/registry/devices/liquid_handler.yaml | 40 +++++++++++++++++++ .../action/LiquidHandlerSetLiquid.action | 6 +++ 4 files changed, 54 insertions(+) create mode 100644 unilabos_msgs/action/LiquidHandlerSetLiquid.action diff --git a/unilabos/devices/liquid_handling/liquid_handler_abstract.py b/unilabos/devices/liquid_handling/liquid_handler_abstract.py index b11c008..d7de9db 100644 --- a/unilabos/devices/liquid_handling/liquid_handler_abstract.py +++ b/unilabos/devices/liquid_handling/liquid_handler_abstract.py @@ -543,6 +543,11 @@ class LiquidHandlerAbstract(LiquidHandlerMiddleware): self._simulator = simulator super().__init__(backend, deck, simulator, channel_num) + @classmethod + def set_liquid(self, wells: list[Well], liquid_names: list[str], volumes: list[float]): + """Set the liquid in a well.""" + for well, liquid_name, volume in zip(wells, liquid_names, volumes): + well.set_liquids([(liquid_name, volume)]) # type: ignore # --------------------------------------------------------------- # REMOVE LIQUID -------------------------------------------------- # --------------------------------------------------------------- diff --git a/unilabos/devices/liquid_handling/prcxi/prcxi.py b/unilabos/devices/liquid_handling/prcxi/prcxi.py index 1a61306..00b2972 100644 --- a/unilabos/devices/liquid_handling/prcxi/prcxi.py +++ b/unilabos/devices/liquid_handling/prcxi/prcxi.py @@ -132,6 +132,9 @@ class PRCXI9300Handler(LiquidHandlerAbstract): self._unilabos_backend = PRCXI9300Backend(tablets_info, host, port, timeout, channel_num, axis, setup, debug, matrix_id) super().__init__(backend=self._unilabos_backend, deck=deck, simulator=True, channel_num=channel_num) + def set_liquid(self, wells: list[Well], liquid_names: list[str], volumes: list[float]): + return super().set_liquid(wells, liquid_names, volumes) + async def create_protocol( self, protocol_name: str = "", diff --git a/unilabos/registry/devices/liquid_handler.yaml b/unilabos/registry/devices/liquid_handler.yaml index 99380aa..a33635c 100644 --- a/unilabos/registry/devices/liquid_handler.yaml +++ b/unilabos/registry/devices/liquid_handler.yaml @@ -6841,6 +6841,46 @@ liquid_handler.prcxi: title: LiquidHandlerPickUpTips type: object type: LiquidHandlerPickUpTips + set_liquid: + feedback: {} + goal: {} + goal_default: + liquid_names: [] + volumes: [] + wells: [] + handles: [] + placeholder_keys: + wells: unilabos_resources + result: {} + schema: + description: '' + properties: + feedback: {} + goal: + properties: + liquid_names: + items: + type: string + type: array + volumes: + items: + type: number + type: array + wells: + items: + type: object + type: array + required: + - wells + - liquid_names + - volumes + type: object + result: {} + required: + - goal + title: set_liquid参数 + type: object + type: LiquidHandlerSetLiquid module: unilabos.devices.liquid_handling.prcxi.prcxi:PRCXI9300Handler status_types: reset_ok: bool diff --git a/unilabos_msgs/action/LiquidHandlerSetLiquid.action b/unilabos_msgs/action/LiquidHandlerSetLiquid.action new file mode 100644 index 0000000..ca4827c --- /dev/null +++ b/unilabos_msgs/action/LiquidHandlerSetLiquid.action @@ -0,0 +1,6 @@ +Resource[] wells +string[] liquid_names +float64[] volumes +--- +string return_info +--- \ No newline at end of file