diff --git a/power_plot.py b/power_plot.py index 02aa31dbf40f48b97d81ef9bd48208e7cf68af4d..b87aba115c35b70921f107080abb75652082ba89 100755 --- a/power_plot.py +++ b/power_plot.py @@ -109,7 +109,11 @@ class PowerPlotMainWindow(QMainWindow): # Get metadata and ignore it header_lines = [] while True: + # TODO: this is blocking and freezes the UI, could + # be refactored to use the QT notification mechanism line = sys.stdin.readline() + if len(line.strip()) == 0: + continue header_lines.append(line) if line[0] != "#": column_names = [name.strip() for name in line.split()] @@ -163,6 +167,10 @@ class PowerPlotMainWindow(QMainWindow): continue self.output_counter += 1 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]) power_now = float(values[self.col_num])