Cleanup registry to be easy-understanding (#76)

* delete deprecated mock devices

* rename categories

* combine chromatographic devices

* rename rviz simulation nodes

* organic virtual devices

* parse vessel_id

* run registry completion before merge

---------

Co-authored-by: Xuwznln <18435084+Xuwznln@users.noreply.github.com>
This commit is contained in:
Junhan Chang
2025-08-03 11:21:37 +08:00
committed by GitHub
parent 8beb80f0e7
commit a66369e2c3
41 changed files with 2629 additions and 9445 deletions

View File

@@ -1,5 +1,6 @@
from typing import List, Dict, Any
import networkx as nx
from .utils.vessel_parser import get_vessel
from .pump_protocol import generate_pump_protocol
@@ -181,16 +182,7 @@ def generate_clean_vessel_protocol(
clean_protocol = generate_clean_vessel_protocol(G, {"id": "main_reactor"}, "water", 100.0, 60.0, 2)
"""
# 🔧 核心修改从字典中提取容器ID
# 统一处理vessel参数
if isinstance(vessel, dict):
if "id" not in vessel:
vessel_id = list(vessel.values())[0].get("id", "")
else:
vessel_id = vessel.get("id", "")
vessel_data = vessel.get("data", {})
else:
vessel_id = str(vessel)
vessel_data = G.nodes[vessel_id].get("data", {}) if vessel_id in G.nodes() else {}
vessel_id, vessel_data = get_vessel(vessel)
action_sequence = []