Skip to content

Commit

Permalink
🐛 Fix the update of the variable tree when the content of the plot ba…
Browse files Browse the repository at this point in the history
…r changes
  • Loading branch information
GiulioRomualdi committed Sep 25, 2023
1 parent e34c2cc commit f44ba67
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion robot_log_visualizer/ui/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,12 +459,19 @@ def plotTabBar_currentChanged(self, index):
self.ui.variableTreeWidget.clearSelection()
for active_path_str in self.plot_items[index].canvas.active_paths.keys():
path = active_path_str.split("/")

# select the item in the tree from the path
item = self.ui.variableTreeWidget.topLevelItem(0)
for subpath in path[1:]:
for subpath in path[1:-1]:

# find the item given its name
for child_id in range(item.childCount()):
if item.child(child_id).text(0) == subpath:
item = item.child(child_id)
break

# the latest value is a number
item = item.child(int(path[-1]))
item.setSelected(True)

@pyqtSlot()
Expand Down

0 comments on commit f44ba67

Please sign in to comment.