[refs #195] pushing GUI element implementation forward

This commit is contained in:
Sebastian Wehling-Benatelli 2016-06-07 13:51:03 +02:00
parent dd668b90d6
commit 8e09fd7c42
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.data import Data
from pylot.core.io.inputs import FilterOptions, AutoPickParameter from pylot.core.io.inputs import FilterOptions, AutoPickParameter
from pylot.core.pick.autopick import autopickevent 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.io.phases import picksdict_from_picks
from pylot.core.loc.nll import locate as locateNll from pylot.core.loc.nll import locate as locateNll
from pylot.core.util.defaults import FILTERDEFAULTS, COMPNAME_MAP, \ from pylot.core.util.defaults import FILTERDEFAULTS, COMPNAME_MAP, \
@ -53,7 +54,8 @@ from pylot.core.util.utils import fnConstructor, getLogin, \
getGlobalTimes getGlobalTimes
from pylot.core.io.location import create_creation_info, create_event from pylot.core.io.location import create_creation_info, create_event
from pylot.core.util.widgets import FilterOptionsDialog, NewEventDlg, \ 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.structure import DATASTRUCTURE
from pylot.core.util.thread import AutoPickThread from pylot.core.util.thread import AutoPickThread
from pylot.core.util.version import get_git_version as _getVersionString from pylot.core.util.version import get_git_version as _getVersionString
@ -578,7 +580,9 @@ class MainWindow(QMainWindow):
def comparePicks(self): def comparePicks(self):
if self.check4Comparison(): 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): def getPlotWidget(self):
return self.DataPlot return self.DataPlot

View File

@ -64,16 +64,43 @@ def createAction(parent, text, slot=None, shortcut=None, icon=None,
action.setCheckable(True) action.setCheckable(True)
return action return action
class ComparsionDialog(QDialog): class ComparisonDialog(QDialog):
def __init__(self, c, parent=None): def __init__(self, c, parent=None):
self._data = c self._data = c
self._stats = c.keys() self._stats = c.keys()
self._canvas = PlotWidget(parent) self._canvas = PlotWidget(self)
super(ComparsionDialog, self).__init__(parent) super(ComparisonDialog, self).__init__(parent)
self self.setupUI()
def setupUI(self): 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 @property
def canvas(self): def canvas(self):