[bugfix] old picks were not properly erased before loeading new picks
This commit is contained in:
parent
2963be5bba
commit
34ca64ee17
12
PyLoT.py
12
PyLoT.py
@ -991,7 +991,7 @@ class MainWindow(QMainWindow):
|
|||||||
data = Data(self, event)
|
data = Data(self, event)
|
||||||
try:
|
try:
|
||||||
data_new = Data(self, evtdata=str(fname))
|
data_new = Data(self, evtdata=str(fname))
|
||||||
# MP MP uncommented because adding several picks might cause inconsistencies
|
# MP MP commented because adding several picks might cause inconsistencies
|
||||||
data = data_new
|
data = data_new
|
||||||
#data += data_new
|
#data += data_new
|
||||||
except ValueError:
|
except ValueError:
|
||||||
@ -1014,8 +1014,7 @@ class MainWindow(QMainWindow):
|
|||||||
print(message)
|
print(message)
|
||||||
self.update_status(message)
|
self.update_status(message)
|
||||||
if not loc:
|
if not loc:
|
||||||
self.updatePicks(type='auto', event=event)
|
self.updatePicks(event=event)
|
||||||
self.updatePicks(type='manual', event=event)
|
|
||||||
if draw:
|
if draw:
|
||||||
if self.get_current_event().pylot_picks or self.get_current_event().pylot_autopicks:
|
if self.get_current_event().pylot_picks or self.get_current_event().pylot_autopicks:
|
||||||
self.refreshEvents()
|
self.refreshEvents()
|
||||||
@ -2820,14 +2819,13 @@ class MainWindow(QMainWindow):
|
|||||||
def get_deleted_picks_fpath(self, event_path):
|
def get_deleted_picks_fpath(self, event_path):
|
||||||
return os.path.join(event_path, 'deleted_picks.json')
|
return os.path.join(event_path, 'deleted_picks.json')
|
||||||
|
|
||||||
def updatePicks(self, type='manual', event=None):
|
def updatePicks(self, event=None):
|
||||||
if not event:
|
if not event:
|
||||||
event = self.get_current_event()
|
event = self.get_current_event()
|
||||||
|
event.pylot_picks = {}
|
||||||
|
event.pylot_autopicks = {}
|
||||||
picksdict = picksdict_from_picks(evt=self.get_data().get_evt_data())
|
picksdict = picksdict_from_picks(evt=self.get_data().get_evt_data())
|
||||||
if type == 'manual':
|
|
||||||
event.addPicks(picksdict['manual'])
|
event.addPicks(picksdict['manual'])
|
||||||
# event.picks.update(picks) MP MP idea
|
|
||||||
elif type == 'auto':
|
|
||||||
event.addAutopicks(picksdict['auto'])
|
event.addAutopicks(picksdict['auto'])
|
||||||
|
|
||||||
def drawPicks(self, station=None, picktype=None, stime=None):
|
def drawPicks(self, station=None, picktype=None, stime=None):
|
||||||
|
Loading…
Reference in New Issue
Block a user