Fixes the replotting update. It's now based on a QTimer so it's in the event buffer...
authorTom Rondeau <trondeau@vt.edu>
Sat, 1 May 2010 23:06:13 +0000 (19:06 -0400)
committerTom Rondeau <trondeau@vt.edu>
Sat, 1 May 2010 23:06:13 +0000 (19:06 -0400)
18 files changed:
gr-qtgui/src/lib/ConstellationDisplayPlot.cc
gr-qtgui/src/lib/ConstellationDisplayPlot.h
gr-qtgui/src/lib/FrequencyDisplayPlot.cc
gr-qtgui/src/lib/FrequencyDisplayPlot.h
gr-qtgui/src/lib/SpectrumGUIClass.cc
gr-qtgui/src/lib/SpectrumGUIClass.h
gr-qtgui/src/lib/TimeDomainDisplayPlot.cc
gr-qtgui/src/lib/TimeDomainDisplayPlot.h
gr-qtgui/src/lib/WaterfallDisplayPlot.cc
gr-qtgui/src/lib/WaterfallDisplayPlot.h
gr-qtgui/src/lib/qtgui_sink_c.cc
gr-qtgui/src/lib/qtgui_sink_c.h
gr-qtgui/src/lib/qtgui_sink_f.cc
gr-qtgui/src/lib/qtgui_sink_f.h
gr-qtgui/src/lib/spectrumUpdateEvents.cc
gr-qtgui/src/lib/spectrumUpdateEvents.h
gr-qtgui/src/lib/spectrumdisplayform.cc
gr-qtgui/src/lib/spectrumdisplayform.h

index 80bf4503f50fb3edb6ca17a06d01c931cf8b1201..4e6d6da18eaa1c2f229bf59d2ebd92f1f5b3c59c 100644 (file)
@@ -39,8 +39,6 @@ ConstellationDisplayPlot::ConstellationDisplayPlot(QWidget* parent)
 
   resize(parent->width(), parent->height());
 
-  _displayIntervalTime = (1.0/10.0); // 1/10 of a second between updates
-
   _numPoints = 1024;
   _penSize = 5;
   _realDataPoints = new double[_numPoints];
@@ -148,19 +146,9 @@ ConstellationDisplayPlot::set_axis(double xmin, double xmax,
   set_yaxis(ymin, ymax);
 }
 
-void ConstellationDisplayPlot::replot(){
-
-  const timespec startTime = get_highres_clock();
-  
+void ConstellationDisplayPlot::replot()
+{
   QwtPlot::replot();
-
-  double differenceTime = (diff_timespec(get_highres_clock(), startTime));
-
-  differenceTime *= 99.0;
-  // Require at least a 10% duty cycle
-  if(differenceTime > (1.0/10.0)){
-    _displayIntervalTime = differenceTime;
-  }
 }
 
 void
@@ -171,10 +159,12 @@ ConstellationDisplayPlot::resizeSlot( QSize *s )
 
 void ConstellationDisplayPlot::PlotNewData(const double* realDataPoints,
                                           const double* imagDataPoints,
-                                          const int64_t numDataPoints)
+                                          const int64_t numDataPoints,
+                                          const double timeInterval)
 {
-  if(numDataPoints > 0){
-
+  if((numDataPoints > 0) && 
+     (diff_timespec(get_highres_clock(), _lastReplot) > timeInterval)) {
+    
     if(numDataPoints != _numPoints){
       _numPoints = numDataPoints;
 
@@ -185,17 +175,12 @@ void ConstellationDisplayPlot::PlotNewData(const double* realDataPoints,
       
       _plot_curve->setRawData(_realDataPoints, _imagDataPoints, _numPoints);
     }
+
     memcpy(_realDataPoints, realDataPoints, numDataPoints*sizeof(double));
     memcpy(_imagDataPoints, imagDataPoints, numDataPoints*sizeof(double));
 
-  }
-
-  // Allow at least a 50% duty cycle
-  if(diff_timespec(get_highres_clock(), _lastReplot) > _displayIntervalTime){
-    // Only replot the screen if it is visible
-    if(isVisible()){
-      replot();
-    }
+    replot();
+    
     _lastReplot = get_highres_clock();
   }
 }
index 99ae566e0a8eca90a3ff210064b6a22dc86343bb..a441a8bfe81168a2f1e60c6c9e52b7eebedb8f0a 100644 (file)
@@ -24,7 +24,8 @@ public:
 
   void PlotNewData(const double* realDataPoints, 
                   const double* imagDataPoints, 
-                  const int64_t numDataPoints);
+                  const int64_t numDataPoints,
+                  const double timeInterval);
     
   virtual void replot();
 
@@ -55,8 +56,6 @@ private:
 
   int64_t _numPoints;
   int64_t _penSize;
-
-  double _displayIntervalTime;
 };
 
 #endif /* CONSTELLATION_DISPLAY_PLOT_HPP */
index 5e74dce40a8f8be171e95247352d108a3a7496a7..6f09bbc88a64f169487f2f96ae036f6e0dffee2a 100644 (file)
@@ -101,8 +101,6 @@ FrequencyDisplayPlot::FrequencyDisplayPlot(QWidget* parent)
 
   resize(parent->width(), parent->height());
   
-  _displayIntervalTime = (1.0/10.0); // 1/10 of a second between updates
-
   _useCenterFrequencyFlag = false;
 
   _numPoints = 1024;
@@ -299,8 +297,6 @@ FrequencyDisplayPlot::GetStopFrequency() const
 void
 FrequencyDisplayPlot::replot()
 {
-  const timespec startTime = get_highres_clock();
-
   _markerNoiseFloorAmplitude->setYValue(_noiseFloorAmplitude);
   
   // Make sure to take into account the start frequency
@@ -313,14 +309,6 @@ FrequencyDisplayPlot::replot()
   _markerPeakAmplitude->setYValue(_peakAmplitude);
   
   QwtPlot::replot();
-
-  double differenceTime = (diff_timespec(get_highres_clock(), startTime));
-
-  differenceTime *= 99.0;
-  // Require at least a 10% duty cycle
-  if(differenceTime > (1.0/10.0)){
-    _displayIntervalTime = differenceTime;
-  }
 }
  
 void
@@ -332,13 +320,15 @@ FrequencyDisplayPlot::resizeSlot( QSize *s )
 void
 FrequencyDisplayPlot::PlotNewData(const double* dataPoints, const int64_t numDataPoints,
                                  const double noiseFloorAmplitude, const double peakFrequency,
-                                 const double peakAmplitude)
+                                 const double peakAmplitude, const double timeInterval)
 {
-  if(numDataPoints > 0){
-
-    if(numDataPoints != _numPoints){
+  // Only update plot if there is data and if the time interval has elapsed
+  if((numDataPoints > 0) && 
+     (diff_timespec(get_highres_clock(), _lastReplot) > timeInterval)) {
+    
+    if(numDataPoints != _numPoints) {
       _numPoints = numDataPoints;
-
+      
       delete[] _dataPoints;
       delete[] _minFFTPoints;
       delete[] _maxFFTPoints;
@@ -351,12 +341,12 @@ FrequencyDisplayPlot::PlotNewData(const double* dataPoints, const int64_t numDat
       _fft_plot_curve->setRawData(_xAxisPoints, _dataPoints, _numPoints);
       _min_fft_plot_curve->setRawData(_xAxisPoints, _minFFTPoints, _numPoints);
       _max_fft_plot_curve->setRawData(_xAxisPoints, _maxFFTPoints, _numPoints);
-
+      
       _resetXAxisPoints();
       ClearMaxData();
       ClearMinData();
     }
-
+    
     memcpy(_dataPoints, dataPoints, numDataPoints*sizeof(double));
     for(int64_t point = 0; point < numDataPoints; point++){
       if(dataPoints[point] < _minFFTPoints[point]){
@@ -372,14 +362,9 @@ FrequencyDisplayPlot::PlotNewData(const double* dataPoints, const int64_t numDat
     _peakAmplitude = peakAmplitude;
 
     SetUpperIntensityLevel(_peakAmplitude);
-  }
 
-  // Allow at least a 50% duty cycle
-  if(diff_timespec(get_highres_clock(), _lastReplot) > _displayIntervalTime){
-    // Only replot the screen if it is visible
-    if(isVisible()){
-      replot();
-    }
+    replot();
+    
     _lastReplot = get_highres_clock();
   }
 }
index 785efe694b531729e699d868b29c3921bd92e3a3..c78e1667ea55ec99e929fedd8bd8af8d9cdc4a38 100644 (file)
@@ -30,7 +30,7 @@ public:
 
   void PlotNewData(const double* dataPoints, const int64_t numDataPoints,
                   const double noiseFloorAmplitude, const double peakFrequency,
-                  const double peakAmplitude);
+                  const double peakAmplitude, const double timeInterval);
   
   void ClearMaxData();
   void ClearMinData();
@@ -86,8 +86,6 @@ private:
   timespec _lastReplot;
 
   bool _useCenterFrequencyFlag;
-
-  double _displayIntervalTime;
 };
 
 #endif /* FREQUENCY_DISPLAY_PLOT_HPP */
index 4cb71a31a055e5f7c227d6eba79be8993a026a41..8c1b3670300f16bc5ec230a11898c8482b07bcc2 100644 (file)
@@ -111,7 +111,7 @@ SpectrumGUIClass::OpenSpectrumWindow(QWidget* parent,
   timespec_reset(&_lastGUIUpdateTime);
 
   // Draw Blank Display
-  UpdateWindow(false, NULL, 0, NULL, 0, NULL, 0, 1.0, get_highres_clock(), true);
+  UpdateWindow(false, NULL, 0, NULL, 0, NULL, 0, get_highres_clock(), true);
 
   // Set up the initial frequency axis settings
   SetFrequencyRange(_centerFrequency, _startFrequency, _stopFrequency);
@@ -220,7 +220,6 @@ SpectrumGUIClass::UpdateWindow(const bool updateDisplayFlag,
                               const uint64_t realTimeDomainDataSize,
                               const float* complexTimeDomainData,
                               const uint64_t complexTimeDomainDataSize,
-                              const double timePerFFT,
                               const timespec timestamp,
                               const bool lastOfMultipleFFTUpdateFlag)
 {
@@ -277,7 +276,7 @@ SpectrumGUIClass::UpdateWindow(const bool updateDisplayFlag,
   const timespec currentTime = get_highres_clock();
   const timespec lastUpdateGUITime = GetLastGUIUpdateTime();
 
-  if((diff_timespec(currentTime, lastUpdateGUITime) > (4*timePerFFT)) &&
+  if((diff_timespec(currentTime, lastUpdateGUITime) > (4*_updateTime)) &&
      (GetPendingGUIUpdateEvents() > 0) && !timespec_empty(&lastUpdateGUITime)) {
     // Do not update the display if too much data is pending to be displayed
     _droppedEntriesCount++;
@@ -290,7 +289,7 @@ SpectrumGUIClass::UpdateWindow(const bool updateDisplayFlag,
                                            _realTimeDomainPoints,
                                            _imagTimeDomainPoints,
                                            timeDomainBufferSize,
-                                           timePerFFT, timestamp,
+                                           timestamp,
                                            repeatDataFlag,
                                            lastOfMultipleFFTUpdateFlag,
                                            currentTime,
@@ -460,4 +459,12 @@ SpectrumGUIClass::SetFrequencyAxis(double min, double max)
   _spectrumDisplayForm->SetFrequencyAxis(min, max);
 }
 
+void
+SpectrumGUIClass::SetUpdateTime(double t)
+{
+  _updateTime = t;
+  _spectrumDisplayForm->SetUpdateTime(_updateTime);
+}
+
+
 #endif /* SPECTRUM_GUI_CLASS_CPP */
index d8dcb27691ade1396a58319b0f75e0755332c0a4..17d3a54c1af48601a368a72b6e03de89a03f5fa7 100644 (file)
@@ -47,7 +47,7 @@ public:
   void UpdateWindow(const bool, const std::complex<float>*,
                    const uint64_t, const float*,
                    const uint64_t, const float*,
-                   const uint64_t, const double,
+                   const uint64_t,
                    const timespec, const bool);
 
   float GetPowerValue()const;
@@ -79,6 +79,8 @@ public:
   void SetConstellationPenSize(int size);
   void SetFrequencyAxis(double min, double max);
 
+  void SetUpdateTime(double t);
+
 protected:
 
 private:
@@ -98,6 +100,7 @@ private:
   unsigned int _pendingGUIUpdateEventsCount;
   int _droppedEntriesCount;
   bool _fftBuffersCreatedFlag;
+  double _updateTime;
 
   SpectrumDisplayForm* _spectrumDisplayForm;
 
index cb18b44184db14dfdb1f2e4301bf56cfff112908..708ac1661729b8ef279b00a5237117cb177bb4ac 100644 (file)
@@ -32,13 +32,12 @@ protected:
   }
 };
 
-TimeDomainDisplayPlot::TimeDomainDisplayPlot(QWidget* parent):QwtPlot(parent){
+TimeDomainDisplayPlot::TimeDomainDisplayPlot(QWidget* parent):QwtPlot(parent)
+{
   timespec_reset(&_lastReplot);
 
   resize(parent->width(), parent->height());
 
-  _displayIntervalTime = (1.0/10.0); // 1/10 of a second between updates
-
   _numPoints = 1024;
   _realDataPoints = new double[_numPoints];
   _imagDataPoints = new double[_numPoints];
@@ -114,7 +113,8 @@ TimeDomainDisplayPlot::TimeDomainDisplayPlot(QWidget* parent):QwtPlot(parent){
   legendDisplay->setItemMode(QwtLegend::CheckableItem);
   insertLegend(legendDisplay);
 
-  connect(this, SIGNAL( legendChecked(QwtPlotItem *, bool ) ), this, SLOT( LegendEntryChecked(QwtPlotItem *, bool ) ));
+  connect(this, SIGNAL( legendChecked(QwtPlotItem *, bool ) ), 
+         this, SLOT( LegendEntryChecked(QwtPlotItem *, bool ) ));
 }
 
 TimeDomainDisplayPlot::~TimeDomainDisplayPlot(){
@@ -143,17 +143,7 @@ TimeDomainDisplayPlot::set_xaxis(double min, double max)
 
 void TimeDomainDisplayPlot::replot()
 {
-  const timespec startTime = get_highres_clock();
-  
   QwtPlot::replot();
-
-  double differenceTime = (diff_timespec(get_highres_clock(), startTime));
-
-  differenceTime *= 99.0;
-  // Require at least a 10% duty cycle
-  if(differenceTime > (1.0/10.0)){
-    _displayIntervalTime = differenceTime;
-  }
 }
 
 void
@@ -164,10 +154,12 @@ TimeDomainDisplayPlot::resizeSlot( QSize *s )
 
 void TimeDomainDisplayPlot::PlotNewData(const double* realDataPoints,
                                        const double* imagDataPoints,
-                                       const int64_t numDataPoints)
+                                       const int64_t numDataPoints,
+                                       const double timeInterval)
 {
-  if(numDataPoints > 0){
-
+  if((numDataPoints > 0) && 
+     (diff_timespec(get_highres_clock(), _lastReplot) > timeInterval)) {
+  
     if(numDataPoints != _numPoints){
       _numPoints = numDataPoints;
 
@@ -185,17 +177,12 @@ void TimeDomainDisplayPlot::PlotNewData(const double* realDataPoints,
 
       _resetXAxisPoints();
     }
+
     memcpy(_realDataPoints, realDataPoints, numDataPoints*sizeof(double));
     memcpy(_imagDataPoints, imagDataPoints, numDataPoints*sizeof(double));
 
-  }
+    replot();
 
-  // Allow at least a 50% duty cycle
-  if(diff_timespec(get_highres_clock(), _lastReplot) > _displayIntervalTime){
-    // Only replot the screen if it is visible
-    if(isVisible()){
-      replot();
-    }
     _lastReplot = get_highres_clock();
   }
 }
index 8d98abac6d422ee99881c665cfe76ae73f427a49..88f97cb808694bfd72b9b43ee791dc4de72de2be 100644 (file)
@@ -21,7 +21,8 @@ public:
   TimeDomainDisplayPlot(QWidget*);
   virtual ~TimeDomainDisplayPlot();
 
-  void PlotNewData(const double* realDataPoints, const double* imagDataPoints, const int64_t numDataPoints);
+  void PlotNewData(const double* realDataPoints, const double* imagDataPoints, 
+                  const int64_t numDataPoints, const double timeInterval);
     
   void SetImaginaryDataVisible(const bool);
                                   
@@ -54,8 +55,6 @@ private:
   timespec _lastReplot;
 
   int64_t _numPoints;
-
-  double _displayIntervalTime;
 };
 
 #endif /* TIME_DOMAIN_DISPLAY_PLOT_HPP */
index b23612524fe2df3bce71417f91d11a4ac9e5038d..3d173cfe37f7bb077a34293902c9fa673aa5bd52 100644 (file)
@@ -224,8 +224,6 @@ WaterfallDisplayPlot::WaterfallDisplayPlot(QWidget* parent)
   resize(parent->width(), parent->height());
   _numPoints = 1024;
 
-  _displayIntervalTime = (1.0/5.0); // 1/5 of a second between updates
-
   _waterfallData = new WaterfallData(_startFrequency, _stopFrequency, _numPoints, 200);
 
   QPalette palette;
@@ -370,50 +368,46 @@ WaterfallDisplayPlot::GetStopFrequency() const
 
 void
 WaterfallDisplayPlot::PlotNewData(const double* dataPoints, 
-                                      const int64_t numDataPoints,
-                                      const double timePerFFT,
-                                      const timespec timestamp,
-                                      const int droppedFrames)
+                                 const int64_t numDataPoints,
+                                 const double timePerFFT,
+                                 const timespec timestamp,
+                                 const int droppedFrames)
 {
   if(numDataPoints > 0){
     if(numDataPoints != _numPoints){
       _numPoints = numDataPoints;
-
+      
       Reset();
-
+      
       d_spectrogram->invalidateCache();
       d_spectrogram->itemChanged();
-
+      
       if(isVisible()){
        replot();
       }
-
+      
       _lastReplot = get_highres_clock();
     }
 
-    _waterfallData->addFFTData(dataPoints, numDataPoints, droppedFrames);
-    _waterfallData->IncrementNumLinesToUpdate();
-
-    QwtTimeScaleDraw* timeScale = (QwtTimeScaleDraw*)axisScaleDraw(QwtPlot::yLeft);
-    timeScale->SetSecondsPerLine(timePerFFT);
-    timeScale->SetZeroTime(timestamp);
-
-    ((WaterfallZoomer*)_zoomer)->SetSecondsPerLine(timePerFFT);
-    ((WaterfallZoomer*)_zoomer)->SetZeroTime(timestamp);
-  }
-
-  // Allow at least a 50% duty cycle
-  if(diff_timespec(get_highres_clock(), _lastReplot) > _displayIntervalTime){
-
-    d_spectrogram->invalidateCache();
-    d_spectrogram->itemChanged();
-
-    // Only update when window is visible
-    if(isVisible()){
+    if(diff_timespec(get_highres_clock(), _lastReplot) > timePerFFT) {
+      //FIXME: We may want to average the data between these updates to smooth display
+      _waterfallData->addFFTData(dataPoints, numDataPoints, droppedFrames);
+      _waterfallData->IncrementNumLinesToUpdate();
+      
+      QwtTimeScaleDraw* timeScale = (QwtTimeScaleDraw*)axisScaleDraw(QwtPlot::yLeft);
+      timeScale->SetSecondsPerLine(timePerFFT);
+      timeScale->SetZeroTime(timestamp);
+      
+      ((WaterfallZoomer*)_zoomer)->SetSecondsPerLine(timePerFFT);
+      ((WaterfallZoomer*)_zoomer)->SetZeroTime(timestamp);
+      
+      d_spectrogram->invalidateCache();
+      d_spectrogram->itemChanged();
+      
       replot();
-    }
 
-    _lastReplot = get_highres_clock();
+      _lastReplot = get_highres_clock();
+    }
   }
 }
 
@@ -432,8 +426,6 @@ WaterfallDisplayPlot::SetIntensityRange(const double minIntensity,
 void
 WaterfallDisplayPlot::replot()
 {
-  const timespec startTime = get_highres_clock();
-
   QwtTimeScaleDraw* timeScale = (QwtTimeScaleDraw*)axisScaleDraw(QwtPlot::yLeft);
   timeScale->initiateUpdate();
 
@@ -455,14 +447,6 @@ WaterfallDisplayPlot::replot()
   }
 
   QwtPlot::replot();
-
-  double differenceTime = (diff_timespec(get_highres_clock(), startTime));
-  
-  // Require at least a 5% duty cycle
-  differenceTime *= 19.0;
-  if(differenceTime > (1.0/5.0)){
-    _displayIntervalTime = differenceTime;
-  }
 }
 
 void
index 18e10aae94d6310bce17a3c41a519e2c096c8797..a5ccaec401c1c961f880bfcd1193aef522800794 100644 (file)
@@ -73,8 +73,6 @@ private:
 
   int64_t _numPoints;
 
-  double _displayIntervalTime;
-
   int _intensityColorMapType;
   QColor _userDefinedLowIntensityColor;
   QColor _userDefinedHighIntensityColor;
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 {
index 91c6b03e61e146816b642b0f8596695a0a20b9d9..1f6c284738981bf6abe8225d8c7984d6ecd28dcc 100644 (file)
@@ -86,6 +86,8 @@ private:
 
   bool d_plotfreq, d_plotwaterfall, d_plotwaterfall3d, d_plottime, d_plotconst;
   
+  double d_update_time;
+
   QWidget *d_parent;
   SpectrumGUIClass *d_main_gui;
 
@@ -111,6 +113,8 @@ public:
   void set_constellation_pen_size(int size);
   void set_frequency_axis(double min, double max);
 
+  void set_update_time(double t);
+
   QApplication *d_qApplication;
   qtgui_obj *d_object;
 
index 6fbb2f381ce26e251320602f42ab91f41bddeb83..a088e28e953e606e815e4c48f49ffd49b2f17a87 100644 (file)
@@ -140,6 +140,9 @@ qtgui_sink_f::initialize(const bool opengl)
                                 d_plotconst,
                                 opengl);
 
+  // initialize update time to 10 times a second
+  set_update_time(100);
+
   d_object = new qtgui_obj(d_qApplication);
   qApp->postEvent(d_object, new qtgui_event(&d_pmutex));
 }
@@ -201,6 +204,13 @@ qtgui_sink_f::set_frequency_axis(double min, double max)
   d_main_gui->SetFrequencyAxis(min, max);
 }
 
+void
+qtgui_sink_f::set_update_time(double t)
+{
+  d_update_time = t;
+  d_main_gui->SetUpdateTime(d_update_time);
+}
+
 void
 qtgui_sink_f::fft(const float *data_in, int size)
 {
@@ -295,7 +305,7 @@ qtgui_sink_f::general_work (int noutput_items,
       
       d_main_gui->UpdateWindow(true, d_fft->get_outbuf(), d_fftsize,
                               (float*)d_residbuf, d_fftsize, NULL, 0,
-                              1.0/4.0, currentTime, true);
+                              currentTime, true);
     }
     // Otherwise, copy what we received into the residbuf for next time
     else {
index 47c928d17ce55e0ab508b506ff26471c8c6bc8ee..f603da7b6ac990f2e0b4756b9ca9d22653d3367f 100644 (file)
@@ -84,6 +84,8 @@ private:
 
   bool d_plotfreq, d_plotwaterfall, d_plotwaterfall3d, d_plottime, d_plotconst;
 
+  double d_update_time;
+
   QWidget *d_parent;
   SpectrumGUIClass *d_main_gui; 
 
@@ -109,6 +111,8 @@ public:
   void set_constellation_pen_size(int size);
   void set_frequency_axis(double min, double max);
 
+  void set_update_time(double t);
+
   QApplication *d_qApplication;
   qtgui_obj *d_object;
 
index 2da37d350e7db7ca8d475c8617ad5bbe3b2103ac..350e3eeb2ed28142ed6c6bd4fb7c986413addfb4 100644 (file)
@@ -8,7 +8,6 @@ SpectrumUpdateEvent::SpectrumUpdateEvent(const std::complex<float>* fftPoints,
                                         const double* realTimeDomainPoints,
                                         const double* imagTimeDomainPoints,
                                         const uint64_t numTimeDomainDataPoints,
-                                        const double timePerFFT,
                                         const timespec dataTimestamp,
                                         const bool repeatDataFlag,
                                         const bool lastOfMultipleUpdateFlag,
@@ -44,7 +43,6 @@ SpectrumUpdateEvent::SpectrumUpdateEvent(const std::complex<float>* fftPoints,
           numTimeDomainDataPoints*sizeof(double));
   }
   _dataTimestamp = dataTimestamp;
-  _timePerFFT = timePerFFT;
   _repeatDataFlag = repeatDataFlag;
   _lastOfMultipleUpdateFlag = lastOfMultipleUpdateFlag;
   _eventGeneratedTimestamp = generatedTimestamp;
@@ -87,12 +85,6 @@ SpectrumUpdateEvent::getNumTimeDomainDataPoints() const
   return _numTimeDomainDataPoints;
 }
 
-double
-SpectrumUpdateEvent::getTimePerFFT() const
-{
-  return _timePerFFT;
-}
-
 timespec
 SpectrumUpdateEvent::getDataTimestamp() const
 {
index 75fa273243a62fcde60f674011dbeda64d46cda7..9c46d4bf303daf31d1155e9d47ed0c2209e8519f 100644 (file)
 class SpectrumUpdateEvent:public QEvent{
 
 public:
-  SpectrumUpdateEvent(const std::complex<float>* fftPoints, const uint64_t numFFTDataPoints, const double* realTimeDomainPoints, const double* imagTimeDomainPoints, const uint64_t numTimeDomainDataPoints, const double timePerFFT, const timespec dataTimestamp, const bool repeatDataFlag, const bool lastOfMultipleUpdateFlag, const timespec generatedTimestamp, const int droppedFFTFrames);
+  SpectrumUpdateEvent(const std::complex<float>* fftPoints, const uint64_t numFFTDataPoints, const double* realTimeDomainPoints, const double* imagTimeDomainPoints, const uint64_t numTimeDomainDataPoints, const timespec dataTimestamp, const bool repeatDataFlag, const bool lastOfMultipleUpdateFlag, const timespec generatedTimestamp, const int droppedFFTFrames);
   ~SpectrumUpdateEvent();
   const std::complex<float>* getFFTPoints()const;
   const double* getRealTimeDomainPoints()const;
   const double* getImagTimeDomainPoints()const;
   uint64_t getNumFFTDataPoints()const;
   uint64_t getNumTimeDomainDataPoints()const;
-  double getTimePerFFT()const;
   timespec getDataTimestamp()const;
   bool getRepeatDataFlag()const;
   bool getLastOfMultipleUpdateFlag()const;
@@ -32,7 +31,6 @@ private:
   double* _imagDataTimeDomainPoints;
   uint64_t _numFFTDataPoints;
   uint64_t _numTimeDomainDataPoints;
-  double _timePerFFT;
   timespec _dataTimestamp;
   bool _repeatDataFlag;
   bool _lastOfMultipleUpdateFlag;
index 141fc0e3385178dae91756ad7cf28b00dfa57335..0170f78623afa3d05ed9758ffdddef051a007bbe 100644 (file)
Binary files a/gr-qtgui/src/lib/spectrumdisplayform.cc and b/gr-qtgui/src/lib/spectrumdisplayform.cc differ
index b596b04958456ed60e52502f39f6ecff34b34615..bf2af703354439780aaa8f426b1eb22b6108a9cf 100644 (file)
@@ -13,6 +13,7 @@ class SpectrumGUIClass;
 #include <TimeDomainDisplayPlot.h>
 #include <ConstellationDisplayPlot.h>
 #include <QValidator>
+#include <QTimer>
 #include <vector>
 
 class SpectrumDisplayForm : public QWidget, public Ui::SpectrumDisplayForm
@@ -70,9 +71,11 @@ public slots:
                            double ymin, double ymax);
   void SetConstellationPenSize(int size);
   void SetFrequencyAxis(double min, double max);
+  void SetUpdateTime(double t);
 
 private slots:
   void newFrequencyData( const SpectrumUpdateEvent* );
+  void UpdateGuiTimer();
 
 protected:
 
@@ -110,6 +113,9 @@ private:
   int d_plot_waterfall3d;
   int d_plot_time;
   int d_plot_constellation;
+
+  QTimer *displayTimer;
+  double d_update_time;
 };
 
 #endif /* SPECTRUM_DISPLAY_FORM_H */