summaryrefslogtreecommitdiff
path: root/grc/python/FlowGraph.py
diff options
context:
space:
mode:
authorSebastian Koslowski <koslowski@kit.edu>2014-12-05 11:52:02 +0100
committerSebastian Koslowski <koslowski@kit.edu>2014-12-05 11:52:02 +0100
commit2c9079afda99349a8a5914c15d55d3d86a50eaca (patch)
tree7640769d6cac4e37e6d6588ed2f6c53a1c331cd7 /grc/python/FlowGraph.py
parenteb40a41ec28d5f8320d9c0abcb7a2aa2602b9872 (diff)
grc: make Generator use gr_message domain
Diffstat (limited to 'grc/python/FlowGraph.py')
-rw-r--r--grc/python/FlowGraph.py17
1 files changed, 12 insertions, 5 deletions
diff --git a/grc/python/FlowGraph.py b/grc/python/FlowGraph.py
index 977200da66..03280cc88c 100644
--- a/grc/python/FlowGraph.py
+++ b/grc/python/FlowGraph.py
@@ -146,12 +146,19 @@ class FlowGraph(_FlowGraph, _GUIFlowGraph):
key_offset = 0
pads = self.get_pad_sources() if port.is_source() else self.get_pad_sinks()
for pad in pads:
- if pad.get_param('type').get_evaluated() == "message":
- continue
+ # using the block type param instead of the port domain here
+ # to stress that hier block generation is domain agnostic
+ is_message_pad = pad.get_param('type').get_evaluated() == "message"
if port.get_parent() == pad:
- return str(key_offset + int(port.get_key()))
- # assuming we have either only sources or sinks
- key_offset += len(pad.get_ports())
+ if is_message_pad:
+ key = pad.get_param('label').get_value()
+ else:
+ key = str(key_offset + int(port.get_key()))
+ return key
+ else:
+ # assuming we have either only sources or sinks
+ if not is_message_pad:
+ key_offset += len(pad.get_ports())
return -1
def get_imports(self):