[add] info for user on min/max plot
This commit is contained in:
parent
964aa9ce6c
commit
a876384338
11
PyLoT.py
11
PyLoT.py
@ -147,6 +147,7 @@ class MainWindow(QMainWindow):
|
||||
|
||||
# default factor for dataplot e.g. enabling/disabling scrollarea
|
||||
self.height_factor = 12
|
||||
self.plot_method = 'normal'
|
||||
|
||||
# UI has to be set up before(!) children widgets are about to show up
|
||||
self.createAction = createAction
|
||||
@ -1896,11 +1897,11 @@ class MainWindow(QMainWindow):
|
||||
plotWidget = self.getPlotWidget()
|
||||
self.adjustPlotHeight()
|
||||
if real_Bool(settings.value('large_dataset')) == True:
|
||||
method = 'fast'
|
||||
self.plot_method = 'fast'
|
||||
else:
|
||||
method = 'normal'
|
||||
self.plot_method = 'normal'
|
||||
plots = plotWidget.plotWFData(wfdata=wfst, wfsyn=wfsyn, title=title, mapping=False, component=comp,
|
||||
nth_sample=int(nth_sample), method=method)
|
||||
nth_sample=int(nth_sample), method=self.plot_method)
|
||||
return plots
|
||||
|
||||
def adjustPlotHeight(self):
|
||||
@ -3174,6 +3175,10 @@ class MainWindow(QMainWindow):
|
||||
def draw(self):
|
||||
self.fill_eventbox()
|
||||
self.getPlotWidget().draw()
|
||||
if self.plot_method == 'fast':
|
||||
self.dataPlot.setPermText('MIN/MAX plot', color='red')
|
||||
else:
|
||||
self.dataPlot.setPermText()
|
||||
|
||||
def _setDirty(self):
|
||||
self.setDirty(True)
|
||||
|
@ -449,11 +449,15 @@ class WaveformWidgetPG(QtGui.QWidget):
|
||||
self.plotdict = dict()
|
||||
# create plot
|
||||
self.main_layout = QtGui.QVBoxLayout()
|
||||
self.label = QtGui.QLabel()
|
||||
self.label_layout = QtGui.QHBoxLayout()
|
||||
self.status_label = QtGui.QLabel()
|
||||
self.perm_label = QtGui.QLabel()
|
||||
self.setLayout(self.main_layout)
|
||||
self.plotWidget = self.pg.PlotWidget(self.parent(), title=title)
|
||||
self.main_layout.addWidget(self.plotWidget)
|
||||
self.main_layout.addWidget(self.label)
|
||||
self.main_layout.addLayout(self.label_layout)
|
||||
self.label_layout.addWidget(self.status_label)
|
||||
self.label_layout.addWidget(self.perm_label)
|
||||
self.plotWidget.showGrid(x=False, y=True, alpha=0.3)
|
||||
self.plotWidget.hideAxis('bottom')
|
||||
self.plotWidget.hideAxis('left')
|
||||
@ -481,13 +485,17 @@ class WaveformWidgetPG(QtGui.QWidget):
|
||||
station = self.orig_parent.getStationName(wfID)
|
||||
abstime = self.wfstart + x
|
||||
if self.orig_parent.get_current_event():
|
||||
self.label.setText("station = {}, T = {}, t = {} [s]".format(station, abstime, x))
|
||||
self.status_label.setText("station = {}, T = {}, t = {} [s]".format(station, abstime, x))
|
||||
self.vLine.setPos(mousePoint.x())
|
||||
self.hLine.setPos(mousePoint.y())
|
||||
|
||||
def getPlotDict(self):
|
||||
return self.plotdict
|
||||
|
||||
def setPermText(self, text=None, color='black'):
|
||||
self.perm_label.setText(text)
|
||||
self.perm_label.setStyleSheet('color: {}'.format(color))
|
||||
|
||||
def setPlotDict(self, key, value):
|
||||
self.plotdict[key] = value
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user