summaryrefslogtreecommitdiff
path: root/grc/python/Generator.py
diff options
context:
space:
mode:
authorSebastian Koslowski <koslowski@kit.edu>2014-12-08 22:36:47 +0100
committerSebastian Koslowski <koslowski@kit.edu>2014-12-08 22:36:47 +0100
commita4e0154373510695741f840298f4ea7c2cbb217a (patch)
treed8b0f982592f7f1a0ddd4fcb86c2935f74fdaa94 /grc/python/Generator.py
parent24b98d21ebee6ec2f16466ac809461de38ebdf2a (diff)
grc: port connections by domain, block name in generated code
Diffstat (limited to 'grc/python/Generator.py')
-rw-r--r--grc/python/Generator.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/grc/python/Generator.py b/grc/python/Generator.py
index a1f8457d37..7512cfb633 100644
--- a/grc/python/Generator.py
+++ b/grc/python/Generator.py
@@ -164,8 +164,12 @@ class TopBlockGenerator(object):
)
# list of regular blocks (all blocks minus the special ones)
blocks = filter(lambda b: b not in (imports + parameters), blocks)
- # list of connections where each endpoint is enabled
+ # list of connections where each endpoint is enabled (sorted by domains, block names)
connections = filter(lambda c: not (c.is_bus() or c.is_msg()), self._flow_graph.get_enabled_connections())
+ connections.sort(key=lambda c: (
+ c.get_source().get_domain(), c.get_sink().get_domain(),
+ c.get_source().get_parent().get_id(), c.get_sink().get_parent().get_id()
+ ))
connection_templates = self._flow_graph.get_parent().get_connection_templates()
msgs = filter(lambda c: c.is_msg(), self._flow_graph.get_enabled_connections())
# list of variable names