[bugfix] error when there is nothing to plot

This commit is contained in:
Marcel Paffrath 2018-04-23 13:33:05 +02:00
parent 0320ad67b9
commit 36a4f0df8a
2 changed files with 7 additions and 2 deletions

View File

@ -1903,8 +1903,9 @@ class MainWindow(QMainWindow):
self.plot_method = 'fast'
else:
self.plot_method = 'normal'
plots, gaps = plotWidget.plotWFData(wfdata=wfst, wfsyn=wfsyn, title=title, mapping=False, component=comp,
nth_sample=int(nth_sample), method=self.plot_method)
rval = plotWidget.plotWFData(wfdata=wfst, wfsyn=wfsyn, title=title, mapping=False, component=comp,
nth_sample=int(nth_sample), method=self.plot_method)
plots, gaps = rval if rval else ([], [])
return plots, gaps
def adjustPlotHeight(self):

View File

@ -447,6 +447,10 @@ class WaveformWidgetPG(QtGui.QWidget):
self.orig_parent = parent
# attribute plotdict is a dictionary connecting position and a name
self.plotdict = dict()
# init labels
self.xlabel = None
self.ylabel = None
self.title = None
# create plot
self.main_layout = QtGui.QVBoxLayout()
self.label_layout = QtGui.QHBoxLayout()