Skip to content

Commit 3ea11a7

Browse files
committed
Use tree instead of stack for the names of the uninit actions
1 parent 8464396 commit 3ea11a7

File tree

1 file changed

+7
-1
lines changed
  • dynamic_stack_decider_visualization/dynamic_stack_decider_visualization

1 file changed

+7
-1
lines changed

dynamic_stack_decider_visualization/dynamic_stack_decider_visualization/dsd_follower.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,9 @@ def to_q_item_model(self):
312312
# Start with the root/bottom of the stack
313313
stack_element = self.stack
314314

315+
# Store the corresponding tree element
316+
tree_element = self.tree
317+
315318
# Go through all stack elements
316319
while stack_element is not None:
317320
# Sanity check
@@ -327,7 +330,7 @@ def to_q_item_model(self):
327330
# Set the text of the item
328331
if stack_element["type"] == "sequence":
329332
# Get the names of all actions
330-
action_names = [element["name"] for element in stack_element["current_action"]]
333+
action_names = [action["name"] for action in tree_element["action_elements"]]
331334
# Join them together and set the text
332335
elem_item.setText("Sequence: " + ", ".join(action_names))
333336
else:
@@ -351,6 +354,9 @@ def to_q_item_model(self):
351354

352355
# Go to next element
353356
stack_element = stack_element["next"]
357+
# Also select the corresponding tree element if there are any
358+
if "children" in tree_element and stack_element is not None:
359+
tree_element = tree_element["children"][stack_element["activation_reason"]]
354360

355361
return model
356362

0 commit comments

Comments
 (0)