From 727d2c2595f06323a45dd65e30348c36f93beca8 Mon Sep 17 00:00:00 2001 From: dijkstra402 Date: Sat, 1 Nov 2025 10:39:08 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=AD=A3YB=20warehouse?= =?UTF-8?q?=E6=8E=92=E5=88=97=E6=96=B9=E5=BC=8F=E5=92=8C=E7=89=A9=E6=96=99?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E6=98=A0=E5=B0=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修改warehouse_factory为YB_warehouse_factory - 调整warehouse排列方式:左上角为A01,竖着排ABCD,横着排01、02、03 - 修正config.py中的物料名称拼写错误(YB_fen_ye_20ml_Bottle, YB_pei_ye_xiao_Bottle) - 添加缺失的warehouse函数(bioyond_warehouse_2x2x1, bioyond_warehouse_3x5x1, bioyond_warehouse_20x1x1) - 更新decks.py中的warehouse位置映射 - 删除废弃的bottles.py和warehouses.py文件 --- .../workstation/bioyond_studio/config.py | 6 +- unilabos/registry/devices/laiyu_liquid.yaml | 11 +- unilabos/registry/devices/liquid_handler.yaml | 33 +-- unilabos/resources/bioyond/YB_warehouses.py | 71 ++++- unilabos/resources/bioyond/bottles.py | 255 ------------------ unilabos/resources/bioyond/decks.py | 38 ++- unilabos/resources/bioyond/warehouses.py | 161 ----------- unilabos/resources/warehouse.py | 5 +- 8 files changed, 97 insertions(+), 483 deletions(-) delete mode 100644 unilabos/resources/bioyond/bottles.py delete mode 100644 unilabos/resources/bioyond/warehouses.py diff --git a/unilabos/devices/workstation/bioyond_studio/config.py b/unilabos/devices/workstation/bioyond_studio/config.py index 2eb3dbb4..99cbddaf 100644 --- a/unilabos/devices/workstation/bioyond_studio/config.py +++ b/unilabos/devices/workstation/bioyond_studio/config.py @@ -16,7 +16,7 @@ API_CONFIG = { "report_token": os.getenv("BIOYOND_REPORT_TOKEN", "CHANGE_ME_TOKEN"), # HTTP 服务配置 - "HTTP_host": os.getenv("BIOYOND_HTTP_HOST", "172.21.32.210"), # HTTP服务监听地址,监听计算机飞连ip地址 + "HTTP_host": os.getenv("BIOYOND_HTTP_HOST", "172.21.32.83"), # HTTP服务监听地址,监听计算机飞连ip地址 "HTTP_port": int(os.getenv("BIOYOND_HTTP_PORT", "8080")), "debug_mode": False,# 调试模式 } @@ -159,9 +159,9 @@ MATERIAL_TYPE_MAPPINGS = { "5ml分液瓶板": ("YB_6x5ml_DispensingVialCarrier", "3a192fa4-007d-ec7b-456e-2a8be7a13f23"), "5ml分液瓶": ("YB_fen_ye_5ml_Bottle", "3a192c2a-ebb7-58a1-480d-8b3863bf74f4"), "20ml分液瓶板": ("YB_6x20ml_DispensingVialCarrier", "3a192fa4-47db-3449-162a-eaf8aba57e27"), - "20ml分液瓶": ("YB_fen_ye_20ml_Bottler", "3a192c2b-19e8-f0a3-035e-041ca8ca1035"), + "20ml分液瓶": ("YB_fen_ye_20ml_Bottle", "3a192c2b-19e8-f0a3-035e-041ca8ca1035"), "配液瓶(小)板": ("YB_6x_SmallSolutionBottleCarrier", "3a190c8b-3284-af78-d29f-9a69463ad047"), - "配液瓶(小)": ("YB_pei_ye_xiao_Bottler", "3a190c8c-fe8f-bf48-0dc3-97afc7f508eb"), + "配液瓶(小)": ("YB_pei_ye_xiao_Bottle", "3a190c8c-fe8f-bf48-0dc3-97afc7f508eb"), "配液瓶(大)板": ("YB_4x_LargeSolutionBottleCarrier", "53e50377-32dc-4781-b3c0-5ce45bc7dc27"), "配液瓶(大)": ("YB_pei_ye_da_Bottle", "19c52ad1-51c5-494f-8854-576f4ca9c6ca"), "适配器块": ("YB_AdapterBlock", "efc3bb32-d504-4890-91c0-b64ed3ac80cf"), diff --git a/unilabos/registry/devices/laiyu_liquid.yaml b/unilabos/registry/devices/laiyu_liquid.yaml index 98201a7d..64c0c182 100644 --- a/unilabos/registry/devices/laiyu_liquid.yaml +++ b/unilabos/registry/devices/laiyu_liquid.yaml @@ -1361,8 +1361,7 @@ laiyu_liquid: mix_liquid_height: 0.0 mix_rate: 0 mix_stage: '' - mix_times: - - 0 + mix_times: 0 mix_vol: 0 none_keys: - '' @@ -1492,11 +1491,9 @@ laiyu_liquid: mix_stage: type: string mix_times: - items: - maximum: 2147483647 - minimum: -2147483648 - type: integer - type: array + maximum: 2147483647 + minimum: -2147483648 + type: integer mix_vol: maximum: 2147483647 minimum: -2147483648 diff --git a/unilabos/registry/devices/liquid_handler.yaml b/unilabos/registry/devices/liquid_handler.yaml index b21ccd7e..99c92333 100644 --- a/unilabos/registry/devices/liquid_handler.yaml +++ b/unilabos/registry/devices/liquid_handler.yaml @@ -3994,8 +3994,7 @@ liquid_handler: mix_liquid_height: 0.0 mix_rate: 0 mix_stage: '' - mix_times: - - 0 + mix_times: 0 mix_vol: 0 none_keys: - '' @@ -4151,11 +4150,9 @@ liquid_handler: mix_stage: type: string mix_times: - items: - maximum: 2147483647 - minimum: -2147483648 - type: integer - type: array + maximum: 2147483647 + minimum: -2147483648 + type: integer mix_vol: maximum: 2147483647 minimum: -2147483648 @@ -5015,8 +5012,7 @@ liquid_handler.biomek: mix_liquid_height: 0.0 mix_rate: 0 mix_stage: '' - mix_times: - - 0 + mix_times: 0 mix_vol: 0 none_keys: - '' @@ -5159,11 +5155,9 @@ liquid_handler.biomek: mix_stage: type: string mix_times: - items: - maximum: 2147483647 - minimum: -2147483648 - type: integer - type: array + maximum: 2147483647 + minimum: -2147483648 + type: integer mix_vol: maximum: 2147483647 minimum: -2147483648 @@ -7807,8 +7801,7 @@ liquid_handler.prcxi: mix_liquid_height: 0.0 mix_rate: 0 mix_stage: '' - mix_times: - - 0 + mix_times: 0 mix_vol: 0 none_keys: - '' @@ -7937,11 +7930,9 @@ liquid_handler.prcxi: mix_stage: type: string mix_times: - items: - maximum: 2147483647 - minimum: -2147483648 - type: integer - type: array + maximum: 2147483647 + minimum: -2147483648 + type: integer mix_vol: maximum: 2147483647 minimum: -2147483648 diff --git a/unilabos/resources/bioyond/YB_warehouses.py b/unilabos/resources/bioyond/YB_warehouses.py index c546759d..39f79eac 100644 --- a/unilabos/resources/bioyond/YB_warehouses.py +++ b/unilabos/resources/bioyond/YB_warehouses.py @@ -1,9 +1,9 @@ -from unilabos.resources.warehouse import WareHouse, warehouse_factory +from unilabos.resources.warehouse import WareHouse, YB_warehouse_factory def bioyond_warehouse_1x4x4(name: str) -> WareHouse: """创建BioYond 4x1x4仓库""" - return warehouse_factory( + return YB_warehouse_factory( name=name, num_items_x=1, num_items_y=4, @@ -20,7 +20,7 @@ def bioyond_warehouse_1x4x4(name: str) -> WareHouse: def bioyond_warehouse_1x4x2(name: str) -> WareHouse: """创建BioYond 4x1x2仓库""" - return warehouse_factory( + return YB_warehouse_factory( name=name, num_items_x=1, num_items_y=4, @@ -37,7 +37,7 @@ def bioyond_warehouse_1x4x2(name: str) -> WareHouse: # 定义benyond的堆栈 def bioyond_warehouse_1x2x2(name: str) -> WareHouse: """创建BioYond 4x1x4仓库""" - return warehouse_factory( + return YB_warehouse_factory( name=name, num_items_x=2, num_items_y=2, @@ -50,9 +50,26 @@ def bioyond_warehouse_1x2x2(name: str) -> WareHouse: item_dz=120.0, category="YB_warehouse", ) + +def bioyond_warehouse_2x2x1(name: str) -> WareHouse: + """创建BioYond 2x2x1仓库(自动堆栈)""" + return YB_warehouse_factory( + name=name, + num_items_x=2, + num_items_y=2, + num_items_z=1, + dx=10.0, + dy=10.0, + dz=10.0, + item_dx=137.0, + item_dy=96.0, + item_dz=120.0, + category="YB_warehouse", + ) + def bioyond_warehouse_10x1x1(name: str) -> WareHouse: """创建BioYond 4x1x4仓库""" - return warehouse_factory( + return YB_warehouse_factory( name=name, num_items_x=10, num_items_y=1, @@ -67,7 +84,7 @@ def bioyond_warehouse_10x1x1(name: str) -> WareHouse: ) def bioyond_warehouse_1x3x3(name: str) -> WareHouse: """创建BioYond 4x1x4仓库""" - return warehouse_factory( + return YB_warehouse_factory( name=name, num_items_x=1, num_items_y=3, @@ -82,7 +99,7 @@ def bioyond_warehouse_1x3x3(name: str) -> WareHouse: ) def bioyond_warehouse_2x1x3(name: str) -> WareHouse: """创建BioYond 4x1x4仓库""" - return warehouse_factory( + return YB_warehouse_factory( name=name, num_items_x=2, num_items_y=1, @@ -98,7 +115,7 @@ def bioyond_warehouse_2x1x3(name: str) -> WareHouse: def bioyond_warehouse_3x3x1(name: str) -> WareHouse: """创建BioYond 4x1x4仓库""" - return warehouse_factory( + return YB_warehouse_factory( name=name, num_items_x=3, num_items_y=3, @@ -113,7 +130,7 @@ def bioyond_warehouse_3x3x1(name: str) -> WareHouse: ) def bioyond_warehouse_5x1x1(name: str) -> WareHouse: """创建BioYond 4x1x4仓库""" - return warehouse_factory( + return YB_warehouse_factory( name=name, num_items_x=5, num_items_y=1, @@ -128,7 +145,7 @@ def bioyond_warehouse_5x1x1(name: str) -> WareHouse: ) def bioyond_warehouse_3x3x1_2(name: str) -> WareHouse: """创建BioYond 4x1x4仓库""" - return warehouse_factory( + return YB_warehouse_factory( name=name, num_items_x=3, num_items_y=3, @@ -144,7 +161,7 @@ def bioyond_warehouse_3x3x1_2(name: str) -> WareHouse: def bioyond_warehouse_liquid_and_lid_handling(name: str) -> WareHouse: """创建BioYond开关盖加液模块台面""" - return warehouse_factory( + return YB_warehouse_factory( name=name, num_items_x=2, num_items_y=5, @@ -157,4 +174,36 @@ def bioyond_warehouse_liquid_and_lid_handling(name: str) -> WareHouse: item_dz=120.0, category="warehouse", removed_positions=None + ) + +def bioyond_warehouse_3x5x1(name: str) -> WareHouse: + """创建BioYond 3x5x1仓库(手动堆栈)""" + return YB_warehouse_factory( + name=name, + num_items_x=3, + num_items_y=5, + num_items_z=1, + dx=10.0, + dy=10.0, + dz=10.0, + item_dx=137.0, + item_dy=96.0, + item_dz=120.0, + category="warehouse", + ) + +def bioyond_warehouse_20x1x1(name: str) -> WareHouse: + """创建BioYond 20x1x1仓库(粉末加样头堆栈)""" + return YB_warehouse_factory( + name=name, + num_items_x=20, + num_items_y=1, + num_items_z=1, + dx=10.0, + dy=10.0, + dz=10.0, + item_dx=137.0, + item_dy=96.0, + item_dz=120.0, + category="warehouse", ) \ No newline at end of file diff --git a/unilabos/resources/bioyond/bottles.py b/unilabos/resources/bioyond/bottles.py deleted file mode 100644 index 23b9523e..00000000 --- a/unilabos/resources/bioyond/bottles.py +++ /dev/null @@ -1,255 +0,0 @@ -from unilabos.resources.itemized_carrier import Bottle, BottleCarrier -# 工厂函数 - - -def YB_Solid_Stock( - name: str, - diameter: float = 20.0, - height: float = 100.0, - max_volume: float = 30000.0, # 30mL - barcode: str = None, -) -> Bottle: - """创建粉末瓶""" - return Bottle( - name=name, - diameter=diameter,# 未知 - height=height, - max_volume=max_volume, - barcode=barcode, - model="Solid_Stock", - ) - - -def YB_Solid_Vial( - name: str, - diameter: float = 25.0, - height: float = 60.0, - max_volume: float = 30000.0, # 30mL - barcode: str = None, -) -> Bottle: - """创建粉末瓶""" - return Bottle( - name=name, - diameter=diameter, - height=height, - max_volume=max_volume, - barcode=barcode, - model="Solid_Vial", - ) - - -def YB_Liquid_Vial( - name: str, - diameter: float = 25.0, - height: float = 60.0, - max_volume: float = 30000.0, # 30mL - barcode: str = None, -) -> Bottle: - """创建滴定液瓶""" - return Bottle( - name=name, - diameter=diameter, - height=height, - max_volume=max_volume, - barcode=barcode, - model="Liquid_Vial", - ) - - -def YB_Solution_Beaker( - name: str, - diameter: float = 60.0, - height: float = 70.0, - max_volume: float = 200000.0, # 200mL - barcode: str = None, -) -> Bottle: - """创建溶液烧杯""" - return Bottle( - name=name, - diameter=diameter, - height=height, - max_volume=max_volume, - barcode=barcode, - model="Solution_Beaker", - ) - - -def YB_Reagent_Bottle( - name: str, - diameter: float = 70.0, - height: float = 120.0, - max_volume: float = 500000.0, # 500mL - barcode: str = None, -) -> Bottle: - """创建试剂瓶""" - return Bottle( - name=name, - diameter=diameter, - height=height, - max_volume=max_volume, - barcode=barcode, - model="Reagent_Bottle", - ) - - -def YB_100ml_Liquid_Bottle( - name: str, - diameter: float = 50.0, - height: float = 80.0, - max_volume: float = 100000.0, # 100mL - barcode: str = None, -) -> Bottle: - """创建100ml液体瓶""" - return Bottle( - name=name, - diameter=diameter, - height=height, - max_volume=max_volume, - barcode=barcode, - model="100ml_Liquid_Bottle", - ) - - -def YB_Liquid_Bottle( - name: str, - diameter: float = 40.0, - height: float = 70.0, - max_volume: float = 50000.0, # 50mL - barcode: str = None, -) -> Bottle: - """创建液体瓶""" - return Bottle( - name=name, - diameter=diameter, - height=height, - max_volume=max_volume, - barcode=barcode, - model="Liquid_Bottle", - ) - - -def YB_High_Viscosity_Liquid_Bottle( - name: str, - diameter: float = 45.0, - height: float = 75.0, - max_volume: float = 60000.0, # 60mL - barcode: str = None, -) -> Bottle: - """创建高粘液瓶""" - return Bottle( - name=name, - diameter=diameter, - height=height, - max_volume=max_volume, - barcode=barcode, - model="High_Viscosity_Liquid_Bottle", - ) - - -def YB_Large_Dispense_Head( - name: str, - diameter: float = 35.0, - height: float = 90.0, - max_volume: float = 50000.0, # 50mL - barcode: str = None, -) -> Bottle: - """创建加样头(大)""" - return Bottle( - name=name, - diameter=diameter, - height=height, - max_volume=max_volume, - barcode=barcode, - model="Large_Dispense_Head", - ) - - -def YB_5ml_Dispensing_Vial( - name: str, - diameter: float = 15.0, - height: float = 45.0, - max_volume: float = 5000.0, # 5mL - barcode: str = None, -) -> Bottle: - """创建5ml分液瓶""" - return Bottle( - name=name, - diameter=diameter, - height=height, - max_volume=max_volume, - barcode=barcode, - model="5ml_Dispensing_Vial", - ) - - -def YB_20ml_Dispensing_Vial( - name: str, - diameter: float = 20.0, - height: float = 65.0, - max_volume: float = 20000.0, # 20mL - barcode: str = None, -) -> Bottle: - """创建20ml分液瓶""" - return Bottle( - name=name, - diameter=diameter, - height=height, - max_volume=max_volume, - barcode=barcode, - model="20ml_Dispensing_Vial", - ) - - -def YB_Small_Solution_Bottle( - name: str, - diameter: float = 35.0, - height: float = 60.0, - max_volume: float = 40000.0, # 40mL - barcode: str = None, -) -> Bottle: - """创建配液瓶(小)""" - return Bottle( - name=name, - diameter=diameter, - height=height, - max_volume=max_volume, - barcode=barcode, - model="Small_Solution_Bottle", - ) - - -def YB_Large_Solution_Bottle( - name: str, - diameter: float = 55.0, - height: float = 90.0, - max_volume: float = 150000.0, # 150mL - barcode: str = None, -) -> Bottle: - """创建配液瓶(大)""" - return Bottle( - name=name, - diameter=diameter, - height=height, - max_volume=max_volume, - barcode=barcode, - model="Large_Solution_Bottle", - ) - - -def YB_Pipette_Tip( - name: str, - diameter: float = 10.0, - height: float = 50.0, - max_volume: float = 1000.0, # 1mL - barcode: str = None, -) -> Bottle: - """创建枪头""" - return Bottle( - name=name, - diameter=diameter, - height=height, - max_volume=max_volume, - barcode=barcode, - model="Pipette_Tip", - ) - diff --git a/unilabos/resources/bioyond/decks.py b/unilabos/resources/bioyond/decks.py index fa242c3d..f15e0655 100644 --- a/unilabos/resources/bioyond/decks.py +++ b/unilabos/resources/bioyond/decks.py @@ -1,7 +1,7 @@ from os import name from pylabrobot.resources import Deck, Coordinate, Rotation -from unilabos.resources.bioyond.warehouses import bioyond_warehouse_1x4x4, bioyond_warehouse_1x4x2, bioyond_warehouse_liquid_and_lid_handling, bioyond_warehouse_1x2x2, bioyond_warehouse_1x3x3, bioyond_warehouse_10x1x1, bioyond_warehouse_3x3x1, bioyond_warehouse_3x3x1_2, bioyond_warehouse_5x1x1 +from unilabos.resources.bioyond.YB_warehouses import bioyond_warehouse_1x4x4, bioyond_warehouse_1x4x2, bioyond_warehouse_liquid_and_lid_handling, bioyond_warehouse_1x2x2, bioyond_warehouse_1x3x3, bioyond_warehouse_10x1x1, bioyond_warehouse_3x3x1, bioyond_warehouse_3x3x1_2, bioyond_warehouse_5x1x1, bioyond_warehouse_20x1x1, bioyond_warehouse_2x2x1, bioyond_warehouse_3x5x1 class BIOYOND_PolymerReactionStation_Deck(Deck): @@ -85,31 +85,23 @@ class BIOYOND_YB_Deck(Deck): def setup(self) -> None: # 添加仓库 self.warehouses = { - "321窗口": bioyond_warehouse_1x2x2("321窗口"), - "43窗口": bioyond_warehouse_1x2x2("43窗口"), - "手动传递窗左": bioyond_warehouse_1x3x3("手动传递窗左"), - "手动传递窗右": bioyond_warehouse_1x3x3("手动传递窗右"), - "加样头堆栈左": bioyond_warehouse_10x1x1("加样头堆栈左"), - "加样头堆栈右": bioyond_warehouse_10x1x1("加样头堆栈右"), - - "15ml配液堆栈左": bioyond_warehouse_3x3x1("15ml配液堆栈左"), - "母液加样右": bioyond_warehouse_3x3x1_2("母液加样右"), - "大瓶母液堆栈左": bioyond_warehouse_5x1x1("大瓶母液堆栈左"), - "大瓶母液堆栈右": bioyond_warehouse_5x1x1("大瓶母液堆栈右"), + "自动堆栈-左": bioyond_warehouse_2x2x1("自动堆栈-左"), + "自动堆栈-右": bioyond_warehouse_2x2x1("自动堆栈-右"), + "手动堆栈-左": bioyond_warehouse_3x5x1("手动堆栈-左"), + "手动堆栈-右": bioyond_warehouse_3x5x1("手动堆栈-右"), + "粉末加样头堆栈": bioyond_warehouse_20x1x1("粉末加样头堆栈"), + "配液站内试剂仓库": bioyond_warehouse_3x3x1("配液站内试剂仓库"), + "试剂替换仓库": bioyond_warehouse_10x1x1("试剂替换仓库"), } # warehouse 的位置 self.warehouse_locations = { - "321窗口": Coordinate(-150.0, 158.0, 0.0), - "43窗口": Coordinate(4160.0, 158.0, 0.0), - "手动传递窗左": Coordinate(-150.0, 877.0, 0.0), - "手动传递窗右": Coordinate(4160.0, 877.0, 0.0), - "加样头堆栈左": Coordinate(385.0, 1300.0, 0.0), - "加样头堆栈右": Coordinate(2187.0, 1300.0, 0.0), - - "15ml配液堆栈左": Coordinate(749.0, 355.0, 0.0), - "母液加样右": Coordinate(2152.0, 333.0, 0.0), - "大瓶母液堆栈左": Coordinate(1164.0, 676.0, 0.0), - "大瓶母液堆栈右": Coordinate(2717.0, 676.0, 0.0), + "自动堆栈-左": Coordinate(-300.0, 158.0, 0.0), + "自动堆栈-右": Coordinate(4160.0, 158.0, 0.0), + "手动堆栈-左": Coordinate(-400.0, 877.0, 0.0), + "手动堆栈-右": Coordinate(4160.0, 877.0, 0.0), + "粉末加样头堆栈": Coordinate(385.0, 1300.0, 0.0), + "配液站内试剂仓库": Coordinate(1164.0, 676.0, 0.0), + "试剂替换仓库": Coordinate(2717.0, 676.0, 0.0), } for warehouse_name, warehouse in self.warehouses.items(): diff --git a/unilabos/resources/bioyond/warehouses.py b/unilabos/resources/bioyond/warehouses.py deleted file mode 100644 index 6eb4f26e..00000000 --- a/unilabos/resources/bioyond/warehouses.py +++ /dev/null @@ -1,161 +0,0 @@ -from unilabos.resources.warehouse import WareHouse, warehouse_factory - - -def bioyond_warehouse_1x4x4(name: str) -> WareHouse: - """创建BioYond 4x1x4仓库""" - return warehouse_factory( - name=name, - num_items_x=1, - num_items_y=4, - num_items_z=4, - dx=10.0, - dy=10.0, - dz=10.0, - item_dx=137.0, - item_dy=96.0, - item_dz=120.0, - category="warehouse", - ) - - - -def bioyond_warehouse_1x4x2(name: str) -> WareHouse: - """创建BioYond 4x1x2仓库""" - return warehouse_factory( - name=name, - num_items_x=1, - num_items_y=4, - num_items_z=2, - dx=10.0, - dy=10.0, - dz=10.0, - item_dx=137.0, - item_dy=96.0, - item_dz=120.0, - category="warehouse", - removed_positions=None - ) - # 定义benyond的堆栈 -def bioyond_warehouse_1x2x2(name: str) -> WareHouse: - """创建BioYond 4x1x4仓库""" - return warehouse_factory( - name=name, - num_items_x=2, - num_items_y=2, - num_items_z=1, - dx=10.0, - dy=10.0, - dz=10.0, - item_dx=137.0, - item_dy=96.0, - item_dz=120.0, - category="YB_warehouse", - ) -def bioyond_warehouse_10x1x1(name: str) -> WareHouse: - """创建BioYond 4x1x4仓库""" - return warehouse_factory( - name=name, - num_items_x=10, - num_items_y=1, - num_items_z=1, - dx=10.0, - dy=10.0, - dz=10.0, - item_dx=137.0, - item_dy=96.0, - item_dz=120.0, - category="warehouse", - ) -def bioyond_warehouse_1x3x3(name: str) -> WareHouse: - """创建BioYond 4x1x4仓库""" - return warehouse_factory( - name=name, - num_items_x=1, - num_items_y=3, - num_items_z=3, - dx=10.0, - dy=10.0, - dz=10.0, - item_dx=137.0, - item_dy=96.0, - item_dz=120.0, - category="warehouse", - ) -def bioyond_warehouse_2x1x3(name: str) -> WareHouse: - """创建BioYond 4x1x4仓库""" - return warehouse_factory( - name=name, - num_items_x=2, - num_items_y=1, - num_items_z=3, - dx=10.0, - dy=10.0, - dz=10.0, - item_dx=137.0, - item_dy=96.0, - item_dz=120.0, - category="warehouse", - ) - -def bioyond_warehouse_3x3x1(name: str) -> WareHouse: - """创建BioYond 4x1x4仓库""" - return warehouse_factory( - name=name, - num_items_x=3, - num_items_y=3, - num_items_z=1, - dx=10.0, - dy=10.0, - dz=10.0, - item_dx=137.0, - item_dy=96.0, - item_dz=120.0, - category="warehouse", - ) -def bioyond_warehouse_5x1x1(name: str) -> WareHouse: - """创建BioYond 4x1x4仓库""" - return warehouse_factory( - name=name, - num_items_x=5, - num_items_y=1, - num_items_z=1, - dx=10.0, - dy=10.0, - dz=10.0, - item_dx=137.0, - item_dy=96.0, - item_dz=120.0, - category="warehouse", - ) -def bioyond_warehouse_3x3x1_2(name: str) -> WareHouse: - """创建BioYond 4x1x4仓库""" - return warehouse_factory( - name=name, - num_items_x=3, - num_items_y=3, - num_items_z=1, - dx=12.0, - dy=12.0, - dz=12.0, - item_dx=137.0, - item_dy=96.0, - item_dz=120.0, - category="warehouse", - ) - -def bioyond_warehouse_liquid_and_lid_handling(name: str) -> WareHouse: - """创建BioYond开关盖加液模块台面""" - return warehouse_factory( - name=name, - num_items_x=2, - num_items_y=5, - num_items_z=1, - dx=10.0, - dy=10.0, - dz=10.0, - item_dx=137.0, - item_dy=96.0, - item_dz=120.0, - category="warehouse", - removed_positions=None - ) \ No newline at end of file diff --git a/unilabos/resources/warehouse.py b/unilabos/resources/warehouse.py index c665b7fa..2f613cfa 100644 --- a/unilabos/resources/warehouse.py +++ b/unilabos/resources/warehouse.py @@ -8,7 +8,7 @@ from unilabos.resources.itemized_carrier import ItemizedCarrier, ResourcePLR LETTERS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" -def warehouse_factory( +def YB_warehouse_factory( name: str, num_items_x: int = 1, num_items_y: int = 4, @@ -44,7 +44,8 @@ def warehouse_factory( name_prefix=name, ) len_x, len_y = (num_items_x, num_items_y) if num_items_z == 1 else (num_items_y, num_items_z) if num_items_x == 1 else (num_items_x, num_items_z) - keys = [f"{LETTERS[j]}{i + 1}" for i in range(len_x) for j in range(len_y)] + + keys = [f"{LETTERS[len_y-1-j]}{str(i+1).zfill(2)}" for j in range(len_y) for i in range(len_x)] sites = {i: site for i, site in zip(keys, _sites.values())} return WareHouse(