diff options
author | Tom Rondeau | 2012-04-04 22:08:10 -0400 |
---|---|---|
committer | Tom Rondeau | 2012-04-04 22:08:10 -0400 |
commit | a66a650a1f39118500434bc9c91b2ade24887149 (patch) | |
tree | b90b341e42a776432053a54740ca7ce9e7e945e6 /gr-uhd/apps | |
parent | fd52df0f706195d937e287189024f8aa6fbeaf60 (diff) | |
parent | b711a8683c8c4578c7a4ff0f3664f1321da1dcad (diff) | |
download | gnuradio-a66a650a1f39118500434bc9c91b2ade24887149.tar.gz gnuradio-a66a650a1f39118500434bc9c91b2ade24887149.tar.bz2 gnuradio-a66a650a1f39118500434bc9c91b2ade24887149.zip |
Merge branch 'master' of gnuradio.org:gnuradio
Diffstat (limited to 'gr-uhd/apps')
-rwxr-xr-x | gr-uhd/apps/uhd_fft.py | 26 | ||||
-rwxr-xr-x | gr-uhd/apps/uhd_siggen.py | 26 | ||||
-rwxr-xr-x | gr-uhd/apps/uhd_siggen_gui.py | 6 |
3 files changed, 51 insertions, 7 deletions
diff --git a/gr-uhd/apps/uhd_fft.py b/gr-uhd/apps/uhd_fft.py index 18edc8f86..a3858e341 100755 --- a/gr-uhd/apps/uhd_fft.py +++ b/gr-uhd/apps/uhd_fft.py @@ -31,6 +31,7 @@ import numpy try: from gnuradio.wxgui import stdgui2, form, slider + from gnuradio.wxgui import forms from gnuradio.wxgui import fftsink2, waterfallsink2, scopesink2 import wx except ImportError: @@ -195,6 +196,26 @@ class app_top_block(stdgui2.std_top_block): min=int(glow), max=int(ghigh), callback=self.set_gain) + try: + usrp_config_val = "%s (%s), %s (%s, %s, %s)" % (self.u.get_usrp_rx_info().get("mboard_id").split(" ")[0], self.u.get_usrp_rx_info().get("mboard_serial"), + self.u.get_usrp_rx_info().get("rx_id").split(" ")[0].split(",")[0], self.u.get_usrp_rx_info().get("rx_serial"), self.u.get_subdev_spec(), self.u.get_antenna()) + except: + usrp_config_val = "Not implemented in this version." + + uhd_box = forms.static_box_sizer(parent=self.panel, + label="UHD (%s)" % (uhd.get_version_string()), + orient=wx.HORIZONTAL, + bold=True) + usrp_config_form = forms.static_text( + parent=self.panel, + sizer=uhd_box, + value=usrp_config_val, + label="USRP", + converter=forms.str_converter(), + ) + vbox.Add(uhd_box, 0, wx.EXPAND) + vbox.AddSpacer(5) + hbox.Add((5,0), 0, 0) vbox.Add(hbox, 0, wx.EXPAND) @@ -232,8 +253,10 @@ class app_top_block(stdgui2.std_top_block): myform['dspfreq'] = form.static_float_field( parent=panel, sizer=hbox, label="DSP Freq.") - hbox.Add((5,0), 0) + vbox.AddSpacer(5) + vbox.Add(hbox, 0, wx.EXPAND) + vbox.AddSpacer(5) def set_freq(self, target_freq): """ @@ -248,6 +271,7 @@ class app_top_block(stdgui2.std_top_block): self.myform['freq'].set_value(self.u.get_center_freq()) self.myform['rffreq'].set_value(r.actual_rf_freq) self.myform['dspfreq'].set_value(r.actual_dsp_freq) + if not self.options.oscilloscope: self.scope.set_baseband_freq(target_freq) return True diff --git a/gr-uhd/apps/uhd_siggen.py b/gr-uhd/apps/uhd_siggen.py index e1af586ae..ff36b4f4d 100755 --- a/gr-uhd/apps/uhd_siggen.py +++ b/gr-uhd/apps/uhd_siggen.py @@ -107,12 +107,32 @@ class top_block(gr.top_block, pubsub): if(options.antenna): self._u.set_antenna(options.antenna, 0) - self.publish(DESC_KEY, lambda: str(self._u)) + # Setup USRP Configuration value + try: + usrp_info = self._u.get_usrp_tx_info() + usrp_mb = usrp_info.get("mboard_id").split(" ")[0] + usrp_mbs = usrp_info.get("mboard_serial") + usrp_db = usrp_info.get("tx_id").split(" ")[0] + usrp_dbs = usrp_info.get("tx_serial") + usrp_sd = self._u.get_subdev_spec() + usrp_ant = self._u.get_antenna() + + desc_key_str = "Motherboard: %s [%s]\n" % (usrp_mb, usrp_mbs) + desc_key_str += "Daughterboard: %s [%s]\n" % (usrp_db, usrp_dbs) + desc_key_str += "Subdev: %s\n" % usrp_sd + desc_key_str += "Antenna: %s" % usrp_ant + except: + desc_key_str = "USRP configuration output not implemented in this version" + + self.publish(DESC_KEY, lambda: desc_key_str) self.publish(FREQ_RANGE_KEY, self._u.get_freq_range) self.publish(GAIN_RANGE_KEY, self._u.get_gain_range) self.publish(GAIN_KEY, self._u.get_gain) - if self._verbose: - print str(self._u) + + print "UHD Signal Generator" + print "Version: %s" % uhd.get_version_string() + print "\nUsing USRP configuration:" + print desc_key_str + "\n" # Direct asynchronous notifications to callback function if options.show_async_msg: diff --git a/gr-uhd/apps/uhd_siggen_gui.py b/gr-uhd/apps/uhd_siggen_gui.py index 2ef6ea40f..1f6a73c2c 100755 --- a/gr-uhd/apps/uhd_siggen_gui.py +++ b/gr-uhd/apps/uhd_siggen_gui.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2009,2011 Free Software Foundation, Inc. +# Copyright 2009,2011,2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -21,7 +21,7 @@ # import wx -from gnuradio import gr +from gnuradio import gr, uhd from gnuradio.gr.pubsub import pubsub from gnuradio.wxgui import gui, forms import uhd_siggen @@ -269,7 +269,7 @@ class app_gui(pubsub): # UHD status ################################################## u2_hbox = forms.static_box_sizer(parent=self.panel, - label="UHD Status", + label="UHD (%s)" % (uhd.get_version_string()), orient=wx.HORIZONTAL, bold=True) self.vbox.Add(u2_hbox, 0, wx.EXPAND) |