summaryrefslogtreecommitdiff
path: root/grc/src/platforms/python
diff options
context:
space:
mode:
authorjblum2009-05-03 09:05:21 +0000
committerjblum2009-05-03 09:05:21 +0000
commite2a718865bbcb7196637404855447cbe4d0b88f6 (patch)
tree76905f3e483806445349b2532f4e8027fb5d8d5c /grc/src/platforms/python
parentc429b6a947f9532a4f0d3160bddb0f7af0b65e3c (diff)
downloadgnuradio-e2a718865bbcb7196637404855447cbe4d0b88f6.tar.gz
gnuradio-e2a718865bbcb7196637404855447cbe4d0b88f6.tar.bz2
gnuradio-e2a718865bbcb7196637404855447cbe4d0b88f6.zip
Cleanup: port modify code, other misc cleanup.
Fix: flowgraph update removes deleted-selected elements. Fix: do all selected elements when putting selected elements on-top. Fix: simplified get_elements, was causing strange bug. git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@10947 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'grc/src/platforms/python')
-rw-r--r--grc/src/platforms/python/Block.py28
1 files changed, 15 insertions, 13 deletions
diff --git a/grc/src/platforms/python/Block.py b/grc/src/platforms/python/Block.py
index 38a0ce492..341e5fdc3 100644
--- a/grc/src/platforms/python/Block.py
+++ b/grc/src/platforms/python/Block.py
@@ -110,19 +110,21 @@ class Block(_Block):
@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
+ #concat the nports string from the private nports settings of both port0
+ nports_str = \
+ (self.get_sinks() and self.get_sinks()[0]._nports or '') + \
+ (self.get_sources() and self.get_sources()[0]._nports or '')
+ #modify all params whose keys appear in the nports string
+ for param in self.get_params():
+ if param.is_enum() or param.get_key() not in nports_str: continue
+ #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):