summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjcorgan2008-10-26 20:41:23 +0000
committerjcorgan2008-10-26 20:41:23 +0000
commit267cd744dda0cc857b623060023c658cf97b48f4 (patch)
treee0a70ace4ed4613a50bf9bbef6fb933b7cfbd5bb
parent7dd8552fb38a5bfdf68c280261fad60d43bdc328 (diff)
downloadgnuradio-267cd744dda0cc857b623060023c658cf97b48f4.tar.gz
gnuradio-267cd744dda0cc857b623060023c658cf97b48f4.tar.bz2
gnuradio-267cd744dda0cc857b623060023c658cf97b48f4.zip
Update usrp2_fft.py to use updated gr-usrp2. Display is correct now, however, attempting to change parameters via the controls still isn't working. But this has been isolated to a libusrp2 issue, not a usrp2_fft.py issue.
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@9859 221aa14e-8319-0410-a670-987f0aec2ac5
-rwxr-xr-xgr-utils/src/python/usrp2_fft.py38
1 files changed, 18 insertions, 20 deletions
diff --git a/gr-utils/src/python/usrp2_fft.py b/gr-utils/src/python/usrp2_fft.py
index f4303f1f8..54defd60d 100755
--- a/gr-utils/src/python/usrp2_fft.py
+++ b/gr-utils/src/python/usrp2_fft.py
@@ -68,8 +68,7 @@ class app_top_block(stdgui2.std_top_block):
self.u = usrp2.source_32fc(options.interface, options.mac_addr)
self.u.set_decim(options.decim)
- #input_rate = self.u.adc_freq() / self.u.decim_rate()
- input_rate = 100e6/options.decim
+ input_rate = self.u.adc_rate() / self.u.decim()
if options.waterfall:
self.scope = \
@@ -90,15 +89,13 @@ class app_top_block(stdgui2.std_top_block):
if options.gain is None:
# if no gain was specified, use the mid-point in dB
- #g = self.subdev.gain_range()
- #options.gain = float(g[0]+g[1])/2
- options.gain = 0
+ g = self.u.gain_range()
+ options.gain = float(g[0]+g[1])/2
if options.freq is None:
# if no freq was specified, use the mid-point
- #r = self.subdev.freq_range()
- #options.freq = float(r[0]+r[1])/2
- options.freq = 0
+ r = self.u.freq_range()
+ options.freq = float(r[0]+r[1])/2
self.set_gain(options.gain)
@@ -107,13 +104,13 @@ class app_top_block(stdgui2.std_top_block):
# self.subdev.select_rx_antenna(options.antenna)
if self.show_debug_info:
- self.myform['decim'].set_value(options.decim)
- self.myform['fs@usb'].set_value(100e6/options.decim) #self.u.adc_freq() / self.u.decim_rate())
- #self.myform['dbname'].set_value(self.subdev.name())
+ self.myform['decim'].set_value(self.u.decim())
+ self.myform['fs@gbe'].set_value(input_rate)
+ self.myform['dbname'].set_value("0x%04X" % (self.u.daughterboard_id(),)) # FIXME: add text name
self.myform['baseband'].set_value(0)
self.myform['ddc'].set_value(0)
- if not(self.u.set_center_freq(options.freq)):
+ if not(self.set_freq(options.freq)):
self._set_status_msg("Failed to set initial frequency")
def _set_status_msg(self, msg):
@@ -135,8 +132,10 @@ class app_top_block(stdgui2.std_top_block):
callback=myform.check_input_and_call(_form_set_freq, self._set_status_msg))
hbox.Add((5,0), 0, 0)
- #g = self.subdev.gain_range()
- g = [0, 100, 1] #FIXME
+ g = self.u.gain_range()
+ if self.u.daughterboard_id() == 0x0003: # FIXME: get range right in firmware for TVRX
+ g[1] = 104
+
myform['gain'] = form.slider_field(parent=self.panel, sizer=hbox, label="Gain",
weight=3,
min=int(g[0]), max=int(g[1]),
@@ -174,8 +173,8 @@ class app_top_block(stdgui2.std_top_block):
callback=myform.check_input_and_call(_form_set_decim, self._set_status_msg))
hbox.Add((5,0), 1)
- myform['fs@usb'] = form.static_float_field(
- parent=panel, sizer=hbox, label="Fs@USB")
+ myform['fs@gbe'] = form.static_float_field(
+ parent=panel, sizer=hbox, label="Fs@GbE")
hbox.Add((5,0), 1)
myform['dbname'] = form.static_text_field(
@@ -226,12 +225,11 @@ class app_top_block(stdgui2.std_top_block):
ok = self.u.set_decim(decim)
if not ok:
print "set_decim failed"
- #input_rate = self.u.adc_freq() / self.u.decim_rate()
- input_rate = 100e6/decim # FIXME
+ input_rate = self.u.adc_rate() / self.u.decim()
self.scope.set_sample_rate(input_rate)
if self.show_debug_info: # update displayed values
- self.myform['decim'].set_value(decim) #self.u.decim_rate())
- self.myform['fs@usb'].set_value(input_rate) #self.u.adc_freq() / self.u.decim_rate())
+ self.myform['decim'].set_value(self.u.decim())
+ self.myform['fs@gbe'].set_value(input_rate)
return ok
def _setup_events(self):