commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] r7282 - gnuradio/branches/releases/3.1/gr-wxgui/src/py


From: jcorgan
Subject: [Commit-gnuradio] r7282 - gnuradio/branches/releases/3.1/gr-wxgui/src/python
Date: Thu, 27 Dec 2007 13:27:03 -0700 (MST)

Author: jcorgan
Date: 2007-12-27 13:26:59 -0700 (Thu, 27 Dec 2007)
New Revision: 7282

Modified:
   gnuradio/branches/releases/3.1/gr-wxgui/src/python/fftsink2.py
Log:
Applied changeset r6830 on trunk to release branch.

Modified: gnuradio/branches/releases/3.1/gr-wxgui/src/python/fftsink2.py
===================================================================
--- gnuradio/branches/releases/3.1/gr-wxgui/src/python/fftsink2.py      
2007-12-27 20:25:56 UTC (rev 7281)
+++ gnuradio/branches/releases/3.1/gr-wxgui/src/python/fftsink2.py      
2007-12-27 20:26:59 UTC (rev 7282)
@@ -260,16 +260,19 @@
         if x >= 1e9:
             sf = 1e-9
             self.units = "GHz"
+           self.format = "%3.6f"
         elif x >= 1e6:
             sf = 1e-6
             self.units = "MHz"
+           self.format = "%3.3f"
         else:
             sf = 1e-3
             self.units = "kHz"
+           self.format = "%3.3f"
 
         if self.fftsink.input_is_real:     # only plot 1/2 the points
             x_vals = ((numpy.arange (L/2)
-                       * (self.fftsink.sample_rate * sf / L))
+                      * (self.fftsink.sample_rate * sf / L))
                       + self.fftsink.baseband_freq * sf)
             self.points = numpy.zeros((len(x_vals), 2), numpy.float64)
             self.points[:,0] = x_vals
@@ -277,7 +280,7 @@
         else:
             # the "negative freqs" are in the second half of the array
             x_vals = ((numpy.arange (-L/2, L/2)
-                       * (self.fftsink.sample_rate * sf / L))
+                      * (self.fftsink.sample_rate * sf / L))
                       + self.fftsink.baseband_freq * sf)
             self.points = numpy.zeros((len(x_vals), 2), numpy.float64)
             self.points[:,0] = x_vals
@@ -364,7 +367,7 @@
         index = numpy.argmin(numpy.abs(x_vals-ux))
         x_val = x_vals[index]
         db_val = self.points[index, 1]
-        text = "%3.3f %s dB=%3.3f" % (x_val, self.units, db_val)
+        text = (self.format+" %s dB=%3.3f") % (x_val, self.units, db_val)
 
         # Display the tooltip
         tip = wx.ToolTip(text)





reply via email to

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