create warehouse by factory func

This commit is contained in:
Junhan Chang
2025-09-30 11:57:34 +08:00
parent 9bbae96447
commit 7b426ed5ae
6 changed files with 169 additions and 72 deletions

View File

@@ -1,12 +1,21 @@
from pylabrobot.resources import Deck, Coordinate
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
class BIOYOND_PolymerReactionStation_Deck(Deck):
def __init__(self, name: str = "PolymerReactionStation_Deck") -> None:
def __init__(
self,
name: str = "PolymerReactionStation_Deck",
size_x: float = 2700.0,
size_y: float = 1080.0,
size_z: float = 1500.0,
category: str = "deck",
setup: bool = False
) -> None:
super().__init__(name=name, size_x=2700.0, size_y=1080.0, size_z=1500.0)
self.setup()
if setup:
self.setup()
def setup(self) -> None:
# 添加仓库
@@ -20,7 +29,7 @@ class BIOYOND_PolymerReactionStation_Deck(Deck):
"堆栈2": Coordinate(2550.0, 650.0, 0.0),
"站内试剂存放堆栈": Coordinate(800.0, 475.0, 0.0),
}
self.warehouses["站内试剂存放堆栈"].rotation = 90.0
self.warehouses["站内试剂存放堆栈"].rotation = Rotation(z=90)
for warehouse_name, warehouse in self.warehouses.items():
self.assign_child_resource(warehouse, location=self.warehouse_locations[warehouse_name])

View File

@@ -1,9 +1,9 @@
from unilabos.resources.warehouse import WareHouse
from unilabos.resources.warehouse import WareHouse, warehouse_factory
def bioyond_warehouse_1x4x4(name: str) -> WareHouse:
"""创建BioYond 4x1x4仓库"""
return WareHouse(
return 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(
return warehouse_factory(
name=name,
num_items_x=1,
num_items_y=4,
@@ -38,7 +38,7 @@ def bioyond_warehouse_1x4x2(name: str) -> WareHouse:
def bioyond_warehouse_liquid_and_lid_handling(name: str) -> WareHouse:
"""创建BioYond开关盖加液模块台面"""
return WareHouse(
return warehouse_factory(
name=name,
num_items_x=2,
num_items_y=5,