WIP: working on saving filter options as part of project
This commit is contained in:
parent
62fa3ad8b1
commit
cd612def81
16
QtPyLoT.py
16
QtPyLoT.py
@ -1314,7 +1314,7 @@ class MainWindow(QMainWindow):
|
|||||||
self.adjustFilterOptions()
|
self.adjustFilterOptions()
|
||||||
else:
|
else:
|
||||||
self.get_data().resetWFData()
|
self.get_data().resetWFData()
|
||||||
self.plotWaveformData()
|
self.plotWaveformDataThread()
|
||||||
self.drawPicks()
|
self.drawPicks()
|
||||||
self.draw()
|
self.draw()
|
||||||
|
|
||||||
@ -1328,11 +1328,11 @@ class MainWindow(QMainWindow):
|
|||||||
if self.filterAction.isChecked():
|
if self.filterAction.isChecked():
|
||||||
kwargs = self.getFilterOptions().parseFilterOptions()
|
kwargs = self.getFilterOptions().parseFilterOptions()
|
||||||
self.pushFilterWF(kwargs)
|
self.pushFilterWF(kwargs)
|
||||||
self.plotWaveformData()
|
self.plotWaveformDataThread()
|
||||||
|
|
||||||
def getFilterOptions(self):
|
def getFilterOptions(self):
|
||||||
try:
|
try:
|
||||||
return self.filteroptions[self.getSeismicPhase()]
|
return self.project.filteroptions[self.getSeismicPhase()]
|
||||||
except AttributeError as e:
|
except AttributeError as e:
|
||||||
print(e)
|
print(e)
|
||||||
return FilterOptions(None, None, None)
|
return FilterOptions(None, None, None)
|
||||||
@ -1341,10 +1341,12 @@ class MainWindow(QMainWindow):
|
|||||||
return self.filteroptions
|
return self.filteroptions
|
||||||
|
|
||||||
def setFilterOptions(self, filterOptions, seismicPhase=None):
|
def setFilterOptions(self, filterOptions, seismicPhase=None):
|
||||||
|
if not self.project:
|
||||||
|
return
|
||||||
if seismicPhase is None:
|
if seismicPhase is None:
|
||||||
self.getFilters()[self.getSeismicPhase()] = filterOptions
|
self.project.filteroptions[self.getSeismicPhase()] = filterOptions
|
||||||
else:
|
else:
|
||||||
self.getFilters()[seismicPhase] = filterOptions
|
self.project.filteroptions[seismicPhase] = filterOptions
|
||||||
|
|
||||||
def updateFilterOptions(self):
|
def updateFilterOptions(self):
|
||||||
try:
|
try:
|
||||||
@ -2147,6 +2149,10 @@ class Project(object):
|
|||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.eventlist = []
|
self.eventlist = []
|
||||||
self.location = None
|
self.location = None
|
||||||
|
self.filteroptions = {
|
||||||
|
'P': FilterOptions(),
|
||||||
|
'S': FilterOptions()
|
||||||
|
}
|
||||||
self.dirty = False
|
self.dirty = False
|
||||||
self._table = None
|
self._table = None
|
||||||
|
|
||||||
|
@ -1 +1 @@
|
|||||||
02a5-dirty
|
62fa-dirty
|
||||||
|
@ -2399,7 +2399,7 @@ class FilterOptionsDialog(QDialog):
|
|||||||
"""
|
"""
|
||||||
super(FilterOptionsDialog, self).__init__()
|
super(FilterOptionsDialog, self).__init__()
|
||||||
|
|
||||||
if parent is not None and parent.getFilterOptions():
|
if parent is not None and parent.getFilters():
|
||||||
self.filterOptions = parent.getFilterOptions()
|
self.filterOptions = parent.getFilterOptions()
|
||||||
elif filterOptions is not None:
|
elif filterOptions is not None:
|
||||||
self.filterOptions = FilterOptions(filterOptions)
|
self.filterOptions = FilterOptions(filterOptions)
|
||||||
|
Loading…
Reference in New Issue
Block a user