mirror of
https://github.com/dptech-corp/Uni-Lab-OS.git
synced 2026-02-06 06:25:06 +00:00
更新axis等参数
This commit is contained in:
@@ -429,6 +429,20 @@ def resource_ulab_to_plr(resource: dict, plr_model=False) -> "ResourcePLR":
|
||||
|
||||
|
||||
def resource_plr_to_ulab(resource_plr: "ResourcePLR", parent_name: str = None):
|
||||
def replace_plr_type_to_ulab(source: str):
|
||||
replace_info = {
|
||||
"plate": "plate",
|
||||
"well": "well",
|
||||
"tip_spot": "container",
|
||||
"trash": "container",
|
||||
"deck": "deck",
|
||||
"tip_rack": "container",
|
||||
}
|
||||
if source in replace_info:
|
||||
return replace_info[source]
|
||||
else:
|
||||
print("转换pylabrobot的时候,出现未知类型", source)
|
||||
return "container"
|
||||
def resource_plr_to_ulab_inner(d: dict, all_states: dict) -> dict:
|
||||
r = {
|
||||
"id": d["name"],
|
||||
@@ -436,7 +450,7 @@ def resource_plr_to_ulab(resource_plr: "ResourcePLR", parent_name: str = None):
|
||||
"sample_id": None,
|
||||
"children": [resource_plr_to_ulab_inner(child, all_states) for child in d["children"]],
|
||||
"parent": d["parent_name"] if d["parent_name"] else parent_name if parent_name else None,
|
||||
"type": "device", # FIXME plr自带的type是python class name
|
||||
"type": replace_plr_type_to_ulab(d.get("category")), # FIXME plr自带的type是python class name
|
||||
"class": d.get("class", ""),
|
||||
"position": (
|
||||
{"x": d["location"]["x"], "y": d["location"]["y"], "z": d["location"]["z"]}
|
||||
|
||||
Reference in New Issue
Block a user