discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] Dynamically changing the flowgraph


From: Eric Blossom
Subject: Re: [Discuss-gnuradio] Dynamically changing the flowgraph
Date: Sun, 23 Oct 2005 11:09:58 -0700
User-agent: Mutt/1.5.6i

On Sun, Oct 23, 2005 at 09:35:58AM +0530, Ramakrishnan Muthukrishnan wrote:
> 
> Folks,
> 
> I am trying to implement a GUI frontend for the little Softrock40 board
> from amqrp. I have a very primitive but usable radio up and running. 
> 
> This is what I am trying to do. On the click of a button, the user
> should be able to switch from a FFT view to waterfall view. To do this,
> I stopped the flow_graph, disconnected the waterfall block and connect
> FFT block (or vice-versa), and start the flow_graph again. But the
> problem is that the block disconnected remain dangling and has to be
> distroyed completely from the instance, otherwise it gives an error.
> 
> This is what I am trying. I need to change it to use the new fftsink
> usage. Any idea how to fix this? 

I think you're on the right track.  Does the code below work OK?
That is, if you drop the reference to waterfall_block, does it work
OK.  

What's happening is that the underlying hierarchical block remains
partially connected (internally), and then the sanity checker
complains that it doesn't have inputs or outputs connected when you
try to restart.

> def OnFFTButton(self, event):
>     self.stop ()
>     self.disconnect (self.f2c, self.waterfall_block)
> 
>     self.fft_block, self.fft_win = fftsink.make_fft_sink_c (self, self.panel, 
> "Softrock40", 1024, self.sampling_freq, -100)
>     self.vbox.Add (self.fft_win, 10, wx.EXPAND)
>         
>     self.waterfall_block = None
>        
>     self.connect (self.f2c, self.fft_block)
>     self.start ()

Eric




reply via email to

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