|
From: | Nemanja Savic |
Subject: | Re: [Discuss-gnuradio] Problem loading Python block |
Date: | Fri, 1 Feb 2013 16:51:51 +0100 |
NemanjaBestNothing happened by adding self.connect(self) in top_block.I am more than willing to try new message passing interface. The idea with the thread is a bit old, that's what I have heard, from more experienced guys. Are there any blocs that uses new message passing interface, so that I can take a look how it works?@Tom
--On Fri, Feb 1, 2013 at 4:20 PM, "Martin Lülf" <address@hidden> wrote:
> Guys,
>
> As i told you my new installation works fine, I eve tested blocks in
> python. Now, the problem is following:
>
> I designed block in python which has None for both input and output
> signature. I wanted to use such block only for receiving messages and for
> writing to terminal some information, etc.
> The constructor of my new block, is executed, but the problem is work
> function is never executed. I put some printing at the beginning of work
> function and nothing happens. The work function looks like this:
>
>
> Could the problem be no inputs and no outputs? Or maybe something else?Hi Nemanja,
>
> Best and thanks
>
> Nemanja
>
the work function is called by the scheduler, which only calls the work
function, if it has some samples to process. So if your block is not part
of the flow graph (which it isn't since you have no input or output
stream) it will not get called.
You could either create a Thread in the block's constructor which will
call the work function (the start/stop functions seem to not being called
either), or you could try the new message passing interface, where you can
register a callback function that is called whenever a new message
arrives.
Yours
Martin
_______________________________________________
Discuss-gnuradio mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
Nemanja Savić
[Prev in Thread] | Current Thread | [Next in Thread] |