Compare commits
5 Commits
0c3fca9299
...
207d0b3a6f
Author | SHA1 | Date | |
---|---|---|---|
|
207d0b3a6f | ||
|
3b3bbc29d1 | ||
|
a8c6f4c972 | ||
|
0d91f9e3fe | ||
|
494d281d61 |
32
PyLoT.py
32
PyLoT.py
@ -481,7 +481,7 @@ class MainWindow(QMainWindow):
|
|||||||
"automatic pick "
|
"automatic pick "
|
||||||
"data.", False)
|
"data.", False)
|
||||||
self.compare_action.setEnabled(False)
|
self.compare_action.setEnabled(False)
|
||||||
self.qualities_action = self.createAction(parent=self, text='Show pick qualitites...',
|
self.qualities_action = self.createAction(parent=self, text='Show pick qualities...',
|
||||||
slot=self.pickQualities, shortcut='Alt+Q',
|
slot=self.pickQualities, shortcut='Alt+Q',
|
||||||
icon=qualities_icon, tip='Histogram of pick qualities')
|
icon=qualities_icon, tip='Histogram of pick qualities')
|
||||||
self.qualities_action.setEnabled(False)
|
self.qualities_action.setEnabled(False)
|
||||||
@ -1181,7 +1181,7 @@ class MainWindow(QMainWindow):
|
|||||||
'''
|
'''
|
||||||
if not self.project:
|
if not self.project:
|
||||||
self.createNewProject()
|
self.createNewProject()
|
||||||
ed = getExistingDirectories(self, 'Select event directories...')
|
ed = GetExistingDirectories(self, 'Select event directories...')
|
||||||
if ed.exec_():
|
if ed.exec_():
|
||||||
eventlist = [event for event in ed.selectedFiles() if not event.endswith('EVENTS-INFO')]
|
eventlist = [event for event in ed.selectedFiles() if not event.endswith('EVENTS-INFO')]
|
||||||
basepath = eventlist[0].split(os.path.basename(eventlist[0]))[0]
|
basepath = eventlist[0].split(os.path.basename(eventlist[0]))[0]
|
||||||
@ -2898,7 +2898,9 @@ class MainWindow(QMainWindow):
|
|||||||
self.log_deleted_picks([deleted_pick])
|
self.log_deleted_picks([deleted_pick])
|
||||||
|
|
||||||
def log_deleted_picks(self, deleted_picks, event_path=None):
|
def log_deleted_picks(self, deleted_picks, event_path=None):
|
||||||
''' Log deleted picks to list self.deleted_picks '''
|
'''
|
||||||
|
Log deleted picks to list self.deleted_picks
|
||||||
|
'''
|
||||||
if not event_path:
|
if not event_path:
|
||||||
event_path = self.get_current_event_path()
|
event_path = self.get_current_event_path()
|
||||||
for deleted_pick in deleted_picks:
|
for deleted_pick in deleted_picks:
|
||||||
@ -2912,7 +2914,9 @@ class MainWindow(QMainWindow):
|
|||||||
self.deleted_picks[event_path].append(deleted_pick)
|
self.deleted_picks[event_path].append(deleted_pick)
|
||||||
|
|
||||||
def dump_deleted_picks(self, event_path):
|
def dump_deleted_picks(self, event_path):
|
||||||
''' Save deleted picks to json file for event in event_path. Load old file before and merge'''
|
'''
|
||||||
|
Save deleted picks to json file for event in event_path. Load old file before and merge
|
||||||
|
'''
|
||||||
try:
|
try:
|
||||||
deleted_picks_from_file = self.load_deleted_picks(event_path)
|
deleted_picks_from_file = self.load_deleted_picks(event_path)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
@ -3822,7 +3826,7 @@ class MainWindow(QMainWindow):
|
|||||||
def helpHelp(self):
|
def helpHelp(self):
|
||||||
if checkurl():
|
if checkurl():
|
||||||
form = HelpForm(self,
|
form = HelpForm(self,
|
||||||
'https://ariadne.geophysik.ruhr-uni-bochum.de/trac/PyLoT/wiki')
|
'https://github.com/seismology-RUB/PyLoT')
|
||||||
else:
|
else:
|
||||||
form = HelpForm(self, ':/help.html')
|
form = HelpForm(self, ':/help.html')
|
||||||
form.show()
|
form.show()
|
||||||
@ -4002,13 +4006,13 @@ class Project(object):
|
|||||||
return project
|
return project
|
||||||
|
|
||||||
|
|
||||||
class getExistingDirectories(QFileDialog):
|
class GetExistingDirectories(QFileDialog):
|
||||||
'''
|
'''
|
||||||
File dialog with possibility to select multiple folders.
|
File dialog with possibility to select multiple folders.
|
||||||
'''
|
'''
|
||||||
|
|
||||||
def __init__(self, *args):
|
def __init__(self, *args):
|
||||||
super(getExistingDirectories, self).__init__(*args)
|
super(GetExistingDirectories, self).__init__(*args)
|
||||||
self.setOption(self.DontUseNativeDialog, True)
|
self.setOption(self.DontUseNativeDialog, True)
|
||||||
self.setOption(self.ReadOnly, True)
|
self.setOption(self.ReadOnly, True)
|
||||||
self.setFileMode(self.Directory)
|
self.setFileMode(self.Directory)
|
||||||
@ -4034,16 +4038,7 @@ def create_window():
|
|||||||
return app, app_created
|
return app, app_created
|
||||||
|
|
||||||
|
|
||||||
def main(args=None):
|
def main(project_filename=None, pylot_infile=None, reset_qsettings=False):
|
||||||
project_filename = None
|
|
||||||
# args.project_filename = 'C:/Shared/AlpArray/alparray_data/project_alparray_test.plp'
|
|
||||||
pylot_infile = None
|
|
||||||
if args:
|
|
||||||
if args.project_filename:
|
|
||||||
project_filename = args.project_filename
|
|
||||||
if args.input_filename:
|
|
||||||
pylot_infile = args.input_filename
|
|
||||||
reset_qsettings = args.reset_qsettings
|
|
||||||
|
|
||||||
# create the Qt application
|
# create the Qt application
|
||||||
pylot_app, app_created = create_window()
|
pylot_app, app_created = create_window()
|
||||||
@ -4092,4 +4087,5 @@ if __name__ == "__main__":
|
|||||||
parser.add_argument('--reset_qsettings', default=False, action='store_true',
|
parser.add_argument('--reset_qsettings', default=False, action='store_true',
|
||||||
help='reset qsettings (debug option)')
|
help='reset qsettings (debug option)')
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
sys.exit(main(args))
|
sys.exit(main(project_filename=args.project_filename, pylot_infile=args.input_filename,
|
||||||
|
reset_qsettings=args.reset_qsettings))
|
||||||
|
Loading…
Reference in New Issue
Block a user