commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] [gnuradio] 67/101: grc: remove support for old msg que


From: git
Subject: [Commit-gnuradio] [gnuradio] 67/101: grc: remove support for old msg queues
Date: Thu, 16 Mar 2017 14:58:08 +0000 (UTC)

This is an automated email from the git hooks/post-receive script.

jcorgan pushed a commit to branch python3
in repository gnuradio.

commit 5d4baf530af8ca843dcfe310af3bd34d4cf7c3ad
Author: Sebastian Koslowski <address@hidden>
Date:   Wed Jul 27 22:24:15 2016 +0200

    grc: remove support for old msg queues
---
 grc/core/Connection.py             |  3 ---
 grc/core/Constants.py              |  1 -
 grc/core/Port.py                   |  8 --------
 grc/core/generator/Generator.py    |  9 +++------
 grc/core/generator/flow_graph.tmpl | 13 -------------
 grc/gui/Port.py                    |  2 +-
 6 files changed, 4 insertions(+), 32 deletions(-)

diff --git a/grc/core/Connection.py b/grc/core/Connection.py
index 63c6a94..0665321 100644
--- a/grc/core/Connection.py
+++ b/grc/core/Connection.py
@@ -101,9 +101,6 @@ class Connection(Element):
             self.source_block, self.source_port, self.sink_block, 
self.sink_port,
         )
 
-    def is_msg(self):
-        return self.source_port.get_type() == self.sink_port.get_type() == 
'msg'
-
     def is_bus(self):
         return self.source_port.get_type() == 'bus'
 
diff --git a/grc/core/Constants.py b/grc/core/Constants.py
index bc387a4..13e29cb 100644
--- a/grc/core/Constants.py
+++ b/grc/core/Constants.py
@@ -118,7 +118,6 @@ CORE_TYPES = (  # name, key, sizeof, color
     ('Integer 16',           's16',  2, GRC_COLOR_YELLOW),
     ('Integer 8',             's8',  1, GRC_COLOR_PURPLE_A400),
     ('Bits (unpacked byte)', 'bit',  1, GRC_COLOR_PURPLE_A100),
-    ('Message Queue',        'msg',  0, GRC_COLOR_DARK_GREY),
     ('Async Message',    'message',  0, GRC_COLOR_GREY),
     ('Bus Connection',       'bus',  0, GRC_COLOR_WHITE),
     ('Wildcard',                '',  0, GRC_COLOR_WHITE),
diff --git a/grc/core/Port.py b/grc/core/Port.py
index 0d9298f..41388df 100644
--- a/grc/core/Port.py
+++ b/grc/core/Port.py
@@ -124,8 +124,6 @@ class Port(Element):
         elif n['domain'] == Constants.GR_MESSAGE_DOMAIN:
             n['key'] = n['name']
             n['type'] = 'message'  # For port color
-        if n['type'] == 'msg':
-            n['key'] = 'msg'
 
         # Build the port
         Element.__init__(self, parent)
@@ -159,12 +157,6 @@ class Port(Element):
             self.add_error_message('Domain key "{}" is not 
registered.'.format(self.domain))
         if not self.get_enabled_connections() and not self.get_optional():
             self.add_error_message('Port is not connected.')
-        # Message port logic
-        if self.get_type() == 'msg':
-            if self.get_nports():
-                self.add_error_message('A port of type "msg" cannot have 
"nports" set.')
-            if self.get_vlen() != 1:
-                self.add_error_message('A port of type "msg" must have a 
"vlen" of 1.')
 
     def rewrite(self):
         """
diff --git a/grc/core/generator/Generator.py b/grc/core/generator/Generator.py
index a3b0c8a..a9ce933 100644
--- a/grc/core/generator/Generator.py
+++ b/grc/core/generator/Generator.py
@@ -165,10 +165,9 @@ class TopBlockGenerator(object):
                 src = block.get_param('source_code').get_value()
                 output.append((file_path, src))
 
-        # Filter out virtual sink connections
-        def cf(c):
-            return not (c.is_bus() or c.is_msg() or 
c.sink_block.is_virtual_sink())
-        connections = [con for con in fg.get_enabled_connections() if cf(con)]
+        # Filter out bus and virtual sink connections
+        connections = [con for con in fg.get_enabled_connections()
+                       if not (con.is_bus() or 
con.sink_block.is_virtual_sink())]
 
         # Get the virtual blocks and resolve their connections
         connection_factory = fg.parent_platform.Connection
@@ -216,7 +215,6 @@ class TopBlockGenerator(object):
         ))
 
         connection_templates = fg.parent.connection_templates
-        msgs = [c for c in fg.get_enabled_connections() if c.is_msg()]
 
         # List of variable names
         var_ids = [var.get_id() for var in parameters + variables]
@@ -245,7 +243,6 @@ class TopBlockGenerator(object):
             'blocks': blocks,
             'connections': connections,
             'connection_templates': connection_templates,
-            'msgs': msgs,
             'generate_options': self._generate_options,
             'callbacks': callbacks,
         }
diff --git a/grc/core/generator/flow_graph.tmpl 
b/grc/core/generator/flow_graph.tmpl
index 4ce2a51..fd5546e 100644
--- a/grc/core/generator/flow_graph.tmpl
+++ b/grc/core/generator/flow_graph.tmpl
@@ -11,7 +11,6 @@
 address@hidden parameters the parameter blocks
 address@hidden blocks the signal blocks
 address@hidden connections the connections
address@hidden msgs the msg type connections
 address@hidden generate_options the type of flow graph
 address@hidden callbacks variable id map to callback strings
 ########################################################
@@ -200,18 +199,6 @@ gr.io_signaturev($(len($io_sigs)), $(len($io_sigs)), [$(', 
'.join($size_strs))])
         $indent($var.get_var_make())
 #end for
 ########################################################
-##Create Message Queues
-########################################################
-#if $msgs
-
-        $DIVIDER
-        # Message Queues
-        $DIVIDER
-#end if
-#for $msg in $msgs
-        $(msg.source_block.get_id())_msgq_out = 
$(msg.sink_block.get_id())_msgq_in = gr.msg_queue(2)
-#end for
-########################################################
 ##Create Blocks
 ########################################################
 #if $blocks
diff --git a/grc/gui/Port.py b/grc/gui/Port.py
index 0880856..21271cc 100644
--- a/grc/gui/Port.py
+++ b/grc/gui/Port.py
@@ -71,7 +71,7 @@ class Port(_Port, Element):
         Returns:
             a hex color code.
         """
-        color = Colors.PORT_TYPE_TO_COLOR[self.get_type()]
+        color = Colors.PORT_TYPE_TO_COLOR.get(self.get_type()) or 
Colors.PORT_TYPE_TO_COLOR.get('')
         vlen = self.get_vlen()
         if vlen > 1:
             dark = (0, 0, 30 / 255.0, 50 / 255.0, 70 / 255.0)[min(4, vlen)]



reply via email to

[Prev in Thread] Current Thread [Next in Thread]