[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 05/22: grc: use domain connection templates
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 05/22: grc: use domain connection templates in Generator |
Date: |
Tue, 23 Dec 2014 09:38:56 +0000 (UTC) |
This is an automated email from the git hooks/post-receive script.
jcorgan pushed a commit to branch master
in repository gnuradio.
commit e68643bb7c7134c88f38a26b22830a4897590f1e
Author: Sebastian Koslowski <address@hidden>
Date: Wed Dec 3 14:16:23 2014 +0100
grc: use domain connection templates in Generator
---
grc/base/domain.dtd | 2 +-
grc/blocks/gr_stream_domain.xml | 2 +-
grc/python/Generator.py | 2 ++
grc/python/flow_graph.tmpl | 7 ++++---
4 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/grc/base/domain.dtd b/grc/base/domain.dtd
index b13e1a7..3c50687 100644
--- a/grc/base/domain.dtd
+++ b/grc/base/domain.dtd
@@ -1,5 +1,5 @@
<!--
-Copyright 2008 Free Software Foundation, Inc.
+Copyright 2014 Free Software Foundation, Inc.
This file is part of GNU Radio
GNU Radio Companion is free software; you can redistribute it and/or
diff --git a/grc/blocks/gr_stream_domain.xml b/grc/blocks/gr_stream_domain.xml
index c7b2bc2..89c15d2 100644
--- a/grc/blocks/gr_stream_domain.xml
+++ b/grc/blocks/gr_stream_domain.xml
@@ -10,6 +10,6 @@
<connection>
<source_domain>gr_stream</source_domain>
<sink_domain>gr_stream</sink_domain>
- <make></make>
+ <make> self.connect($make_port_sig($source),
$make_port_sig($sink))</make>
</connection>
</domain>
diff --git a/grc/python/Generator.py b/grc/python/Generator.py
index 24d943d..78e8031 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 b07c296..3769e0a 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
- [Commit-gnuradio] [gnuradio] 14/22: runtime: refactor top/hier block python wrappers, (continued)
- [Commit-gnuradio] [gnuradio] 14/22: runtime: refactor top/hier block python wrappers, git, 2014/12/23
- [Commit-gnuradio] [gnuradio] 17/22: grc: fix connections error log and color, git, 2014/12/23
- [Commit-gnuradio] [gnuradio] 11/22: grc: PEP8 fixes in Generator, git, 2014/12/23
- [Commit-gnuradio] [gnuradio] 16/22: grc: add domain property color and use it for connections, git, 2014/12/23
- [Commit-gnuradio] [gnuradio] 06/22: grc: domain-specific port keys, git, 2014/12/23
- [Commit-gnuradio] [gnuradio] 09/22: grc: make Generator use gr_message domain, git, 2014/12/23
- [Commit-gnuradio] [gnuradio] 03/22: grc: draw ports with custom domain differently, git, 2014/12/23
- [Commit-gnuradio] [gnuradio] 22/22: Merge remote-tracking branch 'gnuradio-wg-grc/master_grcwg', git, 2014/12/23
- [Commit-gnuradio] [gnuradio] 04/22: grc: don't fail for unknown domains, git, 2014/12/23
- [Commit-gnuradio] [gnuradio] 19/22: Merge branch 'port_domains' into master_grcwg, git, 2014/12/23
- [Commit-gnuradio] [gnuradio] 05/22: grc: use domain connection templates in Generator,
git <=
- [Commit-gnuradio] [gnuradio] 21/22: Merge remote-tracking branch 'skoslowski/msg_connect_extended', git, 2014/12/23
- [Commit-gnuradio] [gnuradio] 18/22: grc: port domain code clean-up, git, 2014/12/23
- [Commit-gnuradio] [gnuradio] 20/22: Merge branch 'maint', git, 2014/12/23
- [Commit-gnuradio] [gnuradio] 02/22: grc: add domain attribute to ports, git, 2014/12/23
- [Commit-gnuradio] [gnuradio] 01/22: grc: add domain xml DTD and parsing, git, 2014/12/23