summaryrefslogtreecommitdiff
path: root/grc/python
diff options
context:
space:
mode:
authorTim O'Shea2012-11-28 15:15:58 -0800
committerJohnathan Corgan2012-11-29 15:42:57 -0800
commit92cfb0240005675f4e7a55a81552f4c7a5128cd8 (patch)
tree024a40e11a27a41eaa908b2eefb4a218795bff18 /grc/python
parent0fbd1699158f01937f61c245398ccdaebe3d978b (diff)
downloadgnuradio-92cfb0240005675f4e7a55a81552f4c7a5128cd8.tar.gz
gnuradio-92cfb0240005675f4e7a55a81552f4c7a5128cd8.tar.bz2
gnuradio-92cfb0240005675f4e7a55a81552f4c7a5128cd8.zip
core: adding msg_connect, updating msg interface, adding symbolic block names
Diffstat (limited to 'grc/python')
-rw-r--r--grc/python/Connection.py3
-rw-r--r--grc/python/Constants.py1
-rw-r--r--grc/python/Generator.py4
-rw-r--r--grc/python/flow_graph.tmpl11
4 files changed, 18 insertions, 1 deletions
diff --git a/grc/python/Connection.py b/grc/python/Connection.py
index 218baf074..341dd2d82 100644
--- a/grc/python/Connection.py
+++ b/grc/python/Connection.py
@@ -31,6 +31,9 @@ class Connection(_Connection, _GUIConnection):
def is_msg(self):
return self.get_source().get_type() == self.get_sink().get_type() == 'msg'
+ def is_message(self):
+ return self.get_source().get_type() == self.get_sink().get_type() == 'message'
+
def validate(self):
"""
Validate the connections.
diff --git a/grc/python/Constants.py b/grc/python/Constants.py
index 1a65caf1c..09c308196 100644
--- a/grc/python/Constants.py
+++ b/grc/python/Constants.py
@@ -58,6 +58,7 @@ CORE_TYPES = ( #name, key, sizeof, color
('Integer 16', 's16', 2, '#FFFF66'),
('Integer 8', 's8', 1, '#FF66FF'),
('Message Queue', 'msg', 0, '#777777'),
+ ('Async Message', 'message', 0, '#777777'),
('Wildcard', '', 0, '#FFFFFF'),
)
diff --git a/grc/python/Generator.py b/grc/python/Generator.py
index 2a6fe51d5..616ea00fc 100644
--- a/grc/python/Generator.py
+++ b/grc/python/Generator.py
@@ -116,8 +116,9 @@ Add a Misc->Throttle block to your flow graph to avoid CPU congestion.''')
#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
- connections = filter(lambda c: not c.is_msg(), self._flow_graph.get_enabled_connections())
+ connections = filter(lambda c: not (c.is_msg() or c.is_message()), self._flow_graph.get_enabled_connections())
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
var_ids = [var.get_id() for var in parameters + variables]
#prepend self.
@@ -142,6 +143,7 @@ Add a Misc->Throttle block to your flow graph to avoid CPU congestion.''')
'blocks': blocks,
'connections': connections,
'messages': messages,
+ 'messages2': messages2,
'generate_options': self._generate_options,
'var_id2cbs': var_id2cbs,
}
diff --git a/grc/python/flow_graph.tmpl b/grc/python/flow_graph.tmpl
index 17feb01f6..af55ad641 100644
--- a/grc/python/flow_graph.tmpl
+++ b/grc/python/flow_graph.tmpl
@@ -189,6 +189,17 @@ gr.io_signaturev($(len($io_sigs)), $(len($io_sigs)), [$(', '.join($size_strs))])
self.connect($make_port_sig($source), $make_port_sig($sink))
#end if
#end for
+########################################################
+##Create Asynch Message Connections
+########################################################
+#if $messages2
+ $DIVIDER
+ # Asynch Message Connections
+ $DIVIDER
+#end if
+#for $msg in $messages2
+ self.msg_connect(self.$msg.get_source().get_parent().get_id(), "$msg.get_source().get_name()", self.$msg.get_sink().get_parent().get_id(), "$msg.get_sink().get_name()")
+#end for
########################################################
##Create Callbacks