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
4
main.py
4
main.py
|
@ -513,7 +513,11 @@ class PlotWidget(Image):
|
||||||
if 'data' in point and 'time' in point and 'temperature' in point['data']:
|
if 'data' in point and 'time' in point and 'temperature' in point['data']:
|
||||||
points.append(numpy.array([(point['time'], point['data']['temperature'])],
|
points.append(numpy.array([(point['time'], point['data']['temperature'])],
|
||||||
dtype=float, ndmin =2))
|
dtype=float, ndmin =2))
|
||||||
|
extra_data = numpy.array(list(), dtype = float)
|
||||||
|
if points:
|
||||||
extra_data = numpy.vstack(tuple(points))
|
extra_data = numpy.vstack(tuple(points))
|
||||||
|
if not extra_data.any():
|
||||||
|
return
|
||||||
if not self.data.any():
|
if not self.data.any():
|
||||||
self.data = extra_data
|
self.data = extra_data
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in New Issue