diff --git a/test/resources/YB_materials_info.json b/test/resources/YB_materials_info.json index 61d2de8f..d5bc381f 100644 --- a/test/resources/YB_materials_info.json +++ b/test/resources/YB_materials_info.json @@ -1,12 +1,52 @@ [ - {'id': '3a1d2656-69bf-1ccf-fc38-85a0431ee498', 'typeName': '加样头(大)', 'code': '0005-00291', 'barCode': '', 'name': 'test', 'quantity': 1.0, 'lockQuantity': 0.0, 'unit': '个', 'status': 1, 'isUse': False, 'locations': [ - {'id': '3a19da56-1379-20c8-5886-f7c4fbcb5733', 'whid': '3a19da56-1378-613b-29f2-871e1a287aa5', 'whName': '粉末加样头堆栈', 'code': '0005-0003', 'x': 3, 'y': 1, 'z': 1, 'quantity': 0 + { + "id": "3a1d377b-299d-d0f2-ced9-48257f60dfad", + "typeName": "加样头(大)", + "code": "0005-00145", + "barCode": "", + "name": "LiDFOB", + "quantity": 9999.0, + "lockQuantity": 0.0, + "unit": "个", + "status": 1, + "isUse": false, + "locations": [ + { + "id": "3a19da56-1379-ff7c-1745-07e200b44ce2", + "whid": "3a19da56-1378-613b-29f2-871e1a287aa5", + "whName": "粉末加样头堆栈", + "code": "0005-0001", + "x": 1, + "y": 1, + "z": 1, + "quantity": 0 } - ], 'detail': [] + ], + "detail": [] }, - {'id': '3a1d2657-d16f-a575-3506-5c029ff6810d', 'typeName': '加样头(大)', 'code': '0005-00293', 'barCode': '', 'name': 'dsfdsfd', 'quantity': 1.0, 'lockQuantity': 0.0, 'unit': '个', 'status': 1, 'isUse': False, 'locations': [ - {'id': '3a19da56-1379-e77d-0e65-7463b238a3b9', 'whid': '3a19da56-1378-613b-29f2-871e1a287aa5', 'whName': '粉末加样头堆栈', 'code': '0005-0005', 'x': 5, 'y': 1, 'z': 1, 'quantity': 0 + { + "id": "3a1d377b-6a81-6a7e-147c-f89f6463656d", + "typeName": "液", + "code": "0006-00141", + "barCode": "", + "name": "EMC", + "quantity": 99999.0, + "lockQuantity": 0.0, + "unit": "g", + "status": 1, + "isUse": false, + "locations": [ + { + "id": "3a1baa20-a7b1-c665-8b9c-d8099d07d2f6", + "whid": "3a1baa20-a7b0-5c19-8844-5de8924d4e78", + "whName": "4号手套箱内部堆栈", + "code": "0015-0001", + "x": 1, + "y": 1, + "z": 1, + "quantity": 0 } - ], 'detail': [] + ], + "detail": [] } ] \ No newline at end of file diff --git a/test/resources/test_resourcetreeset.py b/test/resources/test_resourcetreeset.py index ff5cfd06..b7602ed1 100644 --- a/test/resources/test_resourcetreeset.py +++ b/test/resources/test_resourcetreeset.py @@ -1,3 +1,4 @@ +from ast import If import pytest import json import os @@ -13,13 +14,8 @@ lab_registry.setup() type_mapping = { - "烧杯": ("YB_1FlaskCarrier", "3a14196b-24f2-ca49-9081-0cab8021bf1a"), - "试剂瓶": ("YB_1BottleCarrier", ""), - "样品板": ("YB_6StockCarrier", "3a14196e-b7a0-a5da-1931-35f3000281e9"), - "分装板": ("YB_6VialCarrier", "3a14196e-5dfe-6e21-0c79-fe2036d052c4"), - "样品瓶": ("YB_Solid_Stock", "3a14196a-cf7d-8aea-48d8-b9662c7dba94"), - "90%分装小瓶": ("YB_Solid_Vial", "3a14196c-cdcf-088d-dc7d-5cf38f0ad9ea"), - "10%分装小瓶": ("YB_Liquid_Vial", "3a14196c-76be-2279-4e22-7310d69aed68"), + "加样头(大)": ("YB_jia_yang_tou_da_1X1_carrier", "3a190ca0-b2f6-9aeb-8067-547e72c11469"), + "液": ("YB_1BottleCarrier", "3a190ca1-2add-2b23-f8e1-bbd348b7f790"), } @@ -57,12 +53,20 @@ def bioyond_materials_liquidhandling_2() -> list[dict]: "bioyond_materials_reaction", "bioyond_materials_liquidhandling_1", ]) -def test_resourcetreeset_from_plr(materials_fixture, request) -> list[dict]: - materials = request.getfixturevalue(materials_fixture) +def test_resourcetreeset_from_plr() -> list[dict]: + # 直接加载 bioyond_materials_reaction.json 文件 + current_dir = os.path.dirname(os.path.abspath(__file__)) + json_path = os.path.join(current_dir, "YB_materials_info.json") + with open(json_path, "r", encoding="utf-8") as f: + materials = json.load(f) deck = BIOYOND_PolymerReactionStation_Deck("test_deck") output = resource_bioyond_to_plr(materials, type_mapping=type_mapping, deck=deck) - print(deck.summary()) + print(output) + # print(deck.summary()) r = ResourceTreeSet.from_plr_resources([deck]) print(r.dump()) # json.dump(deck.serialize(), open("test.json", "w", encoding="utf-8"), indent=4) + +if __name__ == "__main__": + test_resourcetreeset_from_plr() diff --git a/unilabos/devices/workstation/bioyond_studio/bioyond_cell/bioyond_cell_workstation.py b/unilabos/devices/workstation/bioyond_studio/bioyond_cell/bioyond_cell_workstation.py index c60a03e3..ff29574d 100644 --- a/unilabos/devices/workstation/bioyond_studio/bioyond_cell/bioyond_cell_workstation.py +++ b/unilabos/devices/workstation/bioyond_studio/bioyond_cell/bioyond_cell_workstation.py @@ -971,7 +971,7 @@ if __name__ == "__main__": lab_registry.setup() ws = BioyondCellWorkstation() # logger.info(ws.scheduler_stop()) - logger.info(ws.scheduler_start()) + # logger.info(ws.scheduler_start()) # results = ws.create_materials(SOLID_LIQUID_MAPPINGS) # for r in results: @@ -980,11 +980,11 @@ if __name__ == "__main__": # result = ws.create_and_inbound_materials() # 继续后续流程 - logger.info(ws.auto_feeding4to3()) #搬运物料到3号箱 + # logger.info(ws.auto_feeding4to3()) #搬运物料到3号箱 # # 使用正斜杠或 Path 对象来指定文件路径 - excel_path = Path("unilabos\\devices\\workstation\\bioyond_studio\\bioyond_cell\\2025092701.xlsx") - logger.info(ws.create_orders(excel_path)) - logger.info(ws.transfer_3_to_2_to_1()) + # excel_path = Path("unilabos\\devices\\workstation\\bioyond_studio\\bioyond_cell\\2025092701.xlsx") + # logger.info(ws.create_orders(excel_path)) + # logger.info(ws.transfer_3_to_2_to_1()) # logger.info(ws.transfer_1_to_2()) # logger.info(ws.scheduler_start()) diff --git a/unilabos/devices/workstation/bioyond_studio/bioyond_cell/样品导入模板.xlsx b/unilabos/devices/workstation/bioyond_studio/bioyond_cell/样品导入模板.xlsx index a89f1bc2..e6addeb9 100644 Binary files a/unilabos/devices/workstation/bioyond_studio/bioyond_cell/样品导入模板.xlsx and b/unilabos/devices/workstation/bioyond_studio/bioyond_cell/样品导入模板.xlsx differ diff --git a/unilabos/devices/workstation/bioyond_studio/config.py b/unilabos/devices/workstation/bioyond_studio/config.py index 4804da13..f184a282 100644 --- a/unilabos/devices/workstation/bioyond_studio/config.py +++ b/unilabos/devices/workstation/bioyond_studio/config.py @@ -135,8 +135,8 @@ WAREHOUSE_MAPPING = { # 物料类型配置 MATERIAL_TYPE_MAPPINGS = { - "加样头(大)": ("YB_jia_yang_tou_da", "3a190ca0-b2f6-9aeb-8067-547e72c11469"), - "加样头(大)板": ("YB_jia_yang_tou_da_1X1_carrier", "a8e714ae-2a4e-4eb9-9614-e4c140ec3f16"), + "加样头(大)": ("YB_jia_yang_tou_da_1X1_carrier", "3a190ca0-b2f6-9aeb-8067-547e72c11469"), + "液": ("YB_1BottleCarrier", "3a190ca1-2add-2b23-f8e1-bbd348b7f790"), # YB信息 } diff --git a/unilabos/devices/workstation/bioyond_studio/station.py b/unilabos/devices/workstation/bioyond_studio/station.py index 3ce7353f..3e3e0b3b 100644 --- a/unilabos/devices/workstation/bioyond_studio/station.py +++ b/unilabos/devices/workstation/bioyond_studio/station.py @@ -63,7 +63,7 @@ class BioyondResourceSynchronizer(ResourceSynchronizer): logger.error("Bioyond API客户端未初始化") return False - bioyond_data = self.bioyond_api_client.stock_material('{"typeMode": 2, "includeDetail": true}') + bioyond_data = self.bioyond_api_client.stock_material('{"typeMode": 1, "includeDetail": true}') if not bioyond_data: logger.warning("从Bioyond获取的物料数据为空") return False diff --git a/unilabos/registry/resources/bioyond/YB_bottle_carriers.yaml b/unilabos/registry/resources/bioyond/YB_bottle_carriers.yaml new file mode 100644 index 00000000..83320c5d --- /dev/null +++ b/unilabos/registry/resources/bioyond/YB_bottle_carriers.yaml @@ -0,0 +1,25 @@ +YB_jia_yang_tou_da_1X1_carrier: + category: + - yb3 + class: + module: unilabos.resources.bioyond.YB_bottle_carriers:YB_jia_yang_tou_da_1X1_carrier + type: pylabrobot + description: YB_jia_yang_tou_da_1X1_carrier + handles: [] + icon: '' + init_param_schema: {} + registry_type: resource + version: 1.0.0 + +YB_1BottleCarrier: + category: + - yb3 + class: + module: unilabos.resources.bioyond.YB_bottle_carriers:YB_1BottleCarrier + type: pylabrobot + description: YB_1BottleCarrier + handles: [] + icon: '' + init_param_schema: {} + registry_type: resource + version: 1.0.0 diff --git a/unilabos/registry/resources/bioyond/bottle_carriers.yaml b/unilabos/registry/resources/bioyond/bottle_carriers.yaml deleted file mode 100644 index ac01cc35..00000000 --- a/unilabos/registry/resources/bioyond/bottle_carriers.yaml +++ /dev/null @@ -1,12 +0,0 @@ -YB_jia_yang_tou_da_1X1_carrier: - category: - - yb3 - class: - module: unilabos.resources.bioyond.bottle_carriers:YB_jia_yang_tou_da_1X1_carrier - type: pylabrobot - description: YB_jia_yang_tou_da_1X1_carrier - handles: [] - icon: '' - init_param_schema: {} - registry_type: resource - version: 1.0.0 diff --git a/unilabos/registry/resources/bioyond/bottles.yaml b/unilabos/registry/resources/bioyond/bottles.yaml deleted file mode 100644 index b8865100..00000000 --- a/unilabos/registry/resources/bioyond/bottles.yaml +++ /dev/null @@ -1,151 +0,0 @@ -YB_jia_yang_tou_da: - category: - - yb3 - class: - module: unilabos.resources.bioyond.bottles:YB_jia_yang_tou_da - type: pylabrobot - handles: [] - icon: '' - init_param_schema: {} - version: 1.0.0 - -YB_Liquid_Vial: - category: - - bottles - class: - module: unilabos.resources.bioyond.bottles:YB_Liquid_Vial - type: pylabrobot - handles: [] - icon: '' - init_param_schema: {} - version: 1.0.0 -YB_Reagent_Bottle: - category: - - bottles - class: - module: unilabos.resources.bioyond.bottles:YB_Reagent_Bottle - type: pylabrobot - handles: [] - icon: '' - init_param_schema: {} - version: 1.0.0 -YB_Solid_Stock: - category: - - bottles - class: - module: unilabos.resources.bioyond.bottles:YB_Solid_Stock - type: pylabrobot - handles: [] - icon: '' - init_param_schema: {} - version: 1.0.0 -YB_Solid_Vial: - category: - - bottles - class: - module: unilabos.resources.bioyond.bottles:YB_Solid_Vial - type: pylabrobot - handles: [] - icon: '' - init_param_schema: {} - version: 1.0.0 -YB_Solution_Beaker: - category: - - bottles - class: - module: unilabos.resources.bioyond.bottles:YB_Solution_Beaker - type: pylabrobot - handles: [] - icon: '' - init_param_schema: {} - version: 1.0.0 -YB_100ml_Liquid_Bottle: - category: - - yb3 - class: - module: unilabos.resources.bioyond.bottles:YB_100ml_Liquid_Bottle - type: pylabrobot - handles: [] - icon: '' - init_param_schema: {} - version: 1.0.0 -YB_Liquid_Bottle: - category: - - yb3 - class: - module: unilabos.resources.bioyond.bottles:YB_Liquid_Bottle - type: pylabrobot - handles: [] - icon: '' - init_param_schema: {} - version: 1.0.0 -YB_High_Viscosity_Liquid_Bottle: - category: - - yb3 - class: - module: unilabos.resources.bioyond.bottles:YB_High_Viscosity_Liquid_Bottle - type: pylabrobot - handles: [] - icon: '' - init_param_schema: {} - version: 1.0.0 -YB_Large_Dispense_Head: - category: - - yb3 - class: - module: unilabos.resources.bioyond.bottles:YB_Large_Dispense_Head - type: pylabrobot - handles: [] - icon: '' - init_param_schema: {} - version: 1.0.0 -YB_5ml_Dispensing_Vial: - category: - - yb3 - class: - module: unilabos.resources.bioyond.bottles:YB_5ml_Dispensing_Vial - type: pylabrobot - handles: [] - icon: '' - init_param_schema: {} - version: 1.0.0 -YB_20ml_Dispensing_Vial: - category: - - yb3 - class: - module: unilabos.resources.bioyond.bottles:YB_20ml_Dispensing_Vial - type: pylabrobot - handles: [] - icon: '' - init_param_schema: {} - version: 1.0.0 -YB_Small_Solution_Bottle: - category: - - yb3 - class: - module: unilabos.resources.bioyond.bottles:YB_Small_Solution_Bottle - type: pylabrobot - handles: [] - icon: '' - init_param_schema: {} - version: 1.0.0 -YB_Large_Solution_Bottle: - category: - - yb3 - class: - module: unilabos.resources.bioyond.bottles:YB_Large_Solution_Bottle - type: pylabrobot - handles: [] - icon: '' - init_param_schema: {} - version: 1.0.0 -YB_Pipette_Tip: - category: - - yb3 - class: - module: unilabos.resources.bioyond.bottles:YB_Pipette_Tip - type: pylabrobot - handles: [] - icon: '' - init_param_schema: {} - version: 1.0.0 diff --git a/unilabos/resources/bioyond/bottle_carriers.py b/unilabos/resources/bioyond/YB_bottle_carriers.py similarity index 89% rename from unilabos/resources/bioyond/bottle_carriers.py rename to unilabos/resources/bioyond/YB_bottle_carriers.py index 76e3a935..a4a36013 100644 --- a/unilabos/resources/bioyond/bottle_carriers.py +++ b/unilabos/resources/bioyond/YB_bottle_carriers.py @@ -1,18 +1,9 @@ from pylabrobot.resources import create_homogeneous_resources, Coordinate, ResourceHolder, create_ordered_items_2d from unilabos.resources.itemized_carrier import Bottle, BottleCarrier -from unilabos.resources.bioyond.bottles import ( - YB_Solid_Stock, - YB_Solid_Vial, - YB_Liquid_Vial, - YB_Solution_Beaker, - YB_Reagent_Bottle, - YB_5ml_Dispensing_Vial, - YB_20ml_Dispensing_Vial, - YB_Small_Solution_Bottle, - YB_Large_Solution_Bottle, - YB_Large_Dispense_Head, - YB_Pipette_Tip +from unilabos.resources.bioyond.YB_bottles import ( + YB_jia_yang_tou_da, + YB_ye_Bottle ) # 命名约定:试剂瓶-Bottle,烧杯-Beaker,烧瓶-Flask,小瓶-Vial @@ -207,10 +198,9 @@ def YB_6VialCarrier(name: str) -> BottleCarrier: carrier[i] = YB_Liquid_Vial(f"{name}_liquidvial_{ordering[i]}") return carrier - +"""1瓶载架 - 单个中央位置""" def YB_1BottleCarrier(name: str) -> BottleCarrier: - """1瓶载架 - 单个中央位置""" - + # 载架尺寸 (mm) carrier_size_x = 127.8 carrier_size_y = 85.5 @@ -241,49 +231,13 @@ def YB_1BottleCarrier(name: str) -> BottleCarrier: carrier.num_items_x = 1 carrier.num_items_y = 1 carrier.num_items_z = 1 - carrier[0] = YB_Reagent_Bottle(f"{name}_flask_1") - return carrier - - -def YB_1FlaskCarrier(name: str) -> BottleCarrier: - """1瓶载架 - 单个中央位置""" - - # 载架尺寸 (mm) - carrier_size_x = 127.8 - carrier_size_y = 85.5 - carrier_size_z = 20.0 - - # 烧杯尺寸 - beaker_diameter = 70.0 - - # 计算中央位置 - center_x = (carrier_size_x - beaker_diameter) / 2 - center_y = (carrier_size_y - beaker_diameter) / 2 - center_z = 5.0 - - carrier = BottleCarrier( - name=name, - size_x=carrier_size_x, - size_y=carrier_size_y, - size_z=carrier_size_z, - sites=create_homogeneous_resources( - klass=ResourceHolder, - locations=[Coordinate(center_x, center_y, center_z)], - resource_size_x=beaker_diameter, - resource_size_y=beaker_diameter, - name_prefix=name, - ), - model="1FlaskCarrier", - ) - carrier.num_items_x = 1 - carrier.num_items_y = 1 - carrier.num_items_z = 1 - carrier[0] = YB_Reagent_Bottle(f"{name}_bottle_1") + carrier[0] = YB_ye_Bottle(f"{name}_flask_1") return carrier +"""5ml分液瓶板 - 4x2布局,8个位置""" def YB_6x5ml_DispensingVialCarrier(name: str) -> BottleCarrier: - """5ml分液瓶板 - 4x2布局,8个位置""" + # 载架尺寸 (mm) carrier_size_x = 127.8 @@ -331,9 +285,9 @@ def YB_6x5ml_DispensingVialCarrier(name: str) -> BottleCarrier: carrier[i] = YB_5ml_Dispensing_Vial(f"{name}_vial_{ordering[i]}") return carrier - +"""20ml分液瓶板 - 4x2布局,8个位置""" def YB_6x20ml_DispensingVialCarrier(name: str) -> BottleCarrier: - """20ml分液瓶板 - 4x2布局,8个位置""" + # 载架尺寸 (mm) carrier_size_x = 127.8 @@ -381,9 +335,9 @@ def YB_6x20ml_DispensingVialCarrier(name: str) -> BottleCarrier: carrier[i] = YB_20ml_Dispensing_Vial(f"{name}_vial_{ordering[i]}") return carrier - +"""配液瓶(小)板 - 4x2布局,8个位置""" def YB_6x_SmallSolutionBottleCarrier(name: str) -> BottleCarrier: - """配液瓶(小)板 - 4x2布局,8个位置""" + # 载架尺寸 (mm) carrier_size_x = 127.8 @@ -481,10 +435,9 @@ def YB_4x_LargeSolutionBottleCarrier(name: str) -> BottleCarrier: carrier[i] = YB_Large_Solution_Bottle(f"{name}_bottle_{ordering[i]}") return carrier - -def YB_6x_LargeDispenseHeadCarrier(name: str) -> BottleCarrier: - """加样头(大)板 - 1x1布局,1个位置""" - +"""加样头(大)板 - 1x1布局,1个位置""" +def YB_jia_yang_tou_da_1X1_carrier(name: str) -> BottleCarrier: + # 载架尺寸 (mm) carrier_size_x = 127.8 carrier_size_y = 85.5 @@ -526,7 +479,7 @@ def YB_6x_LargeDispenseHeadCarrier(name: str) -> BottleCarrier: carrier.num_items_x = 1 carrier.num_items_y = 1 carrier.num_items_z = 1 - carrier[0] = YB_Large_Dispense_Head(f"{name}_head_1") + carrier[0] = YB_jia_yang_tou_da(f"{name}_head_1") return carrier diff --git a/unilabos/resources/bioyond/YB_bottles.py b/unilabos/resources/bioyond/YB_bottles.py new file mode 100644 index 00000000..f38dc360 --- /dev/null +++ b/unilabos/resources/bioyond/YB_bottles.py @@ -0,0 +1,38 @@ +from unilabos.resources.itemized_carrier import Bottle, BottleCarrier +# 工厂函数 + +"""加样头(大)""" +def YB_jia_yang_tou_da( + 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", + ) + +"""液1x1""" +def YB_ye_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", + ) diff --git a/unilabos/resources/bioyond/YB_warehouses.py b/unilabos/resources/bioyond/YB_warehouses.py new file mode 100644 index 00000000..c546759d --- /dev/null +++ b/unilabos/resources/bioyond/YB_warehouses.py @@ -0,0 +1,160 @@ +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/bioyond/bottle_carriers copy.py b/unilabos/resources/bioyond/bottle_carriers copy.py deleted file mode 100644 index a3b0044e..00000000 --- a/unilabos/resources/bioyond/bottle_carriers copy.py +++ /dev/null @@ -1,148 +0,0 @@ -from pylabrobot.resources import create_homogeneous_resources, Coordinate, ResourceHolder, create_ordered_items_2d - -from unilabos.resources.itemized_carrier import Bottle, BottleCarrier -from unilabos.resources.bioyond.bottles import ( - YB_jia_yang_tou_da, -) -# 命名约定:试剂瓶-Bottle,烧杯-Beaker,烧瓶-Flask,小瓶-Vial - - - - - -def YB_jia_yang_tou_da_1X1_carrier(name: str) -> BottleCarrier: - """加样头(大)板 - 1x1布局,1个位置""" - - # 载架尺寸 (mm) - carrier_size_x = 127.8 - carrier_size_y = 85.5 - carrier_size_z = 95.0 - - # 瓶位尺寸 - bottle_diameter = 35.0 - bottle_spacing_x = 42.0 # X方向间距 - bottle_spacing_y = 35.0 # Y方向间距 - - # 计算起始位置 (居中排列) - start_x = (carrier_size_x - (1 - 1) * bottle_spacing_x - bottle_diameter) / 2 - start_y = (carrier_size_y - (1 - 1) * bottle_spacing_y - bottle_diameter) / 2 - - sites = create_ordered_items_2d( - klass=ResourceHolder, - num_items_x=1, - num_items_y=1, - dx=start_x, - dy=start_y, - dz=5.0, - item_dx=bottle_spacing_x, - item_dy=bottle_spacing_y, - size_x=bottle_diameter, - size_y=bottle_diameter, - size_z=carrier_size_z, - ) - for k, v in sites.items(): - v.name = f"{name}_{v.name}" - - carrier = BottleCarrier( - name=name, - size_x=carrier_size_x, - size_y=carrier_size_y, - size_z=carrier_size_z, - sites=sites, - model="YB_1X1_jia_yang_tou_da_carrier", - ) - carrier.num_items_x = 1 - carrier.num_items_y = 1 - carrier.num_items_z = 1 - carrier[0] = YB_jia_yang_tou_da(f"{name}_head_1") - return carrier - - -def BIOYOND_PolymerStation_AdapterBlock(name: str) -> BottleCarrier: - """适配器块 - 单个中央位置""" - - # 载架尺寸 (mm) - carrier_size_x = 127.8 - carrier_size_y = 85.5 - carrier_size_z = 30.0 - - # 适配器尺寸 - adapter_diameter = 80.0 - - # 计算中央位置 - center_x = (carrier_size_x - adapter_diameter) / 2 - center_y = (carrier_size_y - adapter_diameter) / 2 - center_z = 0.0 - - carrier = BottleCarrier( - name=name, - size_x=carrier_size_x, - size_y=carrier_size_y, - size_z=carrier_size_z, - sites=create_homogeneous_resources( - klass=ResourceHolder, - locations=[Coordinate(center_x, center_y, center_z)], - resource_size_x=adapter_diameter, - resource_size_y=adapter_diameter, - name_prefix=name, - ), - model="AdapterBlock", - ) - carrier.num_items_x = 1 - carrier.num_items_y = 1 - carrier.num_items_z = 1 - # 适配器块本身不包含瓶子,只是一个支撑结构 - return carrier - - -def BIOYOND_PolymerStation_TipBox(name: str) -> BottleCarrier: - """枪头盒 - 8x12布局,96个位置""" - - # 载架尺寸 (mm) - carrier_size_x = 127.8 - carrier_size_y = 85.5 - carrier_size_z = 55.0 - - # 枪头尺寸 - tip_diameter = 10.0 - tip_spacing_x = 9.0 # X方向间距 - tip_spacing_y = 9.0 # Y方向间距 - - # 计算起始位置 (居中排列) - start_x = (carrier_size_x - (12 - 1) * tip_spacing_x - tip_diameter) / 2 - start_y = (carrier_size_y - (8 - 1) * tip_spacing_y - tip_diameter) / 2 - - sites = create_ordered_items_2d( - klass=ResourceHolder, - num_items_x=12, - num_items_y=8, - dx=start_x, - dy=start_y, - dz=5.0, - item_dx=tip_spacing_x, - item_dy=tip_spacing_y, - size_x=tip_diameter, - size_y=tip_diameter, - size_z=carrier_size_z, - ) - for k, v in sites.items(): - v.name = f"{name}_{v.name}" - - carrier = BottleCarrier( - name=name, - size_x=carrier_size_x, - size_y=carrier_size_y, - size_z=carrier_size_z, - sites=sites, - model="TipBox", - ) - carrier.num_items_x = 12 - carrier.num_items_y = 8 - carrier.num_items_z = 1 - # 创建96个枪头 - for i in range(96): - row = chr(65 + i // 12) # A-H - col = (i % 12) + 1 # 1-12 - carrier[i] = BIOYOND_PolymerStation_Pipette_Tip(f"{name}_tip_{row}{col}") - return carrier - diff --git a/unilabos/resources/bioyond/bottles copy.py b/unilabos/resources/bioyond/bottles copy.py deleted file mode 100644 index 2504c377..00000000 --- a/unilabos/resources/bioyond/bottles copy.py +++ /dev/null @@ -1,24 +0,0 @@ -from unilabos.resources.itemized_carrier import Bottle, BottleCarrier -# 工厂函数 - - -def YB_jia_yang_tou_da( - name: str, - diameter: float = 35.0, - height: float = 90.0, - max_volume: float = 50000.0, # 50mL - code: str = None, - barcode: str = None, -) -> Bottle: - """创建加样头(大)""" - return Bottle( - name=name, - diameter=diameter, - height=height, - max_volume=max_volume, - barcode=barcode, - code=code, - model="YB_jia_yang_tou_da", - ) - -