commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] r7287 - gnuradio/branches/releases/3.1/gr-utils/src/py


From: jcorgan
Subject: [Commit-gnuradio] r7287 - gnuradio/branches/releases/3.1/gr-utils/src/python
Date: Thu, 27 Dec 2007 13:36:42 -0700 (MST)

Author: jcorgan
Date: 2007-12-27 13:36:39 -0700 (Thu, 27 Dec 2007)
New Revision: 7287

Modified:
   gnuradio/branches/releases/3.1/gr-utils/src/python/usrp_fft.py
Log:
Applied changeset r6837 on trunk to release branch.

Modified: gnuradio/branches/releases/3.1/gr-utils/src/python/usrp_fft.py
===================================================================
--- gnuradio/branches/releases/3.1/gr-utils/src/python/usrp_fft.py      
2007-12-27 20:34:50 UTC (rev 7286)
+++ gnuradio/branches/releases/3.1/gr-utils/src/python/usrp_fft.py      
2007-12-27 20:36:39 UTC (rev 7287)
@@ -28,8 +28,8 @@
 from optparse import OptionParser
 import wx
 import sys
+import numpy
 
-
 def pick_subdevice(u):
     """
     The user didn't specify a subdevice on the command line.
@@ -261,8 +261,18 @@
            
     def evt_left_dclick(self, event):
        (ux, uy) = self.scope.win.GetXY(event)
-       target_freq = ux/self.scope.win._scale_factor
-       self.set_freq(target_freq)
+       if event.CmdDown():
+           # Re-center on maximum power
+           points = self.scope.win._points
+            ind = numpy.argmax(points[:,1])
+            (freq, pwr) = points[ind]
+           target_freq = freq/self.scope.win._scale_factor
+            self.set_freq(target_freq)            
+       else:
+           # Re-center on clicked frequency
+           target_freq = ux/self.scope.win._scale_factor
+           self.set_freq(target_freq)
+           
        
 def main ():
     app = stdgui2.stdapp(app_top_block, "USRP FFT", nstatus=1)





reply via email to

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