diff options
Diffstat (limited to 'gr-qtgui/lib/time_sink_f_impl.cc')
-rw-r--r-- | gr-qtgui/lib/time_sink_f_impl.cc | 37 |
1 files changed, 24 insertions, 13 deletions
diff --git a/gr-qtgui/lib/time_sink_f_impl.cc b/gr-qtgui/lib/time_sink_f_impl.cc index b730eb512d..3c83983bd8 100644 --- a/gr-qtgui/lib/time_sink_f_impl.cc +++ b/gr-qtgui/lib/time_sink_f_impl.cc @@ -71,6 +71,10 @@ namespace gr { d_buffers.push_back((double*)volk_malloc(d_buffer_size*sizeof(double), volk_get_alignment())); memset(d_buffers[n], 0, d_buffer_size*sizeof(double)); + + d_fbuffers.push_back((float*)volk_malloc(d_buffer_size*sizeof(float), + volk_get_alignment())); + memset(d_fbuffers[n], 0, d_buffer_size*sizeof(float)); } // Set alignment properties for VOLK @@ -97,6 +101,7 @@ namespace gr { // d_main_gui is a qwidget destroyed with its parent for(int n = 0; n < d_nconnections; n++) { volk_free(d_buffers[n]); + volk_free(d_fbuffers[n]); } delete d_argv; @@ -333,6 +338,11 @@ namespace gr { d_buffers[n] = (double*)volk_malloc(d_buffer_size*sizeof(double), volk_get_alignment()); memset(d_buffers[n], 0, d_buffer_size*sizeof(double)); + + volk_free(d_fbuffers[n]); + d_fbuffers[n] = (float*)volk_malloc(d_buffer_size*sizeof(float), + volk_get_alignment()); + memset(d_fbuffers[n], 0, d_buffer_size*sizeof(float)); } // If delay was set beyond the new boundary, pull it back. @@ -429,19 +439,18 @@ namespace gr { void time_sink_f_impl::_reset() { - // Move the tail of the buffers to the front. This section - // represents data that might have to be plotted again if a - // trigger occurs and we have a trigger delay set. The tail - // section is between (d_end-d_trigger_delay) and d_end. int n; if(d_trigger_delay) { for(n = 0; n < d_nconnections; n++) { - memmove(d_buffers[n], &d_buffers[n][d_size-d_trigger_delay], d_trigger_delay*sizeof(double)); - } - - // Also move the offsets of any tags that occur in the tail - // section so they would be plotted again, too. - for(n = 0; n < d_nconnections; n++) { + // Move the tail of the buffers to the front. This section + // represents data that might have to be plotted again if a + // trigger occurs and we have a trigger delay set. The tail + // section is between (d_end-d_trigger_delay) and d_end. + memmove(d_fbuffers[n], &d_fbuffers[n][d_end-d_trigger_delay], + d_trigger_delay*sizeof(float)); + + // Also move the offsets of any tags that occur in the tail + // section so they would be plotted again, too. std::vector<gr::tag_t> tmp_tags; for(size_t t = 0; t < d_tags[n].size(); t++) { if(d_tags[n][t].offset > (uint64_t)(d_size - d_trigger_delay)) { @@ -615,8 +624,9 @@ namespace gr { // Copy data into the buffers. for(n = 0; n < d_nconnections; n++) { in = (const float*)input_items[idx]; - volk_32f_convert_64f(&d_buffers[n][d_index], - &in[1], nitems); + memcpy(&d_fbuffers[n][d_index], &in[1], nitems*sizeof(float)); + //volk_32f_convert_64f(&d_buffers[n][d_index], + // &in[1], nitems); uint64_t nr = nitems_read(idx); std::vector<gr::tag_t> tags; @@ -633,7 +643,8 @@ namespace gr { if((d_triggered) && (d_index == d_end)) { // Copy data to be plotted to start of buffers. for(n = 0; n < d_nconnections; n++) { - memmove(d_buffers[n], &d_buffers[n][d_start], d_size*sizeof(double)); + //memmove(d_buffers[n], &d_buffers[n][d_start], d_size*sizeof(double)); + volk_32f_convert_64f(d_buffers[n], &d_fbuffers[n][d_start], d_size); } // Plot if we are able to update |