diff --git a/PyLoT.py b/PyLoT.py index c4837690..d3367cfa 100755 --- a/PyLoT.py +++ b/PyLoT.py @@ -1701,6 +1701,7 @@ class MainWindow(QMainWindow): # else: # ans = False self.fnames = self.getWFFnames_from_eventbox() + self.fnames_syn = [] eventpath = self.get_current_event_path() basepath = eventpath.split(os.path.basename(eventpath))[0] obspy_dmt = check_obspydmt_structure(basepath) @@ -1714,12 +1715,16 @@ class MainWindow(QMainWindow): def prepareObspyDMT_data(self, eventpath): qcbox_processed = self.dataPlot.perm_qcbox_right + qcheckb_syn = self.dataPlot.syn_checkbox qcbox_processed.setEnabled(False) + qcheckb_syn.setEnabled(False) for fpath in os.listdir(eventpath): fpath = fpath.split('/')[-1] if 'syngine' in fpath: eventpath_syn = os.path.join(eventpath, fpath) - self.fnames_syn = [os.path.join(eventpath_syn, filename) for filename in os.listdir(eventpath_syn)] + qcheckb_syn.setEnabled(True) + if self.dataPlot.syn_checkbox.isChecked(): + self.fnames_syn = [os.path.join(eventpath_syn, filename) for filename in os.listdir(eventpath_syn)] if 'processed' in fpath: qcbox_processed.setEnabled(True) wftype = qcbox_processed.currentText() if qcbox_processed.isEnabled() else 'raw' diff --git a/pylot/core/util/widgets.py b/pylot/core/util/widgets.py index a3defac9..c53333eb 100644 --- a/pylot/core/util/widgets.py +++ b/pylot/core/util/widgets.py @@ -461,6 +461,7 @@ class WaveformWidgetPG(QtGui.QWidget): 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.plotWidget.showGrid(x=False, y=True, alpha=0.3) self.wfstart, self.wfend = 0, 0 @@ -494,12 +495,14 @@ class WaveformWidgetPG(QtGui.QWidget): def connect_signals(self): self.perm_qcbox_right.currentIndexChanged.connect(self.parent().newWF) + self.syn_checkbox.clicked.connect(self.parent().newWF) 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.syn_checkbox = QtGui.QCheckBox('synthetics') self.addQCboxItem('raw', 'black') self.addQCboxItem('processed', 'green') #self.perm_qcbox_right.setAlignment(2)