diff --git a/main.py b/main.py index 7feb00e..775538a 100755 --- a/main.py +++ b/main.py @@ -117,7 +117,7 @@ class MainWindow(FloatLayout): if 'time' in last_point: self.lastTime = float(last_point['time']) if 'exception' in last_point: - self.lastStatus = {'status' : 'error', 'message' : last_point['exception']} + self.lastStatus = {'status' : 'error', 'message' : last_point['exception']} self.lastData = data #if dataThreadDataQueue.qsize(): # Logger.debug('update_last_temperature: ' + str(dataThreadDataQueue.qsize()) + ' items left in queue after ' + str(len(data)) + ' items were taken out') @@ -513,7 +513,11 @@ class PlotWidget(Image): if 'data' in point and 'time' in point and 'temperature' in point['data']: points.append(numpy.array([(point['time'], point['data']['temperature'])], dtype=float, ndmin =2)) - extra_data = numpy.vstack(tuple(points)) + extra_data = numpy.array(list(), dtype = float) + if points: + extra_data = numpy.vstack(tuple(points)) + if not extra_data.any(): + return if not self.data.any(): self.data = extra_data return