Connect question


#1

Hi

I would just like to know if it is possible to connect blocks
dynamically? I’m implementing the analysis_filterbank block. What I
would like to do is write a GUI application that allows one to select
the channel of interest. This channel is then displayed on an FFT
sink. Can I do it as such?

def pick_channel(self,event):
chan = spinctrl.GetValue()
self.channel = int(chan)
self.connect((bank,chan),self.demod)

or do I need to call fg.stop() and fg.start()?

Sebastiaan


Sebastiaan H.
Radar and Remote Sensing Group, University of Cape Town
Tel: +27 83 305 5667


#2

On Tue, Jan 6, 2009 at 6:21 AM, Sebastiaan H. removed_email_address@domain.invalid
wrote:

self.channel = int(chan)
self.connect((bank,chan),self.demod)

or do I need to call fg.stop() and fg.start()?

You use self.lock(), do the rewiring, then self.unlock(). See an
example of this usage in:

http://gnuradio.org/trac/browser/gnuradio/trunk/gr-utils/src/python/usrp_siggen.py#L91

The above does a disconnect_all() also, which you don’t need.

-Johnathan