method getWFFnames implemented returning the file names of the waveform data files given in a particular data structure case as well as setting the attribute pointing to the same information; method openWaveformData implemented in order to read waveform data into the Data object
This commit is contained in:
parent
8eb69822b1
commit
f5eda74730
33
QtPyLoT.py
33
QtPyLoT.py
@ -267,16 +267,28 @@ class MainWindow(QMainWindow):
|
||||
evt = self.getData().getEvtData()
|
||||
if evt.picks:
|
||||
for pick in evt.picks:
|
||||
if pick.waveform_id is not None:
|
||||
fname = pick.waveform_id.getSEEDstring()
|
||||
if fname not in self.fnames:
|
||||
self.fnames.append(fname)
|
||||
try:
|
||||
if pick.waveform_id is not None:
|
||||
fname = pick.waveform_id.getSEEDstring()
|
||||
if fname not in self.fnames:
|
||||
self.fnames.append(fname)
|
||||
except:
|
||||
continue
|
||||
else:
|
||||
if self.dataStructure:
|
||||
searchPath = self.dataStructure.expandDataPath()
|
||||
except:
|
||||
return None
|
||||
|
||||
self.fnames = QFileDialog.getOpenFileNames(self,
|
||||
"Select waveform files:",
|
||||
dir=searchPath)
|
||||
else:
|
||||
raise ValueError('dataStructure not specified')
|
||||
return self.fnames
|
||||
except ValueError:
|
||||
props = PropertiesDlg(self)
|
||||
if props.exec_() == QDialog.Accepted:
|
||||
return self.getWFFnames()
|
||||
else:
|
||||
return
|
||||
|
||||
def saveData(self):
|
||||
settings = QSettings()
|
||||
@ -308,6 +320,13 @@ class MainWindow(QMainWindow):
|
||||
return self.saveData()
|
||||
return True
|
||||
|
||||
def openWaveformData(self):
|
||||
if self.fnames and self.okToContinue():
|
||||
self.dirty = True
|
||||
self.data.wfdata = self.data.setWFData(self.fnames)
|
||||
elif self.fnames is None and self.okToContinue():
|
||||
self.data.setWFData(self.getWFFnames())
|
||||
|
||||
def plotData(self):
|
||||
self.getData().plotData(self.getDataWidget())
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user