summaryrefslogtreecommitdiff
path: root/grc/src/platforms/python/Block.py
diff options
context:
space:
mode:
authorjblum2009-02-12 19:47:23 +0000
committerjblum2009-02-12 19:47:23 +0000
commitd3d62764237a2834a8a4eb54934afba8c63999d9 (patch)
tree45d72759d94a27d1a33aa5acca1c3ac058b2055d /grc/src/platforms/python/Block.py
parentf962f54c6089f60fbd395464e6771701a85f57fd (diff)
downloadgnuradio-d3d62764237a2834a8a4eb54934afba8c63999d9.tar.gz
gnuradio-d3d62764237a2834a8a4eb54934afba8c63999d9.tar.bz2
gnuradio-d3d62764237a2834a8a4eb54934afba8c63999d9.zip
port and type controller modify logic out of gui
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@10442 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'grc/src/platforms/python/Block.py')
-rw-r--r--grc/src/platforms/python/Block.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/grc/src/platforms/python/Block.py b/grc/src/platforms/python/Block.py
index 91b86cc85..3c45117a3 100644
--- a/grc/src/platforms/python/Block.py
+++ b/grc/src/platforms/python/Block.py
@@ -104,6 +104,28 @@ class Block(_Block):
ports[key] = port
continue
+ def port_controller_modify(self, direction):
+ """
+ Change the port controller.
+ @param direction +1 or -1
+ @return true for change
+ """
+ changed = False
+ for ports in (self.get_sinks(), self.get_sources()):
+ if ports and ports[0].get_nports():
+ #find the param that controls port0
+ for param in self.get_params():
+ if not param.is_enum() and param.get_key() in ports[0]._nports:
+ #try to increment the port controller by direction
+ try:
+ value = param.evaluate()
+ value = value + direction
+ assert 0 < value
+ param.set_value(value)
+ changed = True
+ except: pass
+ return changed
+
def get_doc(self):
doc = self._doc.strip('\n').replace('\\\n', '')
#merge custom doc with doxygen docs