discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] Code Reuse Question


From: Marcus Müller
Subject: Re: [Discuss-gnuradio] Code Reuse Question
Date: Wed, 11 May 2016 22:55:24 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0

Generate a general_block. Copy the content of head_impl.cc 's work() method to the general_work method. don't forget the private variables from head.h and the initialization of those in the constructor.
Replace the "return -1;" by "return 0" to make the block stop producing samples after it's done it's job; before the final "return n; " add a "consume_each(n);".

Best regards,
Marcus

On 11.05.2016 22:23, Richard Bell wrote:
I don't want the flowgraph to stop. I just want to store a set number but leave the flowgraph running.

On Wed, May 11, 2016 at 1:13 PM, Dan CaJacob <address@hidden> wrote:
You can use a head block inline (already in core).

On Wed, May 11, 2016 at 4:09 PM Richard Bell <address@hidden> wrote:
Hello,

I want to add an additional parameter to the existing file sink block that lets the user tell it how many items to save to file. This amounts to adding a few lines to the existing file sink work function.

What's the smartest way to do this? What I would do currently is create a new block, copy and paste the existing file sink code to my new block and add the few lines of code to change it. Is there a smarter way?

Rich
_______________________________________________
Discuss-gnuradio mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
--
Very Respectfully,

Dan CaJacob



_______________________________________________
Discuss-gnuradio mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


reply via email to

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