diff options
Diffstat (limited to 'gr-qtgui/lib/time_sink_c_impl.cc')
-rw-r--r-- | gr-qtgui/lib/time_sink_c_impl.cc | 62 |
1 files changed, 32 insertions, 30 deletions
diff --git a/gr-qtgui/lib/time_sink_c_impl.cc b/gr-qtgui/lib/time_sink_c_impl.cc index 89fafb7f5a..f138278796 100644 --- a/gr-qtgui/lib/time_sink_c_impl.cc +++ b/gr-qtgui/lib/time_sink_c_impl.cc @@ -41,7 +41,7 @@ namespace gr { time_sink_c::sptr time_sink_c::make(int size, double samp_rate, const std::string &name, - int nconnections, + unsigned int nconnections, QWidget *parent) { return gnuradio::get_initial_sptr @@ -50,7 +50,7 @@ namespace gr { time_sink_c_impl::time_sink_c_impl(int size, double samp_rate, const std::string &name, - int nconnections, + unsigned int nconnections, QWidget *parent) : sync_block("time_sink_c", io_signature::make(0, nconnections, sizeof(gr_complex)), @@ -77,14 +77,14 @@ namespace gr { boost::bind(&time_sink_c_impl::handle_pdus, this, _1)); // +2 for the PDU message buffers - for(int n = 0; n < d_nconnections+2; n++) { + for(unsigned int n = 0; n < d_nconnections+2; n++) { 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)); } // We don't use cbuffers with the PDU message handling capabilities. - for(int n = 0; n < d_nconnections/2; n++) { + for(unsigned int n = 0; n < d_nconnections/2; n++) { d_cbuffers.push_back((gr_complex*)volk_malloc(d_buffer_size*sizeof(gr_complex), volk_get_alignment())); memset(d_cbuffers[n], 0, d_buffer_size*sizeof(gr_complex)); @@ -112,10 +112,10 @@ namespace gr { d_main_gui->close(); // d_main_gui is a qwidget destroyed with its parent - for(int n = 0; n < d_nconnections+2; n++) { + for(unsigned int n = 0; n < d_nconnections+2; n++) { volk_free(d_buffers[n]); } - for(int n = 0; n < d_nconnections/2; n++) { + for(unsigned int n = 0; n < d_nconnections/2; n++) { volk_free(d_cbuffers[n]); } @@ -145,7 +145,7 @@ namespace gr { // If a style sheet is set in the prefs file, enable it here. check_set_qss(d_qApplication); - int numplots = (d_nconnections > 0) ? d_nconnections : 2; + unsigned int numplots = (d_nconnections > 0) ? d_nconnections : 2; d_main_gui = new TimeDisplayForm(numplots, d_parent); d_main_gui->setNPoints(d_size); d_main_gui->setSampleRate(d_samp_rate); @@ -215,37 +215,37 @@ namespace gr { } void - time_sink_c_impl::set_line_label(int which, const std::string &label) + time_sink_c_impl::set_line_label(unsigned int which, const std::string &label) { d_main_gui->setLineLabel(which, label.c_str()); } void - time_sink_c_impl::set_line_color(int which, const std::string &color) + time_sink_c_impl::set_line_color(unsigned int which, const std::string &color) { d_main_gui->setLineColor(which, color.c_str()); } void - time_sink_c_impl::set_line_width(int which, int width) + time_sink_c_impl::set_line_width(unsigned int which, int width) { d_main_gui->setLineWidth(which, width); } void - time_sink_c_impl::set_line_style(int which, int style) + time_sink_c_impl::set_line_style(unsigned int which, int style) { d_main_gui->setLineStyle(which, (Qt::PenStyle)style); } void - time_sink_c_impl::set_line_marker(int which, int marker) + time_sink_c_impl::set_line_marker(unsigned int which, int marker) { d_main_gui->setLineMarker(which, (QwtSymbol::Style)marker); } void - time_sink_c_impl::set_line_alpha(int which, double alpha) + time_sink_c_impl::set_line_alpha(unsigned int which, double alpha) { d_main_gui->setMarkerAlpha(which, (int)(255.0*alpha)); } @@ -298,37 +298,37 @@ namespace gr { } std::string - time_sink_c_impl::line_label(int which) + time_sink_c_impl::line_label(unsigned int which) { return d_main_gui->lineLabel(which).toStdString(); } std::string - time_sink_c_impl::line_color(int which) + time_sink_c_impl::line_color(unsigned int which) { return d_main_gui->lineColor(which).toStdString(); } int - time_sink_c_impl::line_width(int which) + time_sink_c_impl::line_width(unsigned int which) { return d_main_gui->lineWidth(which); } int - time_sink_c_impl::line_style(int which) + time_sink_c_impl::line_style(unsigned int which) { return d_main_gui->lineStyle(which); } int - time_sink_c_impl::line_marker(int which) + time_sink_c_impl::line_marker(unsigned int which) { return d_main_gui->lineMarker(which); } double - time_sink_c_impl::line_alpha(int which) + time_sink_c_impl::line_alpha(unsigned int which) { return (double)(d_main_gui->markerAlpha(which))/255.0; } @@ -345,14 +345,14 @@ namespace gr { d_buffer_size = 2*d_size; // Resize buffers and replace data - for(int n = 0; n < d_nconnections+2; n++) { + for(unsigned int n = 0; n < d_nconnections+2; n++) { volk_free(d_buffers[n]); d_buffers[n] = (double*)volk_malloc(d_buffer_size*sizeof(double), volk_get_alignment()); memset(d_buffers[n], 0, d_buffer_size*sizeof(double)); } - for(int n = 0; n < d_nconnections/2; n++) { + for(unsigned int n = 0; n < d_nconnections/2; n++) { volk_free(d_cbuffers[n]); d_cbuffers[n] = (gr_complex*)volk_malloc(d_buffer_size*sizeof(gr_complex), volk_get_alignment()); @@ -432,17 +432,19 @@ namespace gr { } void - time_sink_c_impl::enable_tags(int which, bool en) + time_sink_c_impl::enable_tags(unsigned int which, bool en) { - if(which == -1) { - for(int n = 0; n < d_nconnections; n++) { - d_main_gui->setTagMenu(n, en); - } - } - else d_main_gui->setTagMenu(which, en); } + void + time_sink_c_impl::enable_tags(bool en) + { + for(unsigned int n = 0; n < d_nconnections; ++n) { + d_main_gui->setTagMenu(n, en); + } + } + void time_sink_c_impl::enable_axis_labels(bool en) { @@ -465,7 +467,7 @@ namespace gr { void time_sink_c_impl::_reset() { - int n; + unsigned int n; if(d_trigger_delay) { for(n = 0; n < d_nconnections/2; n++) { // Move the tail of the buffers to the front. This section @@ -633,7 +635,7 @@ namespace gr { gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { - int n=0; + unsigned int n=0; const gr_complex *in; _npoints_resize(); |