[edit] exit if no waveform files are selected
PyLoT will only start if waveformfiles are selected
This commit is contained in:
parent
7225da87db
commit
cad6ed2274
13
QtPyLoT.py
13
QtPyLoT.py
@ -110,8 +110,10 @@ class MainWindow(QMainWindow):
|
|||||||
# load and display waveform data
|
# load and display waveform data
|
||||||
self.dirty = False
|
self.dirty = False
|
||||||
self.loadData()
|
self.loadData()
|
||||||
self.loadWaveformData()
|
if self.loadWaveformData():
|
||||||
self.updateFilterOptions()
|
self.updateFilterOptions()
|
||||||
|
else:
|
||||||
|
sys.exit(0)
|
||||||
|
|
||||||
def setupUi(self):
|
def setupUi(self):
|
||||||
|
|
||||||
@ -403,6 +405,8 @@ class MainWindow(QMainWindow):
|
|||||||
|
|
||||||
else:
|
else:
|
||||||
raise DatastructureError('not specified')
|
raise DatastructureError('not specified')
|
||||||
|
if not self.fnames:
|
||||||
|
return None
|
||||||
return self.fnames
|
return self.fnames
|
||||||
except DatastructureError as e:
|
except DatastructureError as e:
|
||||||
print(e)
|
print(e)
|
||||||
@ -525,10 +529,13 @@ class MainWindow(QMainWindow):
|
|||||||
def loadWaveformData(self):
|
def loadWaveformData(self):
|
||||||
if self.fnames and self.okToContinue():
|
if self.fnames and self.okToContinue():
|
||||||
self.setDirty(True)
|
self.setDirty(True)
|
||||||
self.data.setWFData(self.fnames)
|
ans = self.data.setWFData(self.fnames)
|
||||||
elif self.fnames is None and self.okToContinue():
|
elif self.fnames is None and self.okToContinue():
|
||||||
self.data.setWFData(self.getWFFnames())
|
ans = self.data.setWFData(self.getWFFnames())
|
||||||
|
if ans:
|
||||||
self.plotWaveformData()
|
self.plotWaveformData()
|
||||||
|
else:
|
||||||
|
return ans
|
||||||
|
|
||||||
def plotWaveformData(self):
|
def plotWaveformData(self):
|
||||||
zne_text = {'Z': 'vertical', 'N': 'north-south', 'E': 'east-west'}
|
zne_text = {'Z': 'vertical', 'N': 'north-south', 'E': 'east-west'}
|
||||||
|
@ -186,8 +186,11 @@ class Data(object):
|
|||||||
self.wforiginal = None
|
self.wforiginal = None
|
||||||
if fnames is not None:
|
if fnames is not None:
|
||||||
self.appendWFData(fnames)
|
self.appendWFData(fnames)
|
||||||
|
else:
|
||||||
|
return False
|
||||||
self.wforiginal = self.getWFData().copy()
|
self.wforiginal = self.getWFData().copy()
|
||||||
self.dirty = False
|
self.dirty = False
|
||||||
|
return True
|
||||||
|
|
||||||
def appendWFData(self, fnames):
|
def appendWFData(self, fnames):
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user