[minor] tweaks and finalization of obspyDMT options

This commit is contained in:
2018-06-08 15:01:05 +02:00
parent 083e5c8fe9
commit f50e38241e
2 changed files with 39 additions and 18 deletions

View File

@@ -459,10 +459,8 @@ class WaveformWidgetPG(QtGui.QWidget):
self.plotWidget = self.pg.PlotWidget(self.parent(), title=title)
self.main_layout.addWidget(self.plotWidget)
self.main_layout.addLayout(self.label_layout)
self.label_layout.addWidget(self.status_label)
self.label_layout.addWidget(self.perm_label_mid)
self.label_layout.addWidget(self.syn_checkbox)
self.label_layout.addWidget(self.perm_qcbox_right)
self.init_labels()
self.activateObspyDMToptions(False)
self.plotWidget.showGrid(x=False, y=True, alpha=0.3)
self.wfstart, self.wfend = 0, 0
self.pen_multicursor = self.pg.mkPen(self.parent()._style['multicursor']['rgba'])
@@ -494,14 +492,25 @@ class WaveformWidgetPG(QtGui.QWidget):
self.hLine.setPos(mousePoint.y())
def connect_signals(self):
self.perm_qcbox_right.currentIndexChanged.connect(self.parent().newWF)
self.qcombo_processed.activated.connect(self.parent().newWF)
self.syn_checkbox.clicked.connect(self.parent().newWF)
def init_labels(self):
self.label_layout.addWidget(self.status_label)
self.label_layout.addWidget(self.perm_label_mid)
self.label_layout.addWidget(self.syn_checkbox)
self.label_layout.addWidget(self.qcombo_processed)
self.syn_checkbox.setLayoutDirection(Qt.RightToLeft)
self.label_layout.setStretch(0, 4)
self.label_layout.setStretch(1, 2)
self.label_layout.setStretch(2, 3)
self.label_layout.setStretch(3, 1)
def add_labels(self):
self.status_label = QtGui.QLabel()
self.perm_label_mid = QtGui.QLabel()
self.perm_label_mid.setAlignment(4)
self.perm_qcbox_right = QtGui.QComboBox()
self.qcombo_processed = QtGui.QComboBox()
self.syn_checkbox = QtGui.QCheckBox('synthetics')
self.addQCboxItem('raw', 'black')
self.addQCboxItem('processed', 'green')
@@ -511,19 +520,23 @@ class WaveformWidgetPG(QtGui.QWidget):
def getPlotDict(self):
return self.plotdict
def activateObspyDMToptions(self, activate):
self.syn_checkbox.setVisible(activate)
self.qcombo_processed.setVisible(activate)
def setPermTextMid(self, text=None, color='black'):
self.perm_label_mid.setText(text)
self.perm_label_mid.setStyleSheet('color: {}'.format(color))
def addQCboxItem(self, text=None, color='black'):
item = QtGui.QStandardItem(text)
model = self.perm_qcbox_right.model()
model = self.qcombo_processed.model()
model.appendRow(item)
item.setForeground(QtGui.QColor('{}'.format(color)))
def setQCboxItem(self, text):
index = self.perm_qcbox_right.findText(text)
self.perm_qcbox_right.setCurrentIndex(index)
index = self.qcombo_processed.findText(text)
self.qcombo_processed.setCurrentIndex(index)
def setPlotDict(self, key, value):
self.plotdict[key] = value