diff options
author | Tom Rondeau | 2010-05-01 19:06:13 -0400 |
---|---|---|
committer | Tom Rondeau | 2010-05-01 19:06:13 -0400 |
commit | 6606af991b15174cbdbaca738669a21461b0fbe6 (patch) | |
tree | 1fc38aa738e8dccc675ac3da0938fbd3e992eca2 /gr-qtgui/src/lib/qtgui_sink_c.cc | |
parent | f1b71c9525dd56e2c296a2bca4b2db9ed1a320ce (diff) | |
download | gnuradio-6606af991b15174cbdbaca738669a21461b0fbe6.tar.gz gnuradio-6606af991b15174cbdbaca738669a21461b0fbe6.tar.bz2 gnuradio-6606af991b15174cbdbaca738669a21461b0fbe6.zip |
Fixes the replotting update. It's now based on a QTimer so it's in the event buffer as opposed to a best effort based on a hand-made timer. The interval between GUI updates is settable through the qtsink_X objects with set_update_time(newtime). This update makes the plotting much more stable. It also fixes the time scale of the waterfall plot to actually mean the right thing.
Diffstat (limited to 'gr-qtgui/src/lib/qtgui_sink_c.cc')
-rw-r--r-- | gr-qtgui/src/lib/qtgui_sink_c.cc | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/gr-qtgui/src/lib/qtgui_sink_c.cc b/gr-qtgui/src/lib/qtgui_sink_c.cc index 7340141a6..fefa98704 100644 --- a/gr-qtgui/src/lib/qtgui_sink_c.cc +++ b/gr-qtgui/src/lib/qtgui_sink_c.cc @@ -145,6 +145,9 @@ qtgui_sink_c::initialize(const bool opengl) d_plotconst, opengl); + // initialize update time to 10 times a second + set_update_time(0.1); + d_object = new qtgui_obj(d_qApplication); qApp->postEvent(d_object, new qtgui_event(&d_pmutex)); } @@ -208,6 +211,13 @@ qtgui_sink_c::set_frequency_axis(double min, double max) } void +qtgui_sink_c::set_update_time(double t) +{ + d_update_time = t; + d_main_gui->SetUpdateTime(d_update_time); +} + +void qtgui_sink_c::fft(const gr_complex *data_in, int size) { if (d_window.size()) { @@ -300,7 +310,7 @@ qtgui_sink_c::general_work (int noutput_items, d_main_gui->UpdateWindow(true, d_fft->get_outbuf(), d_fftsize, NULL, 0, (float*)d_residbuf, d_fftsize, - 1.0/4.0, currentTime, true); + currentTime, true); } // Otherwise, copy what we received into the residbuf for next time else { |