[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Discuss-gnuradio] something about forecast()
From: |
Marcus Müller |
Subject: |
Re: [Discuss-gnuradio] something about forecast() |
Date: |
Wed, 04 Jun 2014 10:34:11 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 |
Hi Xianda,
the io_signature specifies a minimum and a maximum number of inputs, so
this might be 1,2 or 3.
Greetings,
Marcus
On 04.06.2014 10:24, xianda wrote:
> Hi:
> Thank you so much.
> Now i want to ask:if we set
> gr::block("c_vcvc",
>
> gr::io_signature::make(1, 3, sizeof(gr_complex)*length1),
>
> gr::io_signature::make(1, 1, sizeof(gr_complex)*length1))
> then: ninput_items_required.size ()=1 or 3?
> Thanks,
> Best regards
>
>
>
>
>
> At 2014-06-04 03:10:40, "Marcus Müller" <address@hidden> wrote:
> Hi Xianda,
>
> Easiest answer first:
>
> 2. You need to write a forecast if, and only if, you're using general_work. I
> generally try to avoid doing that.
>
> Then:
> 1.
> ninput_items_required is, as you can see in the function signature, a
> reference to a vector.
> The size of the vector is the number of input ports.
> Compare to
> http://gnuradio.org/doc/doxygen/classgr_1_1block.html#a5bc118d94944d2ff71e378f807fb8d28
>
> Greetings,
> Marcus
>
>
> On 04.06.2014 08:22, xianda wrote:
>
> Hi all:
> I want to know something about the forecast().
> I have already known that forcast() can tell scheduler how many
> input items are required for each output item.
> 1.But now i have read two example:
> The first one:
> void your_block::forecast(int
> noutput_items,gr_vector_int &ninput_items_required){
> ninput_items_required[0]=100 *
> noutput_items;
>
> ninput_items_required[1]=100 *
> noutput_items; }
> I have already understand it.
> But the second one:
> void forecast (int noutput_items, gr_vector_int
> &ninput_items_required)
> {
> unsigned ninputs = ninput_items_required.size
> ();
> for (unsigned i = 0; i < ninputs; i++)
> ninput_items_required[i] = 1;}
> I can't understand since we can't know how many input
> items we required,why use ninput_items_required.size ().Can someone help me?
> 2.I want to know if we use the general_work().Is it means that
> we must use the forcast()?Thanks.
> Best regards
>
>
>
>
>
>
>
> _______________________________________________
> Discuss-gnuradio mailing list
> address@hidden://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>