[Top][All Lists]

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

Re: [Discuss-gnuradio] GRC xml file: port declaration order

From: Tom Rondeau
Subject: Re: [Discuss-gnuradio] GRC xml file: port declaration order
Date: Tue, 26 Mar 2013 10:54:20 -0400

On Tue, Mar 26, 2013 at 6:54 AM, Johannes Demel <address@hidden> wrote:
> Hello list,
> do message ports have to be declared after the other ports in the
> corresponding GRC xml file? For visual purposes I tried to rearrange them
> because I want the message ports to appear above the stream ports.
> Unfortunately this leads to the effect that stream ports are counted
> incorrectly in the generated python file. Port 0 has index 1 etc. and thus
> the python file can't be executed.
> - Johannes

I can confirm that this is a problem. I happened to have been working
on some message passing stuff myself, so I thought I'd try out what
you were doing.

Try this patch and let me know if that solves your problem and that
everything behaves like it should:

diff --git a/grc/python/Port.py b/grc/python/Port.py
index 0703d67..d4afa6c 100644
--- a/grc/python/Port.py
+++ b/grc/python/Port.py
@@ -92,6 +92,7 @@ class Port(_Port, _GUIPort):
                self._n = n
                if n['type'] == 'msg': n['key'] = 'msg'
+                if n['type'] == 'message': n['key'] = n['name']
                if dir == 'source' and not n.find('key'):
                        n['key'] = str(block._source_count)
                        block._source_count += 1


reply via email to

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