Merge branch 'develop' of ariadne.geophysik.rub.de:/data/git/pylot into develop

This commit is contained in:
Ludger Küperkoch 2017-08-15 15:10:58 +02:00
commit b211294b94
2 changed files with 16 additions and 12 deletions

View File

@ -1751,10 +1751,10 @@ class MainWindow(QMainWindow):
if pickDlg._dirty: if pickDlg._dirty:
self.setDirty(True) self.setDirty(True)
self.update_status('picks accepted ({0})'.format(station)) self.update_status('picks accepted ({0})'.format(station))
replot = self.addPicks(station, pickDlg.getPicks()) replot1 = self.addPicks(station, pickDlg.getPicks(picktype='manual'), type='manual')
self.get_current_event().setPick(station, pickDlg.getPicks()) replot2 = self.addPicks(station, pickDlg.getPicks(picktype='auto'), type='auto')
self.enableSaveEventAction() self.enableSaveEventAction()
if replot: if replot1 or replot2:
self.plotWaveformDataThread() self.plotWaveformDataThread()
self.drawPicks() self.drawPicks()
self.draw() self.draw()
@ -1877,12 +1877,16 @@ class MainWindow(QMainWindow):
def addPicks(self, station, picks, type='manual'): def addPicks(self, station, picks, type='manual'):
stat_picks = self.getPicksOnStation(station, type) stat_picks = self.getPicksOnStation(station, type)
if not stat_picks and picks: if not stat_picks:
rval = False rval = False
else: else:
rval = True rval = True
# set picks (ugly syntax?) event = self.get_current_event()
self.getPicks(type=type)[station] = picks # create dictionary switch
automanu = {'manual': event.setPick,
'auto': event.setAutopick}
# dictionary consisting of set station only
automanu[type](station=station, pick=picks)
return rval return rval
# if not stat_picks: # if not stat_picks:
# stat_picks = picks # stat_picks = picks

View File

@ -837,14 +837,14 @@ class PickDlg(QDialog):
self._user = settings.value('user/Login', pylot_user) self._user = settings.value('user/Login', pylot_user)
self._dirty = False self._dirty = False
if picks: if picks:
self.picks = picks self.picks = copy.deepcopy(picks)
self._init_picks = copy.deepcopy(picks) self._init_picks = picks
else: else:
self.picks = {} self.picks = {}
self._init_picks = {} self._init_picks = {}
if autopicks: if autopicks:
self.autopicks = autopicks self.autopicks = copy.deepcopy(autopicks)
self._init_autopicks = copy.deepcopy(autopicks) self._init_autopicks = autopicks
else: else:
self.autopicks = {} self.autopicks = {}
self._init_autopicks = {} self._init_autopicks = {}
@ -1734,11 +1734,11 @@ class PickDlg(QDialog):
if spe: if spe:
ax.fill_between([mpp-spe, mpp+spe], ylims[0], ylims[1], ax.fill_between([mpp-spe, mpp+spe], ylims[0], ylims[1],
alpha=.25, color=color, label='{}-SPE'.format(phase)) alpha=.25, color=color, label='{}-SPE'.format(phase))
if epp: if picks['epp']:
linestyle_epp, width_epp = pick_linestyle_plt(picktype, 'epp') linestyle_epp, width_epp = pick_linestyle_plt(picktype, 'epp')
ax.plot([epp, epp], ylims, color=color, linestyle=linestyle_epp, ax.plot([epp, epp], ylims, color=color, linestyle=linestyle_epp,
linewidth=width_epp, label='{}-EPP'.format(phase)) linewidth=width_epp, label='{}-EPP'.format(phase))
if lpp: if picks['lpp']:
linestyle_lpp, width_lpp = pick_linestyle_plt(picktype, 'lpp') linestyle_lpp, width_lpp = pick_linestyle_plt(picktype, 'lpp')
ax.plot([lpp, lpp], ylims, color=color, linestyle=linestyle_lpp, ax.plot([lpp, lpp], ylims, color=color, linestyle=linestyle_lpp,
linewidth=width_lpp, label='{}-LPP'.format(phase)) linewidth=width_lpp, label='{}-LPP'.format(phase))