[add] no data label
This commit is contained in:
parent
ae4c345fa7
commit
f49d323c13
19
PyLoT.py
19
PyLoT.py
@ -616,6 +616,10 @@ class MainWindow(QMainWindow):
|
|||||||
|
|
||||||
# add scroll area used in case number of traces gets too high
|
# add scroll area used in case number of traces gets too high
|
||||||
self.wf_scroll_area = QtGui.QScrollArea(self)
|
self.wf_scroll_area = QtGui.QScrollArea(self)
|
||||||
|
self.wf_scroll_area.setVisible(False)
|
||||||
|
self.no_data_label = QLabel('No Data')
|
||||||
|
self.no_data_label.setStyleSheet('color: red')
|
||||||
|
self.no_data_label.setAlignment(Qt.AlignCenter)
|
||||||
|
|
||||||
# create central matplotlib figure canvas widget
|
# create central matplotlib figure canvas widget
|
||||||
self.init_wfWidget()
|
self.init_wfWidget()
|
||||||
@ -638,6 +642,7 @@ class MainWindow(QMainWindow):
|
|||||||
self.tabs.addTab(array_tab, 'Array Map')
|
self.tabs.addTab(array_tab, 'Array Map')
|
||||||
self.tabs.addTab(events_tab, 'Eventlist')
|
self.tabs.addTab(events_tab, 'Eventlist')
|
||||||
|
|
||||||
|
self.wf_layout.addWidget(self.no_data_label)
|
||||||
self.wf_layout.addWidget(self.wf_scroll_area)
|
self.wf_layout.addWidget(self.wf_scroll_area)
|
||||||
self.wf_scroll_area.setWidgetResizable(True)
|
self.wf_scroll_area.setWidgetResizable(True)
|
||||||
self.init_array_tab()
|
self.init_array_tab()
|
||||||
@ -1811,7 +1816,8 @@ class MainWindow(QMainWindow):
|
|||||||
self.getPlotWidget().updateWidget()
|
self.getPlotWidget().updateWidget()
|
||||||
plots, gaps = self.wfp_thread.data
|
plots, gaps = self.wfp_thread.data
|
||||||
# do not show plot if no data are given
|
# do not show plot if no data are given
|
||||||
self.dataPlot.setVisible(len(plots) > 0)
|
self.wf_scroll_area.setVisible(len(plots) > 0)
|
||||||
|
self.no_data_label.setVisible(not len(plots) > 0)
|
||||||
for times, data, times_syn, data_syn in plots:
|
for times, data, times_syn, data_syn in plots:
|
||||||
self.dataPlot.plotWidget.getPlotItem().plot(times, data,
|
self.dataPlot.plotWidget.getPlotItem().plot(times, data,
|
||||||
pen=self.dataPlot.pen_linecolor)
|
pen=self.dataPlot.pen_linecolor)
|
||||||
@ -1819,8 +1825,6 @@ class MainWindow(QMainWindow):
|
|||||||
self.dataPlot.plotWidget.getPlotItem().plot(times_syn, data_syn,
|
self.dataPlot.plotWidget.getPlotItem().plot(times_syn, data_syn,
|
||||||
pen=self.dataPlot.pen_linecolor_syn)
|
pen=self.dataPlot.pen_linecolor_syn)
|
||||||
self.dataPlot.reinitMoveProxy()
|
self.dataPlot.reinitMoveProxy()
|
||||||
self.dataPlot.plotWidget.showAxis('left')
|
|
||||||
self.dataPlot.plotWidget.showAxis('bottom')
|
|
||||||
self.highlight_stations()
|
self.highlight_stations()
|
||||||
|
|
||||||
def finishWaveformDataPlot(self):
|
def finishWaveformDataPlot(self):
|
||||||
@ -1898,12 +1902,10 @@ class MainWindow(QMainWindow):
|
|||||||
comparable[event.pylot_id] = self.checkEvent4comparison(event)
|
comparable[event.pylot_id] = self.checkEvent4comparison(event)
|
||||||
return comparable
|
return comparable
|
||||||
|
|
||||||
def clearWaveformDataPlot(self):
|
def clearWaveformDataPlot(self, refresh_plot=False):
|
||||||
self.disconnectWFplotEvents()
|
self.disconnectWFplotEvents()
|
||||||
if self.pg:
|
if self.pg:
|
||||||
self.dataPlot.plotWidget.getPlotItem().clear()
|
self.dataPlot.plotWidget.getPlotItem().clear()
|
||||||
self.dataPlot.plotWidget.hideAxis('bottom')
|
|
||||||
self.dataPlot.plotWidget.hideAxis('left')
|
|
||||||
else:
|
else:
|
||||||
for ax in self.dataPlot.axes:
|
for ax in self.dataPlot.axes:
|
||||||
ax.cla()
|
ax.cla()
|
||||||
@ -1919,6 +1921,9 @@ class MainWindow(QMainWindow):
|
|||||||
self.openEventAction.setEnabled(False)
|
self.openEventAction.setEnabled(False)
|
||||||
self.openEventsAutoAction.setEnabled(False)
|
self.openEventsAutoAction.setEnabled(False)
|
||||||
self.loadpilotevent.setEnabled(False)
|
self.loadpilotevent.setEnabled(False)
|
||||||
|
if not refresh_plot:
|
||||||
|
self.wf_scroll_area.setVisible(False)
|
||||||
|
self.no_data_label.setVisible(True)
|
||||||
self.disableSaveEventAction()
|
self.disableSaveEventAction()
|
||||||
self.draw()
|
self.draw()
|
||||||
|
|
||||||
@ -1927,7 +1932,7 @@ class MainWindow(QMainWindow):
|
|||||||
Open a modal thread to plot current waveform data.
|
Open a modal thread to plot current waveform data.
|
||||||
'''
|
'''
|
||||||
self.check_plot_quantity()
|
self.check_plot_quantity()
|
||||||
self.clearWaveformDataPlot()
|
self.clearWaveformDataPlot(refresh_plot=True)
|
||||||
self.wfp_thread = Thread(self, self.plotWaveformData,
|
self.wfp_thread = Thread(self, self.plotWaveformData,
|
||||||
arg=filter,
|
arg=filter,
|
||||||
progressText='Plotting waveform data...',
|
progressText='Plotting waveform data...',
|
||||||
|
@ -462,8 +462,6 @@ class WaveformWidgetPG(QtGui.QWidget):
|
|||||||
self.label_layout.addWidget(self.perm_label_mid)
|
self.label_layout.addWidget(self.perm_label_mid)
|
||||||
self.label_layout.addWidget(self.perm_label_right)
|
self.label_layout.addWidget(self.perm_label_right)
|
||||||
self.plotWidget.showGrid(x=False, y=True, alpha=0.3)
|
self.plotWidget.showGrid(x=False, y=True, alpha=0.3)
|
||||||
self.plotWidget.hideAxis('bottom')
|
|
||||||
self.plotWidget.hideAxis('left')
|
|
||||||
self.wfstart, self.wfend = 0, 0
|
self.wfstart, self.wfend = 0, 0
|
||||||
self.pen_multicursor = self.pg.mkPen(self.parent()._style['multicursor']['rgba'])
|
self.pen_multicursor = self.pg.mkPen(self.parent()._style['multicursor']['rgba'])
|
||||||
self.pen_linecolor = self.pg.mkPen(self.parent()._style['linecolor']['rgba'])
|
self.pen_linecolor = self.pg.mkPen(self.parent()._style['linecolor']['rgba'])
|
||||||
|
Loading…
Reference in New Issue
Block a user