From a46b0db583500096f6960ba6319028b44800fb85 Mon Sep 17 00:00:00 2001 From: Sebastian Wehling-Benatelli Date: Thu, 2 Jul 2015 10:32:35 +0200 Subject: [PATCH] new method to return the traceID for given channel names --- pylot/core/util/widgets.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pylot/core/util/widgets.py b/pylot/core/util/widgets.py index bda8e745..8263f6ef 100644 --- a/pylot/core/util/widgets.py +++ b/pylot/core/util/widgets.py @@ -345,6 +345,16 @@ class PickDlg(QDialog): def getChannelID(self, key): return self.getPlotWidget().getPlotDict()[int(key)][1] + def getTraceID(self, channels): + plotDict = self.getPlotWidget().getPlotDict() + traceIDs = [] + for channel in channels: + channel = channel.upper() + for traceID, channelID in plotDict.iteritems(): + if channelID[1].upper().endswith(channel): + traceIDs.append(traceID) + return traceIDs + def getFilterOptions(self, phase): options = self.filteroptions[phase] return FilterOptions(**options)