taunoe/tauno-serial-plotter

IndexError: list index out of range

MattKang opened this issue · 3 comments

Getting an error on v1.19

qt.qpa.qgnomeplatform: Could not find color scheme  ""
Qt: Session management error: Could not open network socket
DEBUG:root:self.selected_baudrate =
DEBUG:root:9600
DEBUG:root:ForeverWorker.Run while loop
DEBUG:root:self.plot_exist False
DEBUG:root:self.is_button_connected False
DEBUG:root:before_selected_port 
DEBUG:root:self.ports: 0
DEBUG:root:find_ports: 1
INFO:root:Main selected port changed:
INFO:root:/dev/ttyACM0
INFO:root:Main selected baud index changed:
INFO:root:250000
DEBUG:root:0 Open serial: /dev/ttyACM0 250000
DEBUG:root:1 Open serial: /dev/ttyACM0 250000
DEBUG:root:--> Connect Button.
DEBUG:root:connect: create plot
DEBUG:root:How_many_lines?
DEBUG:root:0 Open serial: /dev/ttyACM0 250000
DEBUG:root:1 Open serial: /dev/ttyACM0 250000
DEBUG:root:try broken_data b'-87,1215,-121.958\n'
DEBUG:root:try incoming_data -46,1214,-121.853

DEBUG:root:if Incoming data -46,1214,-121.853

DEBUG:root:Found: 3 lines
DEBUG:root:Found: 0 labels
DEBUG:root:Init Plot class. With 3 plot lines.
Traceback (most recent call last):
  File "/app/bin/tauno-serial-plotter.py", line 668, in connect_stop
    self.connect()
  File "/app/bin/tauno-serial-plotter.py", line 698, in connect
    self.plot = Plot(self.number_of_lines, self.labels)
  File "/app/bin/tauno-serial-plotter.py", line 339, in __init__
    line = self.serialplot.plot(x=self.x_axis, y=self.y_axis[i], name=self.data_labels[i],
IndexError: list index out of range

Interesting it appears the interface has changed. Is serial output without labels intended to be invalid now? If so, it should probably be indicated with a breaking version bump.

taunoe commented

I updated the code. You can test it.

Thanks seems to have fixed this bug