[new] reverting stdout redirection after auto picking is done; added method finalizeAutoPick for purposes to be done after the auto picking thread has finished
This commit is contained in:
parent
41a495371d
commit
ed7a323c50
@ -680,6 +680,11 @@ class MainWindow(QMainWindow):
|
||||
param=autopick_parameter)
|
||||
self.thread.message.connect(self.addListItem)
|
||||
self.thread.start()
|
||||
self.thread.finished.connect(self.finalizeAutoPick)
|
||||
|
||||
def finalizeAutoPick(self):
|
||||
self.drawPicks(picktype='auto')
|
||||
self.thread.quit()
|
||||
|
||||
def addPicks(self, station, picks, type='manual'):
|
||||
stat_picks = self.getPicksOnStation(station, type)
|
||||
|
@ -4,6 +4,7 @@ from PySide.QtCore import QThread, Signal
|
||||
|
||||
class AutoPickThread(QThread):
|
||||
message = Signal(str)
|
||||
finished = Signal()
|
||||
|
||||
def __init__(self, parent, func, data, param):
|
||||
super(AutoPickThread, self).__init__()
|
||||
@ -24,8 +25,8 @@ class AutoPickThread(QThread):
|
||||
self.parent().addPicks(station, picks[station], type='auto')
|
||||
except AttributeError:
|
||||
print(picks)
|
||||
# plot picks to section
|
||||
self.parent().drawPicks(picktype='auto')
|
||||
sys.stdout = sys.__stdout__
|
||||
self.finished.emit()
|
||||
|
||||
|
||||
def write(self, text):
|
||||
|
Loading…
Reference in New Issue
Block a user