mirror of
https://github.com/dptech-corp/Uni-Lab-OS.git
synced 2025-12-17 21:11:12 +00:00
add standardized BIOYOND resources: bottle_carrier, bottle
This commit is contained in:
0
unilabos/resources/bioyond/__init__.py
Normal file
0
unilabos/resources/bioyond/__init__.py
Normal file
50
unilabos/resources/bioyond/bottle.py
Normal file
50
unilabos/resources/bioyond/bottle.py
Normal file
@@ -0,0 +1,50 @@
|
||||
from unilabos.resources.bottle_carrier import Bottle, BottleCarrier
|
||||
# 工厂函数
|
||||
|
||||
|
||||
def create_powder_bottle(
|
||||
name: str,
|
||||
diameter: float = 30.0,
|
||||
height: float = 50.0,
|
||||
max_volume: float = 50000.0, # 50mL
|
||||
) -> Bottle:
|
||||
"""创建粉末瓶"""
|
||||
return Bottle(
|
||||
name=name,
|
||||
diameter=diameter,
|
||||
height=height,
|
||||
max_volume=max_volume,
|
||||
category="powder_bottle",
|
||||
)
|
||||
|
||||
|
||||
def create_solution_beaker(
|
||||
name: str,
|
||||
diameter: float = 80.0,
|
||||
height: float = 100.0,
|
||||
max_volume: float = 500000.0, # 500mL
|
||||
) -> Bottle:
|
||||
"""创建溶液烧杯"""
|
||||
return Bottle(
|
||||
name=name,
|
||||
diameter=diameter,
|
||||
height=height,
|
||||
max_volume=max_volume,
|
||||
category="solution_beaker",
|
||||
)
|
||||
|
||||
|
||||
def create_reagent_bottle(
|
||||
name: str,
|
||||
diameter: float = 20.0,
|
||||
height: float = 40.0,
|
||||
max_volume: float = 15000.0, # 15mL
|
||||
) -> Bottle:
|
||||
"""创建试剂瓶"""
|
||||
return Bottle(
|
||||
name=name,
|
||||
diameter=diameter,
|
||||
height=height,
|
||||
max_volume=max_volume,
|
||||
category="reagent_bottle",
|
||||
)
|
||||
78
unilabos/resources/bioyond/bottle_carrier.py
Normal file
78
unilabos/resources/bioyond/bottle_carrier.py
Normal file
@@ -0,0 +1,78 @@
|
||||
from unilabos.resources.bottle_carrier import Bottle, BottleCarrier
|
||||
from pylabrobot.resources import create_homogeneous_resources, Coordinate, ResourceHolder
|
||||
|
||||
|
||||
# 命名约定:试剂瓶-Bottle,烧杯-Beaker,烧瓶-Flask,小瓶-Vial
|
||||
|
||||
def BIOYOND_Electrolyte_6VialCarrier(name: str) -> BottleCarrier:
|
||||
"""6瓶载架 - 2x3布局"""
|
||||
|
||||
# 载架尺寸 (mm)
|
||||
carrier_size_x = 127.8
|
||||
carrier_size_y = 85.5
|
||||
carrier_size_z = 50.0
|
||||
|
||||
# 瓶位尺寸
|
||||
bottle_diameter = 30.0
|
||||
bottle_spacing_x = 42.0 # X方向间距
|
||||
bottle_spacing_y = 35.0 # Y方向间距
|
||||
|
||||
# 计算起始位置 (居中排列)
|
||||
start_x = (carrier_size_x - (3 - 1) * bottle_spacing_x - bottle_diameter) / 2
|
||||
start_y = (carrier_size_y - (2 - 1) * bottle_spacing_y - bottle_diameter) / 2
|
||||
|
||||
# 创建6个位置坐标 (2行 x 3列)
|
||||
locations = []
|
||||
for row in range(2):
|
||||
for col in range(3):
|
||||
x = start_x + col * bottle_spacing_x
|
||||
y = start_y + row * bottle_spacing_y
|
||||
z = 5.0 # 架位底部
|
||||
locations.append(Coordinate(x, y, z))
|
||||
|
||||
return 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=locations,
|
||||
resource_size_x=bottle_diameter,
|
||||
resource_size_y=bottle_diameter,
|
||||
name_prefix=name,
|
||||
),
|
||||
model="BIOYOND_Electrolyte_6VialCarrier",
|
||||
)
|
||||
|
||||
|
||||
def BIOYOND_Electrolyte_1BottleCarrier(name: str) -> BottleCarrier:
|
||||
"""1瓶载架 - 单个中央位置"""
|
||||
|
||||
# 载架尺寸 (mm)
|
||||
carrier_size_x = 127.8
|
||||
carrier_size_y = 85.5
|
||||
carrier_size_z = 100.0
|
||||
|
||||
# 烧杯尺寸
|
||||
beaker_diameter = 80.0
|
||||
|
||||
# 计算中央位置
|
||||
center_x = (carrier_size_x - beaker_diameter) / 2
|
||||
center_y = (carrier_size_y - beaker_diameter) / 2
|
||||
center_z = 5.0
|
||||
|
||||
return 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="BIOYOND_Electrolyte_1BottleCarrier",
|
||||
)
|
||||
54
unilabos/resources/bioyond/warehouse.py
Normal file
54
unilabos/resources/bioyond/warehouse.py
Normal file
@@ -0,0 +1,54 @@
|
||||
from unilabos.resources.warehouse import WareHouse
|
||||
|
||||
|
||||
def bioyond_warehouse_1x4x4(name: str) -> WareHouse:
|
||||
"""创建BioYond 4x1x4仓库"""
|
||||
return WareHouse(
|
||||
name=name,
|
||||
num_items_x=1,
|
||||
num_items_y=4,
|
||||
num_items_z=4,
|
||||
dx=137.0,
|
||||
dy=96.0,
|
||||
dz=120.0,
|
||||
item_dx=10.0,
|
||||
item_dy=10.0,
|
||||
item_dz=10.0,
|
||||
category="warehouse",
|
||||
)
|
||||
|
||||
|
||||
def bioyond_warehouse_1x3x2(name: str) -> WareHouse:
|
||||
"""创建BioYond 3x1x2仓库"""
|
||||
return WareHouse(
|
||||
name=name,
|
||||
num_items_x=1,
|
||||
num_items_y=3,
|
||||
num_items_z=2,
|
||||
dx=137.0,
|
||||
dy=96.0,
|
||||
dz=120.0,
|
||||
item_dx=10.0,
|
||||
item_dy=10.0,
|
||||
item_dz=10.0,
|
||||
category="warehouse",
|
||||
removed_positions=None
|
||||
)
|
||||
|
||||
|
||||
def bioyond_warehouse_liquid_and_lid_handling(name: str) -> WareHouse:
|
||||
"""创建BioYond开关盖加液模块台面"""
|
||||
return WareHouse(
|
||||
name=name,
|
||||
num_items_x=2,
|
||||
num_items_y=5,
|
||||
num_items_z=1,
|
||||
dx=137.0,
|
||||
dy=96.0,
|
||||
dz=120.0,
|
||||
item_dx=10.0,
|
||||
item_dy=10.0,
|
||||
item_dz=10.0,
|
||||
category="warehouse",
|
||||
removed_positions=None
|
||||
)
|
||||
Reference in New Issue
Block a user