[update] apw saved, proper deletion of figures

This commit is contained in:
Marcel Paffrath 2017-09-18 14:44:18 +02:00
parent 6acb0ad580
commit 0949a6deac
3 changed files with 19 additions and 14 deletions

View File

@ -127,6 +127,7 @@ class MainWindow(QMainWindow):
self.project = Project() self.project = Project()
self.project.parameter = self._inputs self.project.parameter = self._inputs
self.tap = None self.tap = None
self.apw = None
self.paraBox = None self.paraBox = None
self.array_map = None self.array_map = None
self._metadata = None self._metadata = None
@ -1117,7 +1118,7 @@ class MainWindow(QMainWindow):
''' '''
# if pick widget is open, refresh tooltips as well # if pick widget is open, refresh tooltips as well
if hasattr(self, 'apw'): if self.apw:
self.apw.refresh_tooltips() self.apw.refresh_tooltips()
if hasattr(self, 'cmpw'): if hasattr(self, 'cmpw'):
self.cmpw.refresh_tooltips() self.cmpw.refresh_tooltips()
@ -2093,6 +2094,7 @@ class MainWindow(QMainWindow):
"No autoPyLoT output declared!") "No autoPyLoT output declared!")
return return
if not self.apw:
# init event selection options for autopick # init event selection options for autopick
self.pickoptions =[('current event', self.get_current_event, None), self.pickoptions =[('current event', self.get_current_event, None),
('tune events', self.get_ref_events, self._style['ref']['rgba']), ('tune events', self.get_ref_events, self._style['ref']['rgba']),

View File

@ -131,7 +131,6 @@ class Worker(QRunnable):
try: try:
result = self.fun(self.args) result = self.fun(self.args)
except: except:
#traceback.print_exc()
exctype, value = sys.exc_info ()[:2] exctype, value = sys.exc_info ()[:2]
print(exctype, value, traceback.format_exc()) print(exctype, value, traceback.format_exc())
self.signals.error.emit ((exctype, value, traceback.format_exc ())) self.signals.error.emit ((exctype, value, traceback.format_exc ()))

View File

@ -2298,6 +2298,7 @@ class AutoPickWidget(MultiEventWidget):
def __init__(self, parent, options): def __init__(self, parent, options):
MultiEventWidget.__init__(self, options, parent, 1) MultiEventWidget.__init__(self, options, parent, 1)
self.events2plot = {}
self.connect_buttons() self.connect_buttons()
self.init_plot_layout() self.init_plot_layout()
self.init_log_layout() self.init_log_layout()
@ -2365,6 +2366,9 @@ class AutoPickWidget(MultiEventWidget):
self.main_layout.setStretch(1, 1) self.main_layout.setStretch(1, 1)
def reinitEvents2plot(self): def reinitEvents2plot(self):
for eventID, eventDict in self.events2plot.items():
for widget_key, widget in eventDict.items():
widget.setParent(None)
self.events2plot = {} self.events2plot = {}
self.eventbox.clear() self.eventbox.clear()
self.refresh_plot_tabs() self.refresh_plot_tabs()