[closes #209] spacebar can now be used to accept pickDlg, also added a checkbox to automatically open next station (experimental)
This commit is contained in:
parent
b0dcf5ff4b
commit
6feffaeadb
@ -172,7 +172,6 @@ class MainWindow(QMainWindow):
|
||||
self.setupUi()
|
||||
|
||||
self.filteroptions = {}
|
||||
self.pickDlgs = {}
|
||||
self.picks = {}
|
||||
self.autopicks = {}
|
||||
self.loc = False
|
||||
@ -1565,7 +1564,9 @@ class MainWindow(QMainWindow):
|
||||
wfID = self.getWFID(ycoord)
|
||||
|
||||
if wfID is None: return
|
||||
self.pickDialog(wfID)
|
||||
|
||||
def pickDialog(self, wfID, nextStation=False):
|
||||
station = self.getStationName(wfID)
|
||||
if not station:
|
||||
return
|
||||
@ -1576,9 +1577,9 @@ class MainWindow(QMainWindow):
|
||||
station=station,
|
||||
picks=self.getPicksOnStation(station, 'manual'),
|
||||
autopicks=self.getPicksOnStation(station, 'auto'))
|
||||
pickDlg.nextStation.setChecked(nextStation)
|
||||
if pickDlg.exec_():
|
||||
if not pickDlg.getPicks():
|
||||
return
|
||||
if pickDlg.getPicks():
|
||||
self.setDirty(True)
|
||||
self.update_status('picks accepted ({0})'.format(station))
|
||||
replot = self.addPicks(station, pickDlg.getPicks())
|
||||
@ -1591,6 +1592,8 @@ class MainWindow(QMainWindow):
|
||||
else:
|
||||
self.drawPicks(station)
|
||||
self.draw()
|
||||
if pickDlg.nextStation.isChecked():
|
||||
self.pickDialog(wfID - 1, nextStation=pickDlg.nextStation.isChecked())
|
||||
else:
|
||||
self.update_status('picks discarded ({0})'.format(station))
|
||||
if not self.get_loc_flag() and self.check4Loc():
|
||||
|
@ -1 +1 @@
|
||||
d77a-dirty
|
||||
b0dc-dirty
|
||||
|
@ -752,6 +752,7 @@ class PickDlg(QDialog):
|
||||
self._init_autopicks = {}
|
||||
self.filteroptions = FILTERDEFAULTS
|
||||
self.pick_block = False
|
||||
self.nextStation = QtGui.QCheckBox('Continue with next station.')
|
||||
|
||||
# initialize panning attributes
|
||||
self.press = None
|
||||
@ -877,6 +878,8 @@ class PickDlg(QDialog):
|
||||
if self._embedded:
|
||||
_dialtoolbar.addWidget(self.accept_button)
|
||||
_dialtoolbar.addWidget(self.reject_button)
|
||||
else:
|
||||
_dialtoolbar.addWidget(self.nextStation)
|
||||
|
||||
# layout the innermost widget
|
||||
_innerlayout = QVBoxLayout()
|
||||
@ -1728,7 +1731,6 @@ class TuneAutopicker(QWidget):
|
||||
pickDlg.update_picks.connect(self.picks_from_pickdlg)
|
||||
pickDlg.update_picks.connect(self.fill_eventbox)
|
||||
pickDlg.update_picks.connect(self.fill_stationbox)
|
||||
pickDlg.update_picks.connect(self.parent.drawPicks)
|
||||
pickDlg.update_picks.connect(lambda: self.parent.setDirty(True))
|
||||
pickDlg.update_picks.connect(self.parent.enableSaveManualPicksAction)
|
||||
self.pickDlg = QtGui.QWidget()
|
||||
@ -1738,7 +1740,15 @@ class TuneAutopicker(QWidget):
|
||||
|
||||
def picks_from_pickdlg(self, picks=None):
|
||||
station = self.get_current_station()
|
||||
replot = self.parent.addPicks(station, picks)
|
||||
self.get_current_event().setPick(station, picks)
|
||||
if self.get_current_event() == self.parent.get_current_event():
|
||||
if replot:
|
||||
self.parent.plotWaveformDataThread()
|
||||
self.parent.drawPicks()
|
||||
else:
|
||||
self.parent.drawPicks(station)
|
||||
self.parent.draw()
|
||||
|
||||
def plot_manual_picks_to_figs(self):
|
||||
picks = self.get_current_event_picks(self.get_current_station())
|
||||
|
Loading…
Reference in New Issue
Block a user