[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Discuss-gnuradio] Problems on writing QA code for source block
From: |
Marcus Müller |
Subject: |
Re: [Discuss-gnuradio] Problems on writing QA code for source block |
Date: |
Fri, 24 May 2019 10:40:52 +0200 |
User-agent: |
Evolution 3.30.4 (3.30.4-1.fc29) |
Hi Bowen,
yeah! Community bonding :) And progress!!
So, the trick with GNU Radio is that you can think of blocks being
"called" by the scheduling algorithm. That always happens when there's
new input to process (doesn't apply to sources), and there's enough
output space to write results to, *as long as the flow graph is
running*.
So, all you have to do is *stop the flowgraph*, and that is as easy as
adding a "Head" block after your source. That block just copies a set
number of items from its input to its output and then signals "hey, I'm
done, don't give me any more input items", at which point your source
block will simply not be asked to produce any more.
Best regards,
Marcus
On Fri, 2019-05-24 at 02:08 +0000, Bowen Hu wrote:
> Hi all,
>
> I am having trouble writing QA code in python for C++ **source**
> blocks. Unlike the **sync** block demonstrated in the tutorial (
> https://wiki.gnuradio.org/index.php/Guided_Tutorial_GNU_Radio_in_C%2B%2B
> ), which stops when there are no more input items. Since **source**
> blocks do not take any input, I have no idea how to stop the
> **source** block once the python QA code was started.
>
> thanks in advance for any advice.
>
> Best regards,
> Bowen