diff options
Diffstat (limited to 'gr-qtgui/lib/time_sink_c_impl.cc')
-rw-r--r-- | gr-qtgui/lib/time_sink_c_impl.cc | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/gr-qtgui/lib/time_sink_c_impl.cc b/gr-qtgui/lib/time_sink_c_impl.cc index d3819b5d5c..c8efb63721 100644 --- a/gr-qtgui/lib/time_sink_c_impl.cc +++ b/gr-qtgui/lib/time_sink_c_impl.cc @@ -34,23 +34,23 @@ namespace gr { namespace qtgui { time_sink_c::sptr - time_sink_c::make(int size, double bw, + time_sink_c::make(int size, double samp_rate, const std::string &name, int nconnections, QWidget *parent) { return gnuradio::get_initial_sptr - (new time_sink_c_impl(size, bw, name, nconnections, parent)); + (new time_sink_c_impl(size, samp_rate, name, nconnections, parent)); } - time_sink_c_impl::time_sink_c_impl(int size, double bw, + time_sink_c_impl::time_sink_c_impl(int size, double samp_rate, const std::string &name, int nconnections, QWidget *parent) : gr_sync_block("time_sink_c", gr_make_io_signature(nconnections, nconnections, sizeof(gr_complex)), gr_make_io_signature(0, 0, 0)), - d_size(size), d_bandwidth(bw), d_name(name), + d_size(size), d_samp_rate(samp_rate), d_name(name), d_nconnections(2*nconnections), d_parent(parent) { d_main_gui = NULL; @@ -92,6 +92,7 @@ namespace gr { d_main_gui = new TimeDisplayForm(d_nconnections, d_parent); d_main_gui->setNPoints(d_size); + d_main_gui->setSampleRate(d_samp_rate); // initialize update time to 10 times a second set_update_time(0.1); @@ -199,6 +200,14 @@ namespace gr { } void + time_sink_c_impl::set_samp_rate(const double samp_rate) + { + gruel::scoped_lock lock(d_mutex); + d_samp_rate = samp_rate; + d_main_gui->setSampleRate(d_samp_rate); + } + + void time_sink_c_impl::npoints_resize() { int newsize = d_main_gui->getNPoints(); |