From a86a2efb8aa9bbdb91d6b47bbcc26f6fc3d9cdf8 Mon Sep 17 00:00:00 2001 From: Sebastian Wehling Date: Thu, 5 Mar 2015 14:52:34 +0100 Subject: [PATCH] debugging in progress (filter waveform not working) --- QtPyLoT.py | 4 ++-- pylot/core/util/widgets.py | 17 ++++++++++------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/QtPyLoT.py b/QtPyLoT.py index e94f09e3..77706ead 100755 --- a/QtPyLoT.py +++ b/QtPyLoT.py @@ -375,8 +375,7 @@ class MainWindow(QMainWindow): filterOptions=self.getFilterOptions()) if filterDlg.exec_(): filteroptions = filterDlg.getFilterOptions() - assert isinstance(filteroptions, FilterOptions) - self.setFilterOptions(filteroptions) + self.setFilterOptions(filteroptions) def getFilterOptions(self): try: @@ -447,6 +446,7 @@ class MainWindow(QMainWindow): new = NewEventDlg() if new.exec_() != QDialog.Rejected: evtpar = new.getValues() + self.data = Data(self, evtdata=createEvent(**evtpar)) self.dirty = True diff --git a/pylot/core/util/widgets.py b/pylot/core/util/widgets.py index ed462466..46225573 100644 --- a/pylot/core/util/widgets.py +++ b/pylot/core/util/widgets.py @@ -326,11 +326,10 @@ class NewEventDlg(QDialog): self.buttonBox.rejected.connect(self.reject) def getValues(self): - if self.accepted(): - return {'origintime' : self.eventTimeEdit.dateTime().toPyDateTime(), - 'latitude' : self.latEdit.text(), - 'longitude' : self.lonEdit.text(), - 'depth' : self.depEdit.text()} + return {'origintime' : self.eventTimeEdit.dateTime().toPython(), + 'latitude' : self.latEdit.text(), + 'longitude' : self.lonEdit.text(), + 'depth' : self.depEdit.text()} def setupUI(self): @@ -376,8 +375,10 @@ class FilterOptionsDialog(QDialog): if parent is not None: self.filterOptions = parent.getFilterOptions() - else: + elif filterOptions is not None: self.filterOptions = FilterOptions(filterOptions) + else: + self.filterOptions = FilterOptions() _enable = True if self.getFilterOptions().getFilterType() is None: @@ -397,7 +398,7 @@ class FilterOptionsDialog(QDialog): self.freqmaxSpinBox.setRange(5e-7, 1e6) self.freqmaxSpinBox.setDecimals(2) self.freqmaxSpinBox.setSuffix(' Hz') - self.freqmaxSpinBox.setEnabled(_enable) + if _enable: self.freqminSpinBox.setValue(self.getFilterOptions().getFreq()[0]) if self.getFilterOptions().getFilterType() in ['bandpass', 'bandstop']: @@ -436,6 +437,8 @@ class FilterOptionsDialog(QDialog): self.freqGroupLayout.addWidget(self.freqmaxSpinBox, 1, 1) self.freqGroupBox.setLayout(self.freqGroupLayout) + self.freqmaxSpinBox.setEnabled(_enable) + self.buttonBox = QDialogButtonBox(QDialogButtonBox.Ok| QDialogButtonBox.Cancel)