[bugfix] filteroptions were not loaded from project

This commit is contained in:
Marcel Paffrath 2018-02-22 11:28:46 +01:00
parent 90bc7642fd
commit 2e5ed974f0
3 changed files with 16 additions and 11 deletions

View File

@ -194,15 +194,8 @@ class MainWindow(QMainWindow):
# setup UI # setup UI
self.setupUi() self.setupUi()
filter_info = readFilterInformation(self._inputs) self.updateFilteroptions()
p_filter = filter_info['P']
s_filter = filter_info['S']
self.filteroptions = {'P': FilterOptions(p_filter['filtertype'],
p_filter['freq'],
p_filter['order']),
'S': FilterOptions(s_filter['filtertype'],
s_filter['freq'],
s_filter['order'])}
self.loc = False self.loc = False
def setupUi(self): def setupUi(self):
@ -794,6 +787,17 @@ class MainWindow(QMainWindow):
def metadata(self, value): def metadata(self, value):
self._metadata = value self._metadata = value
def updateFilteroptions(self):
filter_info = readFilterInformation(self._inputs)
p_filter = filter_info['P']
s_filter = filter_info['S']
self.filteroptions = {'P': FilterOptions(p_filter['filtertype'],
p_filter['freq'],
p_filter['order']),
'S': FilterOptions(s_filter['filtertype'],
s_filter['freq'],
s_filter['order'])}
def updateFileMenu(self): def updateFileMenu(self):
self.fileMenu.clear() self.fileMenu.clear()
@ -3026,6 +3030,7 @@ class MainWindow(QMainWindow):
if hasattr(self.project, 'parameter'): if hasattr(self.project, 'parameter'):
if self.project.parameter: if self.project.parameter:
self._inputs = self.project.parameter self._inputs = self.project.parameter
self.updateFilteroptions()
self.tabs.setCurrentIndex(0) # implemented to prevent double-loading of waveform data self.tabs.setCurrentIndex(0) # implemented to prevent double-loading of waveform data
self.init_events(new=True) self.init_events(new=True)
self.setDirty(False) self.setDirty(False)

View File

@ -1 +1 @@
69955-dirty 90bc-dirty

View File

@ -441,7 +441,7 @@ class FilterOptions(object):
if self: if self:
robject = {'type': self.getFilterType(), robject = {'type': self.getFilterType(),
'corners': self.getOrder(), 'corners': self.getOrder(),
'zerophase': True} 'zerophase': False}
if not self.getFilterType() in ['highpass', 'lowpass']: if not self.getFilterType() in ['highpass', 'lowpass']:
robject['freqmin'] = self.getFreq()[0] robject['freqmin'] = self.getFreq()[0]
robject['freqmax'] = self.getFreq()[1] robject['freqmax'] = self.getFreq()[1]