summaryrefslogtreecommitdiff
path: root/grc/python/Port.py
diff options
context:
space:
mode:
authorJosh Blum2009-08-28 01:09:08 -0700
committerJosh Blum2009-08-28 01:09:08 -0700
commit36d1520f0ac73b64bd0541b422552a6d419c7ffd (patch)
tree6d29128c2cd3523804078567800fa470db751a45 /grc/python/Port.py
parentdc9e9db16047ec589a7b0488fac04c5bb682903c (diff)
downloadgnuradio-36d1520f0ac73b64bd0541b422552a6d419c7ffd.tar.gz
gnuradio-36d1520f0ac73b64bd0541b422552a6d419c7ffd.tar.bz2
gnuradio-36d1520f0ac73b64bd0541b422552a6d419c7ffd.zip
added virtual source and added stream ids, logic to clone in port
Diffstat (limited to 'grc/python/Port.py')
-rw-r--r--grc/python/Port.py20
1 files changed, 15 insertions, 5 deletions
diff --git a/grc/python/Port.py b/grc/python/Port.py
index dde736dba..b386e3f89 100644
--- a/grc/python/Port.py
+++ b/grc/python/Port.py
@@ -69,13 +69,23 @@ class Port(_Port):
Handle the port cloning for virtual blocks.
"""
_Port.rewrite(self)
- #virtual sink logic
- if self.get_parent().get_key() == 'virtual_sink':
- if self.get_enabled_connections(): #clone type and vlen
- source = self.get_enabled_connections()[0].get_source()
+ if self.get_parent().get_key() in ('virtual_sink', 'virtual_source'):
+ try:
+ if self.get_parent().get_key() == 'virtual_sink':
+ source = self.get_enabled_connections()[0].get_source()
+ if self.get_parent().get_key() == 'virtual_source':
+ source = filter(
+ lambda vs: vs.get_param('stream_id').get_value() == self.get_parent().get_param('stream_id').get_value(),
+ filter(
+ lambda b: b.get_key() == 'virtual_sink',
+ self.get_parent().get_parent().get_enabled_blocks(),
+ ),
+ )[0].get_sink('0').get_enabled_connections()[0].get_source()
+ #clone type and vlen
self._type = str(source.get_type())
self._vlen = str(source.get_vlen())
- else: #reset type and vlen
+ except:
+ #reset type and vlen
self._type = ''
self._vlen = ''