discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] Connect question


From: Johnathan Corgan
Subject: Re: [Discuss-gnuradio] Connect question
Date: Tue, 6 Jan 2009 08:19:58 -0800

On Tue, Jan 6, 2009 at 6:21 AM, Sebastiaan Heunis <address@hidden> 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]