commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] r11334 - gnuradio/branches/developers/trondeau/qt/gr-q


From: trondeau
Subject: [Commit-gnuradio] r11334 - gnuradio/branches/developers/trondeau/qt/gr-qtgui/src/lib
Date: Fri, 3 Jul 2009 11:29:19 -0600 (MDT)

Author: trondeau
Date: 2009-07-03 11:29:19 -0600 (Fri, 03 Jul 2009)
New Revision: 11334

Modified:
   
gnuradio/branches/developers/trondeau/qt/gr-qtgui/src/lib/FrequencyDisplayPlot.cc
   
gnuradio/branches/developers/trondeau/qt/gr-qtgui/src/lib/FrequencyDisplayPlot.h
Log:
Better handling of zoom levels and user-settable axis scales.

Modified: 
gnuradio/branches/developers/trondeau/qt/gr-qtgui/src/lib/FrequencyDisplayPlot.cc
===================================================================
--- 
gnuradio/branches/developers/trondeau/qt/gr-qtgui/src/lib/FrequencyDisplayPlot.cc
   2009-07-03 15:03:30 UTC (rev 11333)
+++ 
gnuradio/branches/developers/trondeau/qt/gr-qtgui/src/lib/FrequencyDisplayPlot.cc
   2009-07-03 17:29:19 UTC (rev 11334)
@@ -117,8 +117,10 @@
   setAxisScale(QwtPlot::xBottom, _startFrequency, _stopFrequency);
   setAxisTitle(QwtPlot::xBottom, "Frequency (Hz)");
 
+  _minYAxis = -120;
+  _maxYAxis = 10;
   setAxisScaleEngine(QwtPlot::yLeft, new QwtLinearScaleEngine);
-  set_yaxis(-210, 5);
+  setAxisScale(QwtPlot::yLeft, _minYAxis, _maxYAxis);
   setAxisTitle(QwtPlot::yLeft, "Power (dB)");
 
   // Automatically deleted when parent is deleted
@@ -225,7 +227,15 @@
 void
 FrequencyDisplayPlot::set_yaxis(double min, double max)
 {
-  setAxisScale(QwtPlot::yLeft, min, max);
+  // Get the new max/min values for the plot
+  _minYAxis = min;
+  _maxYAxis = max;
+
+  // Set the axis max/min to the new values
+  setAxisScale(QwtPlot::yLeft, _minYAxis, _maxYAxis);
+
+  // Reset the base zoom level to the new axis scale set here
+  _zoomer->setZoomBase();
 }
 
 void
@@ -362,7 +372,7 @@
 FrequencyDisplayPlot::ClearMaxData()
 {
   for(int64_t number = 0; number < _numPoints; number++){
-    _maxFFTPoints[number] = -280.0;
+    _maxFFTPoints[number] = _maxYAxis;
   }
 }
 
@@ -370,7 +380,7 @@
 FrequencyDisplayPlot::ClearMinData()
 {
   for(int64_t number = 0; number < _numPoints; number++){
-    _minFFTPoints[number] = 200.0;
+    _minFFTPoints[number] = _minYAxis;
   }
 }
 

Modified: 
gnuradio/branches/developers/trondeau/qt/gr-qtgui/src/lib/FrequencyDisplayPlot.h
===================================================================
--- 
gnuradio/branches/developers/trondeau/qt/gr-qtgui/src/lib/FrequencyDisplayPlot.h
    2009-07-03 15:03:30 UTC (rev 11333)
+++ 
gnuradio/branches/developers/trondeau/qt/gr-qtgui/src/lib/FrequencyDisplayPlot.h
    2009-07-03 17:29:19 UTC (rev 11334)
@@ -52,7 +52,9 @@
   
   double _startFrequency;
   double _stopFrequency;
-
+  double _maxYAxis;
+  double _minYAxis;
+  
   QwtPlotCurve* _fft_plot_curve;
   QwtPlotCurve* _min_fft_plot_curve;
   QwtPlotCurve* _max_fft_plot_curve;





reply via email to

[Prev in Thread] Current Thread [Next in Thread]