Merge branch 'develop' into map_projection

This commit is contained in:
Marcel Paffrath 2017-04-11 15:17:48 +02:00
commit d037e0a1f2

View File

@ -1221,16 +1221,15 @@ class PropertiesDlg(QDialog):
self.infile = infile self.infile = infile
self.setWindowTitle("PyLoT Properties")
appName = QApplication.applicationName()
self.setWindowTitle("{0} Properties".format(appName))
self.tabWidget = QTabWidget() self.tabWidget = QTabWidget()
self.tabWidget.addTab(InputsTab(self), "Inputs") self.tabWidget.addTab(InputsTab(self), "Inputs")
self.tabWidget.addTab(OutputsTab(self), "Outputs") self.tabWidget.addTab(OutputsTab(self), "Outputs")
self.tabWidget.addTab(PhasesTab(self), "Phases") self.tabWidget.addTab(PhasesTab(self), "Phases")
self.tabWidget.addTab(GraphicsTab(self), "Graphics") self.tabWidget.addTab(GraphicsTab(self), "Graphics")
self.tabWidget.addTab(LocalisationTab(self), "Loc Tools") #self.tabWidget.addTab(LocalisationTab(self), "Loc. Tools")
self.tabWidget.addTab(LocalisationTab(self), "NonLinLoc")
self.tabWidget.addTab(ParametersTab(self), "Picking Parameters")
self.buttonBox = QDialogButtonBox(QDialogButtonBox.Ok | self.buttonBox = QDialogButtonBox(QDialogButtonBox.Ok |
QDialogButtonBox.Apply | QDialogButtonBox.Apply |
QDialogButtonBox.Close | QDialogButtonBox.Close |
@ -1240,6 +1239,7 @@ class PropertiesDlg(QDialog):
layout.addWidget(self.tabWidget) layout.addWidget(self.tabWidget)
layout.addWidget(self.buttonBox) layout.addWidget(self.buttonBox)
self.setLayout(layout) self.setLayout(layout)
self.setFixedWidth(700)
self.buttonBox.accepted.connect(self.accept) self.buttonBox.accepted.connect(self.accept)
self.buttonBox.rejected.connect(self.reject) self.buttonBox.rejected.connect(self.reject)
@ -1404,14 +1404,14 @@ class LocalisationTab(PropTab):
settings = QSettings() settings = QSettings()
curtool = settings.value("loc/tool", None) curtool = settings.value("loc/tool", None)
loctoollabel = QLabel("location tool") #loctoollabel = QLabel("location tool")
self.locToolComboBox = QComboBox() self.locToolComboBox = QComboBox()
loctools = LOCTOOLS.keys() #loctools = LOCTOOLS.keys()
self.locToolComboBox.addItems(loctools) #self.locToolComboBox.addItems(loctools)
toolind = findComboBoxIndex(self.locToolComboBox, curtool) #toolind = findComboBoxIndex(self.locToolComboBox, curtool)
self.locToolComboBox.setCurrentIndex(toolind) #self.locToolComboBox.setCurrentIndex(toolind)
curroot = settings.value("{0}/rootPath".format(curtool), None) curroot = settings.value("{0}/rootPath".format(curtool), None)
curbin = settings.value("{0}/binPath".format(curtool), None) curbin = settings.value("{0}/binPath".format(curtool), None)
@ -1433,13 +1433,13 @@ class LocalisationTab(PropTab):
binBrowse = QPushButton('...', self) binBrowse = QPushButton('...', self)
binBrowse.clicked.connect(lambda: self.selectDirectory(self.binedit)) binBrowse.clicked.connect(lambda: self.selectDirectory(self.binedit))
self.locToolComboBox.currentIndexChanged.connect(self.updateUi) #self.locToolComboBox.currentIndexChanged.connect(self.updateUi)
self.updateUi() self.updateUi()
layout = QGridLayout() layout = QGridLayout()
layout.addWidget(loctoollabel, 0, 0) #layout.addWidget(loctoollabel, 0, 0)
layout.addWidget(self.locToolComboBox, 0, 1) #layout.addWidget(self.locToolComboBox, 0, 1)
layout.addWidget(self.rootlabel, 1, 0) layout.addWidget(self.rootlabel, 1, 0)
layout.addWidget(self.rootedit, 1, 1) layout.addWidget(self.rootedit, 1, 1)
layout.addWidget(rootBrowse, 1, 2) layout.addWidget(rootBrowse, 1, 2)
@ -1451,7 +1451,7 @@ class LocalisationTab(PropTab):
def updateUi(self): def updateUi(self):
curtool = self.locToolComboBox.currentText() curtool = self.locToolComboBox.currentText()
if curtool is not None: #if curtool is not None:
self.rootlabel.setText("{0} root directory".format(curtool)) self.rootlabel.setText("{0} root directory".format(curtool))
self.binlabel.setText("{0} bin directory".format(curtool)) self.binlabel.setText("{0} bin directory".format(curtool))
@ -1464,8 +1464,8 @@ class LocalisationTab(PropTab):
def getValues(self): def getValues(self):
loctool = self.locToolComboBox.currentText() loctool = self.locToolComboBox.currentText()
values = {"{0}/rootPath".format(loctool): self.rootedit.text(), values = {"{0}/rootPath".format(loctool): self.rootedit.text(),
"{0}/binPath".format(loctool): self.binedit.text(), "{0}/binPath".format(loctool): self.binedit.text()}
"loc/tool": loctool} #"loc/tool": loctool}
return values return values
def resetValues(self, infile): def resetValues(self, infile):
@ -1476,6 +1476,30 @@ class LocalisationTab(PropTab):
values = {"nll/rootPath": self.rootedit.setText("%s" % nllocroot), values = {"nll/rootPath": self.rootedit.setText("%s" % nllocroot),
"nll/binPath": self.binedit.setText("%s" % nllocbin)} "nll/binPath": self.binedit.setText("%s" % nllocbin)}
class ParametersTab(PropTab):
def __init__(self, parent=None, infile=None):
super(ParametersTab, self).__init__(parent)
settings = QSettings()
self.commonpicksettings = QPushButton("Common Settings autoPyLoT")
self.specialpicksettings = QPushButton("Special Settings autoPyLoT")
self.CFsettings = QPushButton("Special Settings for Calculating CF's")
self.FMsettings = QPushButton("Settings for First-Motion Picker")
self.qsettings = QPushButton("Quality Assessment")
self.sourcepara = QPushButton("Settings for Source Parameter Estimation")
layout = QGridLayout()
layout.addWidget(self.commonpicksettings, 0, 0)
layout.addWidget(self.specialpicksettings, 1, 0)
layout.addWidget(self.CFsettings, 2, 0)
layout.addWidget(self.FMsettings, 0, 1)
layout.addWidget(self.qsettings, 1, 1)
layout.addWidget(self.sourcepara, 2, 1)
self.setLayout(layout)
class NewEventDlg(QDialog): class NewEventDlg(QDialog):
def __init__(self, parent=None, titleString="Create a new event"): def __init__(self, parent=None, titleString="Create a new event"):
""" """