projects
/
pycomedi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1e324c0
)
Add .ranges() method to Channel class.
author
W. Trevor King
<wking@drexel.edu>
Mon, 19 Mar 2012 13:09:30 +0000
(09:09 -0400)
committer
W. Trevor King
<wking@drexel.edu>
Mon, 19 Mar 2012 13:09:30 +0000
(09:09 -0400)
pycomedi/channel.pyx
patch
|
blob
|
history
diff --git
a/pycomedi/channel.pyx
b/pycomedi/channel.pyx
index b743731581f17f55a5995a1114cd21a081f4f4d8..76bb5eba9496ccf1fe7741c95bd594fa762afc34 100644
(file)
--- a/
pycomedi/channel.pyx
+++ b/
pycomedi/channel.pyx
@@
-119,6
+119,15
@@
cdef class Channel (object):
"""
return self.get_range(self._find_range(unit, min, max))
+ def ranges(self, **kwargs):
+ "Iterate through all available ranges."
+ ret = []
+ for i in range(self.get_n_ranges()):
+ #yield self.subdevice(i, **kwargs)
+ # Generators are not supported in Cython 0.14.1
+ ret.append(self.get_range(i, **kwargs))
+ return ret
+
cdef class DigitalChannel (Channel):
"""Channel configured for reading or writing digital data.