commit-gnuradio
[Top][All Lists]
Advanced

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

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


From: trondeau
Subject: [Commit-gnuradio] r11333 - gnuradio/branches/developers/trondeau/qt/gr-qtgui/src/lib
Date: Fri, 3 Jul 2009 09:03:30 -0600 (MDT)

Author: trondeau
Date: 2009-07-03 09:03:30 -0600 (Fri, 03 Jul 2009)
New Revision: 11333

Modified:
   gnuradio/branches/developers/trondeau/qt/gr-qtgui/src/lib/qtgui_sink_c.cc
   
gnuradio/branches/developers/trondeau/qt/gr-qtgui/src/lib/spectrumdisplayform.cc
Log:
Proper handling of frequency axis labels.

Modified: 
gnuradio/branches/developers/trondeau/qt/gr-qtgui/src/lib/qtgui_sink_c.cc
===================================================================
--- gnuradio/branches/developers/trondeau/qt/gr-qtgui/src/lib/qtgui_sink_c.cc   
2009-07-03 15:01:37 UTC (rev 11332)
+++ gnuradio/branches/developers/trondeau/qt/gr-qtgui/src/lib/qtgui_sink_c.cc   
2009-07-03 15:03:30 UTC (rev 11333)
@@ -163,7 +163,7 @@
                                  const double startfreq,
                                  const double stopfreq)
 {
-  d_main_gui->SetFrequencyRange(centerfreq, startfreq, stopfreq);
+  d_main_gui->SetFrequencyRange(startfreq, stopfreq, centerfreq);
 }
 
 void
@@ -282,7 +282,7 @@
   const timespec currentTime = get_highres_clock();
   const timespec lastUpdateGUITime = d_main_gui->GetLastGUIUpdateTime();
 
-  if(diff_timespec(currentTime, lastUpdateGUITime) > 0.25) {
+  if(diff_timespec(currentTime, lastUpdateGUITime) > 0.05) {
 
     if(d_index) {
       int filler = std::min(d_fftsize - d_index, noutput_items);

Modified: 
gnuradio/branches/developers/trondeau/qt/gr-qtgui/src/lib/spectrumdisplayform.cc
===================================================================
--- 
gnuradio/branches/developers/trondeau/qt/gr-qtgui/src/lib/spectrumdisplayform.cc
    2009-07-03 15:01:37 UTC (rev 11332)
+++ 
gnuradio/branches/developers/trondeau/qt/gr-qtgui/src/lib/spectrumdisplayform.cc
    2009-07-03 15:03:30 UTC (rev 11333)
@@ -481,9 +481,9 @@
 
   if(fdiff > 0) {
     std::string strunits[4] = {"Hz", "kHz", "MHz", "GHz"};
-    double units10 = floor(log10(fdiff));
-    double units3  = floor(units10 / 3.0);
-    double units = pow(10, units10);
+    double units10 = floor(log10(std::max(fabs(newStartFrequency), 
fabs(newStopFrequency))));
+    double units3  = std::max(floor(units10 / 3.0), 0.0);
+    double units = pow(10, (units10-fmod(units10, 3.0)));
     int iunit = static_cast<int>(units3);
     
     _frequencyDisplayPlot->SetFrequencyRange(newStartFrequency,





reply via email to

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