mirror of
https://github.com/dptech-corp/Uni-Lab-OS.git
synced 2026-02-16 04:35:11 +00:00
Compare commits
3 Commits
88ae56806c
...
9d5ed627a2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9d5ed627a2 | ||
|
|
2d0ff87bc8 | ||
|
|
d78475de9a |
@@ -708,6 +708,8 @@ class Registry:
|
|||||||
for status_name, status_type in device_config["class"]["status_types"].items():
|
for status_name, status_type in device_config["class"]["status_types"].items():
|
||||||
device_config["class"]["status_types"][status_name] = status_str_type_mapping[status_type]
|
device_config["class"]["status_types"][status_name] = status_str_type_mapping[status_type]
|
||||||
for action_name, action_config in device_config["class"]["action_value_mappings"].items():
|
for action_name, action_config in device_config["class"]["action_value_mappings"].items():
|
||||||
|
if action_config["type"] not in action_str_type_mapping:
|
||||||
|
continue
|
||||||
action_config["type"] = action_str_type_mapping[action_config["type"]]
|
action_config["type"] = action_str_type_mapping[action_config["type"]]
|
||||||
# 添加内置的驱动命令动作
|
# 添加内置的驱动命令动作
|
||||||
self._add_builtin_actions(device_config, device_id)
|
self._add_builtin_actions(device_config, device_id)
|
||||||
|
|||||||
@@ -639,6 +639,8 @@ def resource_bioyond_to_plr(bioyond_materials: list[dict], type_mapping: Dict[st
|
|||||||
|
|
||||||
# 处理子物料(detail)
|
# 处理子物料(detail)
|
||||||
if material.get("detail") and len(material["detail"]) > 0:
|
if material.get("detail") and len(material["detail"]) > 0:
|
||||||
|
for bottle in reversed(plr_material.children):
|
||||||
|
plr_material.unassign_child_resource(bottle)
|
||||||
child_ids = []
|
child_ids = []
|
||||||
for detail in material["detail"]:
|
for detail in material["detail"]:
|
||||||
number = (
|
number = (
|
||||||
@@ -646,18 +648,15 @@ def resource_bioyond_to_plr(bioyond_materials: list[dict], type_mapping: Dict[st
|
|||||||
+ (detail.get("y", 0) - 1) * plr_material.num_items_y
|
+ (detail.get("y", 0) - 1) * plr_material.num_items_y
|
||||||
+ (detail.get("x", 0) - 1)
|
+ (detail.get("x", 0) - 1)
|
||||||
)
|
)
|
||||||
bottle = plr_material[number]
|
typeName = detail.get("typeName", detail.get("name", ""))
|
||||||
if detail["typeName"] in type_mapping:
|
if typeName in type_mapping:
|
||||||
# plr_material.unassign_child_resource(bottle)
|
bottle = plr_material[number] = initialize_resource(
|
||||||
plr_material.sites[number] = None
|
{"name": f'{detail["name"]}_{number}', "class": type_mapping[typeName][0]}, resource_type=ResourcePLR
|
||||||
plr_material[number] = initialize_resource(
|
|
||||||
{"name": f'{detail["name"]}_{number}', "class": type_mapping[detail["typeName"]][0]}, resource_type=ResourcePLR
|
|
||||||
)
|
)
|
||||||
else:
|
|
||||||
bottle.tracker.liquids = [
|
bottle.tracker.liquids = [
|
||||||
(detail["name"], float(detail.get("quantity", 0)) if detail.get("quantity") else 0)
|
(detail["name"], float(detail.get("quantity", 0)) if detail.get("quantity") else 0)
|
||||||
]
|
]
|
||||||
bottle.code = detail.get("code", "")
|
bottle.code = detail.get("code", "")
|
||||||
else:
|
else:
|
||||||
bottle = plr_material[0] if plr_material.capacity > 0 else plr_material
|
bottle = plr_material[0] if plr_material.capacity > 0 else plr_material
|
||||||
bottle.tracker.liquids = [
|
bottle.tracker.liquids = [
|
||||||
|
|||||||
@@ -164,8 +164,9 @@ class ItemizedCarrier(ResourcePLR):
|
|||||||
break
|
break
|
||||||
if not found:
|
if not found:
|
||||||
raise ValueError(f"Resource {resource} is not assigned to this carrier")
|
raise ValueError(f"Resource {resource} is not assigned to this carrier")
|
||||||
if hasattr(resource, "unassign"):
|
super().unassign_child_resource(resource)
|
||||||
resource.unassign()
|
# if hasattr(resource, "unassign"):
|
||||||
|
# resource.unassign()
|
||||||
|
|
||||||
def get_child_identifier(self, child: ResourcePLR):
|
def get_child_identifier(self, child: ResourcePLR):
|
||||||
"""Get the identifier information for a given child resource.
|
"""Get the identifier information for a given child resource.
|
||||||
|
|||||||
Reference in New Issue
Block a user