|
From: | Jeon |
Subject: | Re: [Discuss-gnuradio] Question on tags - offsets |
Date: | Fri, 19 Jun 2015 14:28:55 +0900 |
Hi,A quick question on tags.I'm coding a custom block in python and my forecast function is like so:def forecast(self, noutput_items, ninput_items_required):#setup size of input_items[i] for work callfor i in range(len(ninput_items_required)):ninput_items_required[i] = 64If my understanding is correct, every 64 items, the block's work function is called.Each time work is called, I want to add a tag to the first of the 64 elements that come in (the *value* of my tag is a list). So I used:lst = (1, 2, 3, 4) #exampleitem_index = 0offset = self.nitems_written(0) + item_indexkey = pmt.string_to_symbol("example")value = pmt.to_pmt(lst)self.add_item_tag(0, offset, key, value)This works. I can see the tag being added when I use a QT time sink.But when I add some print statements and check what I noticed is that tags are being added at indicies 0, 8192, 16384 etc. Basically multiples of 8192 which is the full length of the input buffer in0 = input_items[0].Shouldn't self.nitems_written(0) be 64 each time?What I really want is tags being added at 0, 64, 128 etc. I'm sure I'm missing something pretty silly.ThanksAnil
_______________________________________________
Discuss-gnuradio mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
[Prev in Thread] | Current Thread | [Next in Thread] |