[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Discuss-gnuradio] how to access elements in case of multi flow grap
From: |
Eric Blossom |
Subject: |
Re: [Discuss-gnuradio] how to access elements in case of multi flow graph |
Date: |
Fri, 12 Jun 2009 12:05:38 -0700 |
User-agent: |
Mutt/1.5.18 (2008-05-17) |
On Tue, Jun 09, 2009 at 05:07:53PM +0530, Sheshanandan KN wrote:
> 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.
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