ami-iit / robot-log-visualizer

Visualizer to display the data logged with YarpRobotLoggerDevice
BSD 3-Clause "New" or "Revised" License
22 stars 4 forks source link

Selecting multiple signal by swiping does not update plot #78

Open giotherobot opened 7 months ago

giotherobot commented 7 months ago

I was trying to select multiple signals at the same time by dragging the mouse on the signal list. This works in the sense that I can see the selection happen in the signal list (the signals get highlited), but the plot does not seem to update until a single signal gets selected/deselected.

giotherobot commented 7 months ago

Kooha-2024-02-02-10-53-28.webm

S-Dafarra commented 6 months ago

I wonder whether the signal is sent by Qt in this case.

You can try using itemSelectionChanged instead of itemClicked in https://github.com/ami-iit/robot-log-visualizer/blob/996e0d4f22aa48eb2a7b41dc9133115f9494a8f1/robot_log_visualizer/ui/gui.py#L201

Reference doc: https://doc.qt.io/qt-6/qtreewidget.html#itemSelectionChanged

giotherobot commented 6 months ago

Sadly it is not as easy as a simple signal swap, I tried but the selection mechanism breaks when there are multiple plots:

Traceback (most recent call last):
  File "/home/giovannif/robot-log-visualizer/robot_log_visualizer/ui/gui.py", line 483, in plotTabBar_currentChanged
    for active_path_str in self.plot_items[index].canvas.active_paths.keys():
RuntimeError: dictionary changed size during iteration

With a single plot it works fine.