summaryrefslogtreecommitdiff
path: root/grc/python
diff options
context:
space:
mode:
authorSebastian Koslowski <koslowski@kit.edu>2014-12-03 14:16:23 +0100
committerSebastian Koslowski <koslowski@kit.edu>2014-12-03 16:27:25 +0100
commite68643bb7c7134c88f38a26b22830a4897590f1e (patch)
treed35579300510b695e43159ab5c5976a449f32521 /grc/python
parent5fc2db030c7bc52d10ca06bae452ca5d0eb99591 (diff)
grc: use domain connection templates in Generator
Diffstat (limited to 'grc/python')
-rw-r--r--grc/python/Generator.py2
-rw-r--r--grc/python/flow_graph.tmpl7
2 files changed, 6 insertions, 3 deletions
diff --git a/grc/python/Generator.py b/grc/python/Generator.py
index 24d943d28d..78e8031f19 100644
--- a/grc/python/Generator.py
+++ b/grc/python/Generator.py
@@ -165,6 +165,7 @@ class TopBlockGenerator(object):
blocks = filter(lambda b: b not in (imports + parameters), blocks)
#list of connections where each endpoint is enabled
connections = filter(lambda c: not (c.is_bus() or c.is_msg() or c.is_message()), self._flow_graph.get_enabled_connections())
+ connection_templates = self._flow_graph.get_parent().get_connection_templates()
messages = filter(lambda c: c.is_msg(), self._flow_graph.get_enabled_connections())
messages2 = filter(lambda c: c.is_message(), self._flow_graph.get_enabled_connections())
#list of variable names
@@ -191,6 +192,7 @@ class TopBlockGenerator(object):
'monitors': monitors,
'blocks': blocks,
'connections': connections,
+ 'connection_templates': connection_templates,
'messages': messages,
'messages2': messages2,
'generate_options': self._generate_options,
diff --git a/grc/python/flow_graph.tmpl b/grc/python/flow_graph.tmpl
index b07c296d09..3769e0a835 100644
--- a/grc/python/flow_graph.tmpl
+++ b/grc/python/flow_graph.tmpl
@@ -201,15 +201,16 @@ gr.io_signaturev($(len($io_sigs)), $(len($io_sigs)), [$(', '.join($size_strs))])
$DIVIDER
#end if
#for $con in $connections
- #set $source = $con.get_source()
- #set $sink = $con.get_sink()
+ #set global $source = $con.get_source()
+ #set global $sink = $con.get_sink()
##resolve virtual sources to the actual sources
#if $source.get_parent().is_virtual_source()
#set $source = $source.resolve_virtual_source()
#end if
##do not generate connections with virtual sinks
#if not $sink.get_parent().is_virtual_sink()
- self.connect($make_port_sig($source), $make_port_sig($sink))
+ #include source=$connection_templates[($source.get_domain(), $sink.get_domain())]
+
#end if
#end for