1
0
mirror of https://github.com/ARM-software/devlib.git synced 2025-01-31 02:00:45 +00:00

instrument: Fix get_channels method

- `Instrument.channels` is a dictionary, we want the values not the
   keys; this is provded by `list_channels`.

- `InstrumentChannel` objects do not have a `measure` attribute. Use
  `kind` instead.
This commit is contained in:
Brendan Jackman 2017-04-25 15:56:14 +01:00
parent 391e95cc75
commit 1bc29d7abf

View File

@ -179,7 +179,7 @@ class Instrument(object):
def get_channels(self, measure):
if hasattr(measure, 'name'):
measure = measure.name
return [c for c in self.channels if c.measure.name == measure]
return [c for c in self.list_channels() if c.kind == measure]
def add_channel(self, site, measure, name=None, **attrs):
if name is None: