增加环绕侦察场景适配
This commit is contained in:
@@ -97,6 +97,11 @@ def _add_nodes_and_edges(node: dict, dot, parent_id: str | None = None) -> str:
|
||||
shape = 'ellipse'
|
||||
style = 'filled'
|
||||
fillcolor = '#e1d5e7' # 紫色
|
||||
elif node_type == 'decorator':
|
||||
shape = 'diamond'
|
||||
style = 'filled'
|
||||
fillcolor = '#f5f5f5' # 浅灰
|
||||
border_color = '#333333'
|
||||
|
||||
# 特别标记安全相关节点
|
||||
if node.get('name') in ['battery_above', 'gps_status', 'SafetyMonitor']:
|
||||
@@ -111,6 +116,11 @@ def _add_nodes_and_edges(node: dict, dot, parent_id: str | None = None) -> str:
|
||||
|
||||
# 递归处理子节点
|
||||
children = node.get("children", [])
|
||||
|
||||
# 处理 decorator 类型的 child 字段(单一子节点)
|
||||
if node_type == 'decorator' and 'child' in node:
|
||||
children = [node['child']]
|
||||
|
||||
if not children:
|
||||
return current_id
|
||||
|
||||
|
||||
Reference in New Issue
Block a user