Merged branch 195 into develop

This commit is contained in:
Sebastian Wehling-Benatelli 2016-06-07 14:09:41 +02:00
commit e6d8701411
2 changed files with 38 additions and 7 deletions

View File

@ -42,6 +42,7 @@ from obspy import UTCDateTime
from pylot.core.io.data import Data
from pylot.core.io.inputs import FilterOptions, AutoPickParameter
from pylot.core.pick.autopick import autopickevent
from pylot.core.pick.compare import Comparison
from pylot.core.io.phases import picksdict_from_picks
from pylot.core.loc.nll import locate as locateNll
from pylot.core.util.defaults import FILTERDEFAULTS, COMPNAME_MAP, \
@ -53,7 +54,8 @@ from pylot.core.util.utils import fnConstructor, getLogin, \
getGlobalTimes
from pylot.core.io.location import create_creation_info, create_event
from pylot.core.util.widgets import FilterOptionsDialog, NewEventDlg, \
WaveformWidget, PropertiesDlg, HelpForm, createAction, PickDlg, getDataType
WaveformWidget, PropertiesDlg, HelpForm, createAction, PickDlg, \
getDataType, ComparisonDialog
from pylot.core.util.structure import DATASTRUCTURE
from pylot.core.util.thread import AutoPickThread
from pylot.core.util.version import get_git_version as _getVersionString
@ -578,7 +580,9 @@ class MainWindow(QMainWindow):
def comparePicks(self):
if self.check4Comparison():
compare_dlg = ComparisonDialog(self)
co = Comparison(auto=self.getPicks('auto'), manu=self.getPicks())
compare_dlg = ComparisonDialog(co, self)
compare_dlg.exec_()
def getPlotWidget(self):
return self.DataPlot

View File

@ -64,16 +64,43 @@ def createAction(parent, text, slot=None, shortcut=None, icon=None,
action.setCheckable(True)
return action
class ComparsionDialog(QDialog):
class ComparisonDialog(QDialog):
def __init__(self, c, parent=None):
self._data = c
self._stats = c.keys()
self._canvas = PlotWidget(parent)
super(ComparsionDialog, self).__init__(parent)
self
self._canvas = PlotWidget(self)
super(ComparisonDialog, self).__init__(parent)
self.setupUI()
def setupUI(self):
pass
_outerlayout = QVBoxLayout(self)
_innerlayout = QVBoxLayout(self)
_stats_combobox = QComboBox(self)
_stats_combobox.setEditable(True)
_stats_combobox.addItems(self.stations)
_stats_combobox.textChanged.connect(self.plotcomparison)
_phases_combobox = QComboBox(self)
_phases_combobox.addItems(['P', 'S'])
_toolbar = QToolBar(self)
_toolbar.addWidget(_stats_combobox)
_toolbar.addWidget(_phases_combobox)
_buttonbox = QDialogButtonBox(QDialogButtonBox.Close)
_innerlayout.addWidget(self.canvas)
_innerlayout.addWidget(_buttonbox)
_outerlayout.addWidget(_toolbar)
_outerlayout.addLayout(_innerlayout)
_buttonbox.rejected.connect(self.reject)
# finally layout the entire dialog
self.setLayout(_outerlayout)
@property
def canvas(self):