forked from M-Labs/artiq
waveform: remove empty waveform error msg
This commit is contained in:
parent
de539a4d33
commit
652bcc22c6
@ -200,7 +200,8 @@ class _BaseWaveform(pg.PlotWidget):
|
||||
|
||||
def setData(self, data):
|
||||
if len(data) == 0:
|
||||
raise ValueError("no timeseries data to display for this channel")
|
||||
self.x_data, self.y_data = [], []
|
||||
else:
|
||||
self.x_data, self.y_data = zip(*data)
|
||||
|
||||
def onDataChange(self, data):
|
||||
@ -293,6 +294,7 @@ class AnalogWaveform(_BaseWaveform):
|
||||
try:
|
||||
self.setData(data)
|
||||
self.plot_data_item.setData(x=self.x_data, y=self.y_data)
|
||||
if len(data) > 0:
|
||||
max_y = max(self.y_data)
|
||||
min_y = min(self.y_data)
|
||||
self.plot_item.setRange(yRange=(min_y, max_y), padding=0.1)
|
||||
|
Loading…
Reference in New Issue
Block a user