Skip to content
Snippets Groups Projects
Commit 3f3324d6 authored by Tammo Jan Dijkema's avatar Tammo Jan Dijkema
Browse files

Be fault tolerant

parent 38481d4f
No related branches found
No related tags found
No related merge requests found
...@@ -109,7 +109,11 @@ class PowerPlotMainWindow(QMainWindow): ...@@ -109,7 +109,11 @@ class PowerPlotMainWindow(QMainWindow):
# Get metadata and ignore it # Get metadata and ignore it
header_lines = [] header_lines = []
while True: while True:
# TODO: this is blocking and freezes the UI, could
# be refactored to use the QT notification mechanism
line = sys.stdin.readline() line = sys.stdin.readline()
if len(line.strip()) == 0:
continue
header_lines.append(line) header_lines.append(line)
if line[0] != "#": if line[0] != "#":
column_names = [name.strip() for name in line.split()] column_names = [name.strip() for name in line.split()]
...@@ -163,6 +167,10 @@ class PowerPlotMainWindow(QMainWindow): ...@@ -163,6 +167,10 @@ class PowerPlotMainWindow(QMainWindow):
continue continue
self.output_counter += 1 self.output_counter += 1
values = line.split(",") values = line.split(",")
if not values[0][0].isnumeric():
print("Skipping line: " + line.strip())
print(values[0], values[0].isnumeric())
continue
time_now = float(values[0]) time_now = float(values[0])
power_now = float(values[self.col_num]) power_now = float(values[self.col_num])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment