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.
on 2009-06-09 13:38
on 2009-06-12 21:16
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