|Subject:||Re: [Discuss-gnuradio] zero ninput_items_required|
|Date:||Tue, 22 Oct 2013 14:56:58 +0200|
|User-agent:||Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.0|
To be completely clear:
In your original post you stated that your block really behaves like a sync_interpolator/decimator. Yet, you're reinventing the wheel by copying the wheel into your code.
DO NOT just copy code to you not-sync block from sync_block if you want sync_interpolator/decimator's behaviour. That's totally confusing, a waste of time, and will lead to code that is badly maintanable.
Instead, just make a subclass of sync_interpolator/decimator and replace its work function. You get all the features, free, well-tested, and maintained by someone else.
If you, however, really need to implement something that works like sync_interpolator/decimator most of the time but needs to drop samples occasionally or something like that, you might be better of splitting your functionality to a sync_interpolator that does all the processing, and a non-sync block, that wraps the state machine (or whatever) to do the dropping (or whatever). However, from what you've posted, this does not seem necessary - just make a new block with "gr_modtool add", use "decimator" or "interpolator" as type, copy over your general work function's body to the work function and fix it accordingly, so that it no longer manually produces and consumes items.
On 10/22/2013 02:20 PM, Nemanja Savic wrote:
|[Prev in Thread]||Current Thread||[Next in Thread]|