fixed crash when an exception is thrown off the bat (eg. can't open serial port)
This commit is contained in:
parent
8efbcd935b
commit
3fe30ed27a
8
main.py
8
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
|
||||
|
|
Loading…
Reference in New Issue