summaryrefslogtreecommitdiff
path: root/gr-utils/src
diff options
context:
space:
mode:
authorjcorgan2007-11-08 07:03:45 +0000
committerjcorgan2007-11-08 07:03:45 +0000
commit6fd683e2bef9b131bcf87dbdd04613b4a11f5e94 (patch)
tree349112ccec3915a3657566449bc85291f124a1eb /gr-utils/src
parent16920f6f12df9a4bbca3d9b2fa25f44145ee5513 (diff)
downloadgnuradio-6fd683e2bef9b131bcf87dbdd04613b4a11f5e94.tar.gz
gnuradio-6fd683e2bef9b131bcf87dbdd04613b4a11f5e94.tar.bz2
gnuradio-6fd683e2bef9b131bcf87dbdd04613b4a11f5e94.zip
Adds 'double-click to re-center' to usrp_fft.py
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@6832 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'gr-utils/src')
-rwxr-xr-xgr-utils/src/python/usrp_fft.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/gr-utils/src/python/usrp_fft.py b/gr-utils/src/python/usrp_fft.py
index 6ffeb1f03..5aee24fe6 100755
--- a/gr-utils/src/python/usrp_fft.py
+++ b/gr-utils/src/python/usrp_fft.py
@@ -109,7 +109,8 @@ class app_top_block(stdgui2.std_top_block):
self.connect(self.u, self.scope)
self._build_gui(vbox)
-
+ self._setup_events()
+
# set initial values
if options.gain is None:
@@ -254,6 +255,15 @@ class app_top_block(stdgui2.std_top_block):
self.myform['fs@usb'].set_value(self.u.adc_freq() / self.u.decim_rate())
return ok
+ def _setup_events(self):
+ if not self.options.waterfall and not self.options.oscilloscope:
+ self.scope.win.Bind(wx.EVT_LEFT_DCLICK, self.evt_left_dclick)
+
+ 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)
+
def main ():
app = stdgui2.stdapp(app_top_block, "USRP FFT", nstatus=1)
app.MainLoop()