-------- Original Message --------
Subject:        Re: [Discuss-gnuradio] something about forecast()
Date:   Wed, 4 Jun 2014 16:52:11 +0800 (CST)
From:   xianda <wangxianda920...@163.com>
To:     Marcus Müller <marcus.muel...@ettus.com>



Hi:
           Thank you.
           1.Oh,I understand it.If i say,this is according to how many input 
ports we connct to the block.If we connect 2 input ports(connect in python 
program),then use the ninput_items_required.size (),it will tell us 2.Right?
2.Another question i want to ask.Thank you.I have check my program as you 
said"However, you should not do get_tx_stream for every sample chunk you 
transmit, but only once for every USRP, before starting to send.".But i run my 
code,it also display so many "L L L".Is the sample to send too short?Thank 
you.Any advices will be appreciated.


Best regards,







At 2014-06-04 04:34:11, "Marcus Müller" <marcus.muel...@ettus.com> wrote:
>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" <marcus.muel...@ettus.com> 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
>> Discuss-gnuradio@gnu.orghttps://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>>
>



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

Reply via email to