mirror of
https://github.com/dptech-corp/Uni-Lab-OS.git
synced 2025-12-17 13:01:12 +00:00
Compare commits
4 Commits
a061bc2942
...
workstatio
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6413828c59 | ||
|
|
5072f00836 | ||
|
|
9dfbe3246e | ||
|
|
bef69db3b6 |
@@ -90,9 +90,48 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"data": {}
|
"data": {}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "NewareTester",
|
||||||
|
"name": "新威电池测试系统",
|
||||||
|
"parent": null,
|
||||||
|
"children": [],
|
||||||
|
"type": "device",
|
||||||
|
"class": "neware_battery_test_system",
|
||||||
|
"config": {
|
||||||
|
"ip": "127.0.0.1",
|
||||||
|
"port": 502,
|
||||||
|
"machine_id": 1,
|
||||||
|
"devtype": "27",
|
||||||
|
"timeout": 20,
|
||||||
|
"size_x": 500.0,
|
||||||
|
"size_y": 500.0,
|
||||||
|
"size_z": 2000.0
|
||||||
|
},
|
||||||
|
"position": {
|
||||||
|
"size": {
|
||||||
|
"height": 1600,
|
||||||
|
"width": 1200,
|
||||||
|
"depth": 800
|
||||||
|
},
|
||||||
|
"position": {
|
||||||
|
"x": 1500,
|
||||||
|
"y": 0,
|
||||||
|
"z": 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"data": {
|
||||||
|
"功能说明": "新威电池测试系统,提供720通道监控和CSV批量提交功能",
|
||||||
|
"监控功能": "支持720个通道的实时状态监控、2盘电池物料管理、状态导出等",
|
||||||
|
"提交功能": "通过submit_from_csv action从CSV文件批量提交测试任务"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"links": []
|
"links": []
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -24,6 +24,18 @@ from unilabos.utils.log import logger
|
|||||||
from unilabos.registry.registry import lab_registry
|
from unilabos.registry.registry import lab_registry
|
||||||
from unilabos.ros.nodes.base_device_node import ROS2DeviceNode
|
from unilabos.ros.nodes.base_device_node import ROS2DeviceNode
|
||||||
|
|
||||||
|
|
||||||
|
class device(BIOYOND_YB_Deck):
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def deserialize(cls, data, allow_marshal=False): # type: ignore[override]
|
||||||
|
patched = dict(data)
|
||||||
|
if patched.get("type") == "device":
|
||||||
|
patched["type"] = "Deck"
|
||||||
|
if patched.get("category") == "device":
|
||||||
|
patched["category"] = "deck"
|
||||||
|
return super().deserialize(patched, allow_marshal=allow_marshal)
|
||||||
|
|
||||||
def _iso_local_now_ms() -> str:
|
def _iso_local_now_ms() -> str:
|
||||||
# 文档要求:到毫秒 + Z,例如 2025-08-15T05:43:22.814Z
|
# 文档要求:到毫秒 + Z,例如 2025-08-15T05:43:22.814Z
|
||||||
dt = datetime.now()
|
dt = datetime.now()
|
||||||
@@ -409,7 +421,8 @@ class BioyondCellWorkstation(BioyondWorkstation):
|
|||||||
result = self.wait_for_order_finish(order_code)
|
result = self.wait_for_order_finish(order_code)
|
||||||
return {
|
return {
|
||||||
"api_response": response,
|
"api_response": response,
|
||||||
"order_finish": result
|
"order_finish": result,
|
||||||
|
"items": items,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1337,7 +1350,7 @@ class BioyondCellWorkstation(BioyondWorkstation):
|
|||||||
return result.return_info
|
return result.return_info
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def run_feeding_stage(self) -> Dict[str, List[Dict[str, Any]]]:
|
def run_feeding_stage(self) -> Dict[str, Any]:
|
||||||
self.create_sample(
|
self.create_sample(
|
||||||
board_type="配液瓶(小)板",
|
board_type="配液瓶(小)板",
|
||||||
bottle_type="配液瓶(小)",
|
bottle_type="配液瓶(小)",
|
||||||
@@ -1353,11 +1366,15 @@ class BioyondCellWorkstation(BioyondWorkstation):
|
|||||||
warehouse_name="手动堆栈"
|
warehouse_name="手动堆栈"
|
||||||
)
|
)
|
||||||
self.scheduler_start()
|
self.scheduler_start()
|
||||||
self.auto_feeding4to3(
|
feeding_task = self.auto_feeding4to3(
|
||||||
xlsx_path="/Users/sml/work/Unilab/Uni-Lab-OS/unilabos/devices/workstation/bioyond_studio/bioyond_cell/material_template.xlsx"
|
xlsx_path="/Users/sml/work/Unilab/Uni-Lab-OS/unilabos/devices/workstation/bioyond_studio/bioyond_cell/material_template.xlsx"
|
||||||
)
|
)
|
||||||
feeding_materials = self._fetch_bioyond_materials()
|
feeding_materials = self._fetch_bioyond_materials()
|
||||||
return {"feeding_materials": feeding_materials}
|
return {
|
||||||
|
"feeding_materials": feeding_materials,
|
||||||
|
"feeding_items": feeding_task.get("items", []),
|
||||||
|
"feeding_task": feeding_task,
|
||||||
|
}
|
||||||
|
|
||||||
def run_liquid_preparation_stage(
|
def run_liquid_preparation_stage(
|
||||||
self,
|
self,
|
||||||
|
|||||||
@@ -674,10 +674,15 @@ def resource_bioyond_to_plr(bioyond_materials: list[dict], type_mapping: Dict[st
|
|||||||
for loc in material.get("locations", []):
|
for loc in material.get("locations", []):
|
||||||
if hasattr(deck, "warehouses") and loc.get("whName") in deck.warehouses:
|
if hasattr(deck, "warehouses") and loc.get("whName") in deck.warehouses:
|
||||||
warehouse = deck.warehouses[loc["whName"]]
|
warehouse = deck.warehouses[loc["whName"]]
|
||||||
|
num_x = getattr(warehouse, "num_items_x", 0) or 0
|
||||||
|
num_y = getattr(warehouse, "num_items_y", 0) or 0
|
||||||
|
num_z = getattr(warehouse, "num_items_z", 0) or 0
|
||||||
|
if num_x <= 0 or num_y <= 0 or num_z <= 0:
|
||||||
|
continue
|
||||||
idx = (
|
idx = (
|
||||||
(loc.get("y", 0) - 1) * warehouse.num_items_x * warehouse.num_items_y
|
(loc.get("z", 0) - 1) * num_x * num_y
|
||||||
+ (loc.get("x", 0) - 1) * warehouse.num_items_x
|
+ (loc.get("y", 0) - 1) * num_x
|
||||||
+ (loc.get("z", 0) - 1)
|
+ (loc.get("x", 0) - 1)
|
||||||
)
|
)
|
||||||
if 0 <= idx < warehouse.capacity:
|
if 0 <= idx < warehouse.capacity:
|
||||||
if warehouse[idx] is None or isinstance(warehouse[idx], ResourceHolder):
|
if warehouse[idx] is None or isinstance(warehouse[idx], ResourceHolder):
|
||||||
|
|||||||
Reference in New Issue
Block a user