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.figure_tabs.setCurrentIndex(0)
else:
self.update_autopicker()
self.tap.fill_eventbox()
self.tap.show()

View File

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

View File

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