[add] check for event data

This commit is contained in:
Marcel Paffrath 2018-03-05 16:51:06 +01:00
parent 4918448d92
commit 8dabfb41d8
2 changed files with 13 additions and 2 deletions

View File

@ -1138,7 +1138,7 @@ class MainWindow(QMainWindow):
Initiate GUI widgets in case of changed or newly added events. Initiate GUI widgets in case of changed or newly added events.
''' '''
nitems = self.eventBox.count() nitems = self.eventBox.count()
if len(self.project.eventlist) == 0: if len(self.project.eventlist) == 0 or not self.data_check():
print('No events to init.') print('No events to init.')
self.clearWaveformDataPlot() self.clearWaveformDataPlot()
return return
@ -1151,6 +1151,17 @@ class MainWindow(QMainWindow):
self.refreshEvents() self.refreshEvents()
tabindex = self.tabs.currentIndex() tabindex = self.tabs.currentIndex()
def data_check(self):
paths_exist = [os.path.exists(event.path) for event in self.project.eventlist]
if all(paths_exist):
return True
else:
info_str = ''
for event, path_exists in zip(self.project.eventlist, paths_exist):
info_str += '\n{} exists: {}'.format(event.path, path_exists)
print('Unable to find certain event paths:{}'.format(info_str))
return False
def fill_eventbox(self, event=None, eventBox=None, select_events='all'): def fill_eventbox(self, event=None, eventBox=None, select_events='all'):
''' '''
(Re)fill the selected eventBox (type = QtGui.QComboBox). (Re)fill the selected eventBox (type = QtGui.QComboBox).

View File

@ -1 +1 @@
9e74-dirty 4918-dirty