From 43c2b97b3db425a719afe4075e842d846f2d5fbb Mon Sep 17 00:00:00 2001 From: Jeldrik Gaal Date: Tue, 24 Jan 2023 11:45:12 +0100 Subject: [PATCH] Small changes --- PyLoT.py | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/PyLoT.py b/PyLoT.py index 88d752e2..65f6dd64 100755 --- a/PyLoT.py +++ b/PyLoT.py @@ -738,12 +738,12 @@ class MainWindow(QMainWindow): self.stdout = self.logwidget.stdout self.stderr = self.logwidget.stderr - sys.stdout = self.stdout - sys.stderr = self.stderr + self.stdout = self.stdout + self.stderr = self.stderr # Not sure why but the lines above kept messing with the Ouput even with use_logwidget disabled - sys.stdout = self.stdout - sys.stderr = self.stderr + sys.stdout = sys.__stdout__ + sys.stderr = sys.__stderr__ self.setCentralWidget(_widget) @@ -2517,9 +2517,13 @@ class MainWindow(QMainWindow): self.dataPlot.draw() def pickOnStation(self, gui_event): + sys.stdout = sys.__stdout__ + + print ( "xxxxxxxxxxx" ) + if self.pg: button = gui_event.button() - if not button in [1, 4]: + if not button in [1,2, 4]: return else: button = gui_event.button @@ -2539,8 +2543,25 @@ class MainWindow(QMainWindow): station = self.getStationName(wfID) location = self.getLocationName(wfID) seed_id = self.getTraceID(wfID) - if button == 1: + if button == 2: self.pickDialog(wfID, seed_id) + elif button == 1: + print ( " XXX " ) + stations = [] + names = [] + traces = {} + + for tr in self.get_data().wfdata.traces: + if not tr.stats.station in stations: + stations.append(tr.stats.station) + names.append(tr.stats.network + '.' + tr.stats.station) + for station in stations: + traces[station] = {} + for ch in ['Z', 'N', 'E']: + for tr in self.get_data().wfdata.select(component=ch).traces: + traces[tr.stats.station][ch] = tr + print ( traces[station]['Z'] ) + print ( "XXXXXXXXXXXXXXXXXXXXXXXXXXX" ) elif button == 4: self.toggle_station_color(wfID, network, station, location)