[bugfix] nextStation not working with deleted PickDlg

This commit is contained in:
Marcel Paffrath 2018-06-21 14:23:52 +02:00
parent 2a8efd0904
commit a5667c1e06

View File

@ -140,6 +140,7 @@ class MainWindow(QMainWindow):
self.apd_sge = None self.apd_sge = None
self.stations_highlighted = [] self.stations_highlighted = []
self.obspy_dmt = False self.obspy_dmt = False
self.nextStation = False
self.poS_id = None self.poS_id = None
self.ae_id = None self.ae_id = None
@ -2284,7 +2285,7 @@ class MainWindow(QMainWindow):
if nwst in self.stations_highlighted: if nwst in self.stations_highlighted:
self.toggle_station_color(wfID, network, station) self.toggle_station_color(wfID, network, station)
def pickDialog(self, wfID, network=None, station=None, nextStation=False): def pickDialog(self, wfID, network=None, station=None):
if not network: if not network:
network = self.getNetworkName(wfID) network = self.getNetworkName(wfID)
if not station: if not station:
@ -2305,7 +2306,8 @@ class MainWindow(QMainWindow):
if self.filterActionP.isChecked() or self.filterActionS.isChecked(): if self.filterActionP.isChecked() or self.filterActionS.isChecked():
pickDlg.currentPhase = self.getSeismicPhase() pickDlg.currentPhase = self.getSeismicPhase()
pickDlg.filterWFData() pickDlg.filterWFData()
pickDlg.nextStation.setChecked(nextStation) pickDlg.nextStation.setChecked(self.nextStation)
pickDlg.nextStation.stateChanged.connect(self.toggle_next_station)
if pickDlg.exec_(): if pickDlg.exec_():
if pickDlg._dirty: if pickDlg._dirty:
self.setDirty(True) self.setDirty(True)
@ -2315,13 +2317,13 @@ class MainWindow(QMainWindow):
self.enableSaveEventAction() self.enableSaveEventAction()
if replot1 or replot2: if replot1 or replot2:
self.plotWaveformDataThread() self.plotWaveformDataThread()
self.drawPicks()
self.draw() self.draw()
else: else:
self.drawPicks(station) self.drawPicks(station)
self.draw() self.draw()
if pickDlg.nextStation.isChecked(): if self.nextStation:
self.pickDialog(wfID - 1, nextStation=pickDlg.nextStation.isChecked()) self.pickDialog(wfID - 1)
else: else:
self.update_status('picks discarded ({0})'.format(station)) self.update_status('picks discarded ({0})'.format(station))
if not self.get_loc_flag() and self.check4Loc(): if not self.get_loc_flag() and self.check4Loc():
@ -2330,6 +2332,9 @@ class MainWindow(QMainWindow):
elif self.get_loc_flag() and not self.check4Loc(): elif self.get_loc_flag() and not self.check4Loc():
self.set_loc_flag(False) self.set_loc_flag(False)
def toggle_next_station(self, signal):
self.nextStation = bool(signal)
def addListItem(self, text): def addListItem(self, text):
self.listWidget.addItem(text) self.listWidget.addItem(text)
self.listWidget.scrollToBottom() self.listWidget.scrollToBottom()