Merge branch 'develop' of ariadne.geophysik.ruhr-uni-bochum.de:/data/git/pylot into develop

This commit is contained in:
Marcel Paffrath 2015-11-09 16:12:45 +01:00
commit 02dbca06f2
4 changed files with 43 additions and 4 deletions

View File

@ -57,6 +57,7 @@ import icons_rc
class MainWindow(QMainWindow): class MainWindow(QMainWindow):
__version__ = _getVersionString() __version__ = _getVersionString()
__slots__ = ['loc']
closing = Signal() closing = Signal()
def __init__(self, parent=None): def __init__(self, parent=None):
@ -89,6 +90,7 @@ class MainWindow(QMainWindow):
self.filteroptions = {} self.filteroptions = {}
self.pickDlgs = {} self.pickDlgs = {}
self.picks = {} self.picks = {}
self.locflag(False)
# UI has to be set up before(!) children widgets are about to show up # UI has to be set up before(!) children widgets are about to show up
self.setupUi() self.setupUi()
@ -160,6 +162,8 @@ class MainWindow(QMainWindow):
e_icon.addPixmap(QPixmap(':/icons/key_E.png')) e_icon.addPixmap(QPixmap(':/icons/key_E.png'))
auto_icon = QIcon() auto_icon = QIcon()
auto_icon.addPixmap(QPixmap(':/icons/sync.png')) auto_icon.addPixmap(QPixmap(':/icons/sync.png'))
locate_icon = QIcon()
locate_icon.addPixmap(QPixmap(':/icons/locate.png'))
newEventAction = self.createAction(self, "&New event ...", newEventAction = self.createAction(self, "&New event ...",
self.createNewEvent, self.createNewEvent,
@ -284,6 +288,16 @@ class MainWindow(QMainWindow):
# pickToolBar.setObjectName("PickTools") # pickToolBar.setObjectName("PickTools")
# self.addActions(pickToolBar, pickToolActions) # self.addActions(pickToolBar, pickToolActions)
locateEvent = self.createAction(parent=self, text='locateEvent',
slot=self.locateEvent, shortcut='Alt+Ctrl+L',
icon=locate_icon, tip='Locate the event using '
'the picked arrivals.')
locationToolBar = self.addToolBar("LocationTools")
locationToolActions = (locateEvent,)
locationToolBar.setObjectName("LocationTools")
self.addActions(locationToolBar, locationToolActions)
self.eventLabel = QLabel() self.eventLabel = QLabel()
self.eventLabel.setFrameStyle(QFrame.StyledPanel | QFrame.Sunken) self.eventLabel.setFrameStyle(QFrame.StyledPanel | QFrame.Sunken)
status = self.statusBar() status = self.statusBar()
@ -635,6 +649,10 @@ class MainWindow(QMainWindow):
self.drawPicks(station) self.drawPicks(station)
else: else:
self.updateStatus('picks discarded ({0})'.format(station)) self.updateStatus('picks discarded ({0})'.format(station))
if not self.locflag() and self.check4Loc():
self.locflag(True)
elif self.locflag() and not self.check4Loc():
self.locflag(False)
def autoPick(self): def autoPick(self):
list = QListWidget() list = QListWidget()
@ -746,6 +764,26 @@ class MainWindow(QMainWindow):
[mpp + spe, mpp + spe], ylims, colors[1]) [mpp + spe, mpp + spe], ylims, colors[1])
self.draw() self.draw()
def locateEvent(self):
pass
def check4Loc(self):
return self.picksNum() > 4
def picksNum(self):
num = 0
for phases in self.getPicks().values():
num += len(phases)
return num
@property
def locflag(self):
return self.loc
@locflag.setter
def locflag(self, value):
self.loc = value
def updateStatus(self, message, duration=5000): def updateStatus(self, message, duration=5000):
self.statusBar().showMessage(message, duration) self.statusBar().showMessage(message, duration)
if self.getData() is not None: if self.getData() is not None:

View File

@ -2,6 +2,7 @@
<qresource> <qresource>
<file>icons/pylot.ico</file> <file>icons/pylot.ico</file>
<file>icons/pylot.png</file> <file>icons/pylot.png</file>
<file>icons/locate.png</file>
<file>icons/printer.png</file> <file>icons/printer.png</file>
<file>icons/delete.png</file> <file>icons/delete.png</file>
<file>icons/key_E.png</file> <file>icons/key_E.png</file>

BIN
icons/locate.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

File diff suppressed because one or more lines are too long