Fixes the replotting update. It's now based on a QTimer so it's in the event buffer...
[debian/gnuradio] / gr-qtgui / src / lib / qtgui_sink_c.cc
index 7340141a697b599f78f866f6153ac7a18a0618c4..fefa987044885503b5cb2a4b7657dbe3cea4596e 100644 (file)
@@ -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));
 }
@@ -207,6 +210,13 @@ qtgui_sink_c::set_frequency_axis(double min, double max)
   d_main_gui->SetFrequencyAxis(min, 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)
 {
@@ -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 {