diff options
-rw-r--r-- | grc/base/Block.py | 15 | ||||
-rw-r--r-- | grc/python/FlowGraph.py | 34 |
2 files changed, 49 insertions, 0 deletions
diff --git a/grc/base/Block.py b/grc/base/Block.py index b0b96422a7..0ab9607b6d 100644 --- a/grc/base/Block.py +++ b/grc/base/Block.py @@ -368,3 +368,18 @@ class Block(Element): #store hash and call rewrite my_hash = get_hash() self.rewrite() + bussinks = n.findall('bus_sink'); + if len(bussinks) > 0 and not self._bussify_sink: + self.bussify({'name':'bus','type':'bus'}, 'sink') + elif len(bussinks) > 0: + self.bussify({'name':'bus','type':'bus'}, 'sink') + self.bussify({'name':'bus','type':'bus'}, 'sink') + + bussrcs = n.findall('bus_source'); + if len(bussrcs) > 0 and not self._bussify_source: + self.bussify({'name':'bus','type':'bus'}, 'source') + elif len(bussrcs) > 0: + self.bussify({'name':'bus','type':'bus'}, 'source') + self.bussify({'name':'bus','type':'bus'}, 'source') + + diff --git a/grc/python/FlowGraph.py b/grc/python/FlowGraph.py index 22ed4f76d6..180d605720 100644 --- a/grc/python/FlowGraph.py +++ b/grc/python/FlowGraph.py @@ -154,6 +154,40 @@ class FlowGraph(_FlowGraph, _GUIFlowGraph): monitors = filter(lambda b: _monitors_searcher.search(b.get_key()), self.get_enabled_blocks()) return monitors + + def get_bussink(self): + bussink = filter(lambda b: _bussink_searcher.search(b.get_key()), self.get_enabled_blocks()) + + for i in bussink: + for j in i.get_params(): + if j.get_name() == 'On/Off' and j.get_value() == 'on': + return True; + + return False + + + + def get_bussrc(self): + bussrc = filter(lambda b: _bussrc_searcher.search(b.get_key()), self.get_enabled_blocks()) + + for i in bussrc: + for j in i.get_params(): + if j.get_name() == 'On/Off' and j.get_value() == 'on': + return True; + + return False + + def get_bus_structure_sink(self): + bussink = filter(lambda b: _bus_struct_sink_searcher.search(b.get_key()), self.get_enabled_blocks()) + + return bussink + + def get_bus_structure_src(self): + bussrc = filter(lambda b: _bus_struct_src_searcher.search(b.get_key()), self.get_enabled_blocks()) + + return bussrc + + def rewrite(self): """ Flag the namespace to be renewed. |