Locate button is initialized as soon as number of picks is equal/greater 4.

This commit is contained in:
Ludger Küperkoch 2017-04-10 14:43:11 +02:00
parent 95dce91ada
commit 43eecfe78b

View File

@ -688,7 +688,6 @@ class MainWindow(QMainWindow):
self.openautopicksaction.setEnabled(True) self.openautopicksaction.setEnabled(True)
self.loadpilotevent.setEnabled(True) self.loadpilotevent.setEnabled(True)
self.saveEventAction.setEnabled(True) self.saveEventAction.setEnabled(True)
self.locateEvent.setEnabled(True)
if ans: if ans:
self.plotWaveformData() self.plotWaveformData()
return ans return ans
@ -834,6 +833,7 @@ class MainWindow(QMainWindow):
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():
self.locateEvent.setEnabled(True)
self.set_loc_flag(True) self.set_loc_flag(True)
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)
@ -1071,7 +1071,7 @@ class MainWindow(QMainWindow):
return None return None
def check4Loc(self): def check4Loc(self):
return self.picksNum() > 4 return self.picksNum() >= 4
def check4Comparison(self): def check4Comparison(self):
mpicks = self.getPicks() mpicks = self.getPicks()