From 256f3b6838192403be125e37192cbccb2a5be37d Mon Sep 17 00:00:00 2001 From: marcel Date: Wed, 16 Aug 2017 10:03:10 +0200 Subject: [PATCH] [closes #232] load autopicks automatically --- QtPyLoT.py | 12 +++++++----- pylot/core/util/thread.py | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/QtPyLoT.py b/QtPyLoT.py index 9f1cd7a4..c3e01ac7 100755 --- a/QtPyLoT.py +++ b/QtPyLoT.py @@ -1865,7 +1865,7 @@ class MainWindow(QMainWindow): self.addListItem(str(self._inputs)) self.mp_worker.signals.message.connect(self.addListItem) - # self.mp_thread.finished.connect(self.finalizeAutoPick) + self.mp_worker.signals.result.connect(self.finalizeAutoPick) def autoPickProject(self): if not self.apd_local: @@ -1877,10 +1877,12 @@ class MainWindow(QMainWindow): self.apd_sge = AutoPickDlg(self, sge=True) self.apd_sge.show() - def finalizeAutoPick(self): - self.drawPicks(picktype='auto') - self.draw() - self.mp_thread.quit() + def finalizeAutoPick(self, result): + if result: + event = self.get_current_event() + event.addAutopicks(result) + self.drawPicks(picktype='auto') + self.draw() def addPicks(self, station, picks, type='manual'): stat_picks = self.getPicksOnStation(station, type) diff --git a/pylot/core/util/thread.py b/pylot/core/util/thread.py index 5e79cb0e..7d281ca2 100644 --- a/pylot/core/util/thread.py +++ b/pylot/core/util/thread.py @@ -134,7 +134,7 @@ class Worker(QRunnable): #traceback.print_exc() exctype, value = sys.exc_info ()[:2] print(exctype, value, traceback.format_exc()) - #self.signals.error.emit ((exctype, value, traceback.format_exc ())) + self.signals.error.emit ((exctype, value, traceback.format_exc ())) else: self.signals.result.emit(result) finally: