diff options
author | Tom Rondeau | 2010-11-11 14:19:02 -0500 |
---|---|---|
committer | Tom Rondeau | 2010-11-11 14:19:02 -0500 |
commit | c204913321f0618ac131738088dab23065bdfa80 (patch) | |
tree | c7490a463e7ce98715f937c0362780eec345274d /gnuradio-core/src/lib/runtime | |
parent | ec79e6f688c0ef94e66c938eba24c8b95e9856ba (diff) | |
download | gnuradio-c204913321f0618ac131738088dab23065bdfa80.tar.gz gnuradio-c204913321f0618ac131738088dab23065bdfa80.tar.bz2 gnuradio-c204913321f0618ac131738088dab23065bdfa80.zip |
Fixed small bug in how tags are propagated downstream. Also using seq. numbers in annotator test block to better keep track.
Diffstat (limited to 'gnuradio-core/src/lib/runtime')
-rw-r--r-- | gnuradio-core/src/lib/runtime/gr_block_executor.cc | 4 | ||||
-rw-r--r-- | gnuradio-core/src/lib/runtime/gr_random_annotator.cc | 7 | ||||
-rw-r--r-- | gnuradio-core/src/lib/runtime/gr_random_annotator.h | 1 |
3 files changed, 9 insertions, 3 deletions
diff --git a/gnuradio-core/src/lib/runtime/gr_block_executor.cc b/gnuradio-core/src/lib/runtime/gr_block_executor.cc index 804c9e197..840cf8e5c 100644 --- a/gnuradio-core/src/lib/runtime/gr_block_executor.cc +++ b/gnuradio-core/src/lib/runtime/gr_block_executor.cc @@ -343,9 +343,9 @@ gr_block_executor::run_one_iteration() for (int i = 0; i < d->noutputs (); i++) d_output_items[i] = d->output(i)->write_pointer(); - // store number of items consumed so far on in stream + // determine where to start looking for new tags as 1 past nitems read for (int i = 0; i < d->ninputs(); i++) - d_start_nitems_read[i] = d->nitems_read(i); + d_start_nitems_read[i] = d->nitems_read(i)+1; // Do the actual work of the block int n = m->general_work (noutput_items, d_ninput_items, diff --git a/gnuradio-core/src/lib/runtime/gr_random_annotator.cc b/gnuradio-core/src/lib/runtime/gr_random_annotator.cc index 08589984e..366130984 100644 --- a/gnuradio-core/src/lib/runtime/gr_random_annotator.cc +++ b/gnuradio-core/src/lib/runtime/gr_random_annotator.cc @@ -42,6 +42,11 @@ gr_random_annotator::gr_random_annotator (size_t sizeof_stream_item) gr_make_io_signature (1, -1, sizeof_stream_item)), d_itemsize(sizeof_stream_item) { + //set_tag_propagation_policy(TPP_DONT); + set_tag_propagation_policy(TPP_ALL_TO_ALL); + //set_tag_propagation_policy(TPP_ONE_TO_ONE); + + d_tag_counter = 0; } gr_random_annotator::~gr_random_annotator () @@ -86,7 +91,7 @@ gr_random_annotator::work (int noutput_items, } // Storing the current noutput_items as the value to the "noutput_items" key - pmt::pmt_t cur_N = pmt::pmt_from_uint64(random()); + pmt::pmt_t cur_N = pmt::pmt_from_uint64(d_tag_counter++); pmt::pmt_t srcid = pmt::pmt_string_to_symbol(str.str()); pmt::pmt_t key = pmt::pmt_string_to_symbol("noutput_items"); add_item_tag(0, abs_N, key, cur_N, srcid); diff --git a/gnuradio-core/src/lib/runtime/gr_random_annotator.h b/gnuradio-core/src/lib/runtime/gr_random_annotator.h index 3f21b71ad..5fca53830 100644 --- a/gnuradio-core/src/lib/runtime/gr_random_annotator.h +++ b/gnuradio-core/src/lib/runtime/gr_random_annotator.h @@ -46,6 +46,7 @@ protected: private: size_t d_itemsize; std::stringstream d_sout; + uint64_t d_tag_counter; friend gr_random_annotator_sptr gr_make_random_annotator (size_t sizeof_stream_item); |