On Tue, Jan 6, 2009 at 6:21 AM, Sebastiaan Heunis <[email protected]> wrote:
> 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()?

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


_______________________________________________
Discuss-gnuradio mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio

Reply via email to