Merge branch 'develop' of ariadne.geophysik.ruhr-uni-bochum.de:/data/git/pylot into develop
This commit is contained in:
commit
02dbca06f2
38
QtPyLoT.py
38
QtPyLoT.py
@ -57,6 +57,7 @@ import icons_rc
|
||||
|
||||
class MainWindow(QMainWindow):
|
||||
__version__ = _getVersionString()
|
||||
__slots__ = ['loc']
|
||||
closing = Signal()
|
||||
|
||||
def __init__(self, parent=None):
|
||||
@ -89,6 +90,7 @@ class MainWindow(QMainWindow):
|
||||
self.filteroptions = {}
|
||||
self.pickDlgs = {}
|
||||
self.picks = {}
|
||||
self.locflag(False)
|
||||
|
||||
# UI has to be set up before(!) children widgets are about to show up
|
||||
self.setupUi()
|
||||
@ -160,6 +162,8 @@ class MainWindow(QMainWindow):
|
||||
e_icon.addPixmap(QPixmap(':/icons/key_E.png'))
|
||||
auto_icon = QIcon()
|
||||
auto_icon.addPixmap(QPixmap(':/icons/sync.png'))
|
||||
locate_icon = QIcon()
|
||||
locate_icon.addPixmap(QPixmap(':/icons/locate.png'))
|
||||
|
||||
newEventAction = self.createAction(self, "&New event ...",
|
||||
self.createNewEvent,
|
||||
@ -284,6 +288,16 @@ class MainWindow(QMainWindow):
|
||||
# pickToolBar.setObjectName("PickTools")
|
||||
# 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.setFrameStyle(QFrame.StyledPanel | QFrame.Sunken)
|
||||
status = self.statusBar()
|
||||
@ -635,6 +649,10 @@ class MainWindow(QMainWindow):
|
||||
self.drawPicks(station)
|
||||
else:
|
||||
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):
|
||||
list = QListWidget()
|
||||
@ -746,6 +764,26 @@ class MainWindow(QMainWindow):
|
||||
[mpp + spe, mpp + spe], ylims, colors[1])
|
||||
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):
|
||||
self.statusBar().showMessage(message, duration)
|
||||
if self.getData() is not None:
|
||||
|
@ -2,6 +2,7 @@
|
||||
<qresource>
|
||||
<file>icons/pylot.ico</file>
|
||||
<file>icons/pylot.png</file>
|
||||
<file>icons/locate.png</file>
|
||||
<file>icons/printer.png</file>
|
||||
<file>icons/delete.png</file>
|
||||
<file>icons/key_E.png</file>
|
||||
|
BIN
icons/locate.png
Executable 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
Loading…
Reference in New Issue
Block a user