added network code to TuneAutopicker, small bugfix

This commit is contained in:
Marcel Paffrath 2017-05-31 17:31:58 +02:00
parent cf399ed747
commit eaa4849a20
3 changed files with 9 additions and 6 deletions

View File

@ -1503,6 +1503,7 @@ class MainWindow(QMainWindow):
self.tap.update.connect(self.update_autopicker) self.tap.update.connect(self.update_autopicker)
self.tap.figure_tabs.setCurrentIndex(0) self.tap.figure_tabs.setCurrentIndex(0)
else: else:
self.update_autopicker()
self.tap.fill_eventbox() self.tap.fill_eventbox()
self.tap.show() self.tap.show()

View File

@ -1 +1 @@
7d73-dirty cf399-dirty

View File

@ -1424,12 +1424,14 @@ class TuneAutopicker(QWidget):
stations = [] stations = []
for trace in self.data.getWFData(): for trace in self.data.getWFData():
station = trace.stats.station station = trace.stats.station
if not station in stations: network = trace.stats.network
stations.append(str(station)) ns_tup = (str(network), str(station))
if not ns_tup in stations:
stations.append(ns_tup)
stations.sort() stations.sort()
model = self.stationBox.model() model = self.stationBox.model()
for station in stations: for network, station in stations:
item = QtGui.QStandardItem(str(station)) item = QtGui.QStandardItem(network+'.'+station)
if station in self.get_current_event().picks: if station in self.get_current_event().picks:
item.setBackground(self.parent._colors['ref']) item.setBackground(self.parent._colors['ref'])
model.appendRow(item) model.appendRow(item)
@ -1491,7 +1493,7 @@ class TuneAutopicker(QWidget):
return event.autopicks[station] return event.autopicks[station]
def get_current_station(self): def get_current_station(self):
return str(self.stationBox.currentText()) return str(self.stationBox.currentText()).split('.')[-1]
def gen_tab_widget(self, name, canvas): def gen_tab_widget(self, name, canvas):
widget = QtGui.QWidget() widget = QtGui.QWidget()