Forum: GNU Radio how to access elements in case of multi flow graph

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
0e25d89f49daf7f64b77d2797526f637?d=identicon&s=25 Sheshanandan KN (Guest)
on 2009-06-09 13:38
(Received via mailing list)
hi all,
I have created a multiple flow graph code for my experimentation as
per the document - ' writing python applications using gnuradio'. As
per this document, the individual flow graphs are connected as per the
following lines of code:

class my_top_block(gr.top_block):
        def __init__(self):
               gr.top_block.__init__(self)

               tx_path = transmit_path()
               rx_path =  receive_path()

               self.connect(tx_path)
               self.connect(rx_path)

I have instantiated this class as tb = my_top_block(). I am not
getting how to access the elements inside these classes. For example,
if I have an element like 'self.msgq'  in the class receive_path. How
to access this 'msgq' from my_top_block().

I tried giving tb.rx_path.msgq and tb.msgq directly. But this does not
work.

Please let me know how to go about this.
745d8202ef5a58c1058d0e5395a78f9c?d=identicon&s=25 Eric Blossom (Guest)
on 2009-06-12 21:16
(Received via mailing list)
On Tue, Jun 09, 2009 at 05:07:53PM +0530, Sheshanandan KN wrote:
>                tx_path = transmit_path()
> I tried giving tb.rx_path.msgq and tb.msgq directly. But this does not work.
>
> Please let me know how to go about this.

The Python 2.X tutorial will probably be helpful:
http://www.python.org/doc

You'll need something like this:

> class my_top_block(gr.top_block):
>         def __init__(self):
>                gr.top_block.__init__(self)
>
>                self.tx_path = transmit_path()
>                self.rx_path =  receive_path()
>
>                self.connect(self.tx_path)
>                self.connect(self.rx_path)


Eric
This topic is locked and can not be replied to.