discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] Produce/Consume in python OOT block with multiple


From: Marcus Müller
Subject: Re: [Discuss-gnuradio] Produce/Consume in python OOT block with multiple IO streams
Date: Fri, 28 Jul 2017 11:17:57 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1

https://github.com/gnuradio/gnuradio/pull/1396


On 07/28/2017 10:49 AM, Marcus Müller wrote:

Hi Bakshi,


very short answer:

Just like gr::block::consume, there's a gr::block::produce(which_output, how_many_items) [1]. You'd use that and "return WORK_CALLED_PRODUCE". But: that's what you'd do in C++


As far as I remember, this is not completelywell-wrapped for python. So, for now, that WORK_CALLED_PRODUCE enum constant is not available from python; but, as it happens WORK_CALLED_PRODUCE == -2, sooooo:


    def general_work(self, input_items, output_items):
        self.consume(0, len(input_items[0]))
        self.produce(0,2)
        self.produce(1,1)
        return -2

works for me.

I'll see what I can do about the absence of WORK_CALLED_PRODUCE in Python.


Best regards,

Marcus




[1] https://gnuradio.org/doc/doxygen/classgr_1_1block.html#aa5581727d057bdd8113f8b2a3fc5bd66


On 07/27/2017 11:59 PM, Bakshi, Arjun wrote:

Hi all,


I'm writing an OOT block in python which has multiple output streams. I know I can use consume(stream_index, amount_consumed) to tell the scheduler/system how much has been consumed on a specific INput stream. But how do I notify that X amount has been produced for OUTput stream 1, Y amount for output stream 2 and so on? Till now I've only had 1 output stream so the return <num_produced> call in general_work was sufficient.


Thank you,


AB




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



_______________________________________________
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]