summaryrefslogtreecommitdiff
path: root/gr-uhd/apps
diff options
context:
space:
mode:
Diffstat (limited to 'gr-uhd/apps')
-rw-r--r--gr-uhd/apps/.gitignore3
-rw-r--r--gr-uhd/apps/CMakeLists.txt17
-rw-r--r--gr-uhd/apps/Makefile.am36
-rw-r--r--gr-uhd/apps/hf_explorer/.gitignore3
-rw-r--r--gr-uhd/apps/hf_explorer/Makefile.am31
-rw-r--r--gr-uhd/apps/hf_radio/.gitignore3
-rw-r--r--gr-uhd/apps/hf_radio/Makefile.am39
-rwxr-xr-xgr-uhd/apps/uhd_fft (renamed from gr-uhd/apps/uhd_fft.py)42
-rwxr-xr-xgr-uhd/apps/uhd_rx_cfile (renamed from gr-uhd/apps/uhd_rx_cfile.py)9
-rwxr-xr-xgr-uhd/apps/uhd_rx_nogui (renamed from gr-uhd/apps/uhd_rx_nogui.py)0
-rwxr-xr-xgr-uhd/apps/uhd_siggen51
-rw-r--r--[-rwxr-xr-x]gr-uhd/apps/uhd_siggen_base.py (renamed from gr-uhd/apps/uhd_siggen.py)34
-rwxr-xr-xgr-uhd/apps/uhd_siggen_gui (renamed from gr-uhd/apps/uhd_siggen_gui.py)8
13 files changed, 137 insertions, 139 deletions
diff --git a/gr-uhd/apps/.gitignore b/gr-uhd/apps/.gitignore
deleted file mode 100644
index 22a4e7292..000000000
--- a/gr-uhd/apps/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-Makefile
-Makefile.in
-
diff --git a/gr-uhd/apps/CMakeLists.txt b/gr-uhd/apps/CMakeLists.txt
index 20ae8993f..1d68c00ac 100644
--- a/gr-uhd/apps/CMakeLists.txt
+++ b/gr-uhd/apps/CMakeLists.txt
@@ -23,12 +23,19 @@ include(GrPython)
# Install some uhd apps
########################################################################
GR_PYTHON_INSTALL(
+ FILES
+ uhd_siggen_base.py
+ DESTINATION ${GR_PYTHON_DIR}/gnuradio/uhd
+ COMPONENT "uhd_python"
+)
+
+GR_PYTHON_INSTALL(
PROGRAMS
- uhd_fft.py
- uhd_rx_cfile.py
- uhd_siggen.py
- uhd_siggen_gui.py
- uhd_rx_nogui.py
+ uhd_fft
+ uhd_rx_cfile
+ uhd_siggen
+ uhd_siggen_gui
+ uhd_rx_nogui
DESTINATION ${GR_RUNTIME_DIR}
COMPONENT "uhd_python"
)
diff --git a/gr-uhd/apps/Makefile.am b/gr-uhd/apps/Makefile.am
deleted file mode 100644
index c30a143c2..000000000
--- a/gr-uhd/apps/Makefile.am
+++ /dev/null
@@ -1,36 +0,0 @@
-#
-# Copyright 2011 Free Software Foundation, Inc.
-#
-# This file is part of GNU Radio
-#
-# GNU Radio is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3, or (at your option)
-# any later version.
-#
-# GNU Radio is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with GNU Radio; see the file COPYING. If not, write to
-# the Free Software Foundation, Inc., 51 Franklin Street,
-# Boston, MA 02110-1301, USA.
-#
-
-include $(top_srcdir)/Makefile.common
-
-EXTRA_DIST += \
- $(bin_SCRIPTS)
-
-SUBDIRS = hf_explorer hf_radio
-
-ourpythondir = $(grpythondir)
-
-bin_SCRIPTS = \
- uhd_fft.py \
- uhd_rx_cfile.py \
- uhd_siggen.py \
- uhd_siggen_gui.py \
- uhd_rx_nogui.py
diff --git a/gr-uhd/apps/hf_explorer/.gitignore b/gr-uhd/apps/hf_explorer/.gitignore
deleted file mode 100644
index b6950912c..000000000
--- a/gr-uhd/apps/hf_explorer/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-/Makefile
-/Makefile.in
-/*.pyc
diff --git a/gr-uhd/apps/hf_explorer/Makefile.am b/gr-uhd/apps/hf_explorer/Makefile.am
deleted file mode 100644
index c8e7ecb25..000000000
--- a/gr-uhd/apps/hf_explorer/Makefile.am
+++ /dev/null
@@ -1,31 +0,0 @@
-#
-# Copyright 2006,2009 Free Software Foundation, Inc.
-#
-# This file is part of GNU Radio
-#
-# GNU Radio is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3, or (at your option)
-# any later version.
-#
-# GNU Radio is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with GNU Radio; see the file COPYING. If not, write to
-# the Free Software Foundation, Inc., 51 Franklin Street,
-# Boston, MA 02110-1301, USA.
-#
-
-include $(top_srcdir)/Makefile.common
-
-ourdatadir = $(exampledir)/hf_explorer
-
-dist_ourdata_DATA = \
- README \
- hfx_help
-
-dist_ourdata_SCRIPTS = \
- hfx.py
diff --git a/gr-uhd/apps/hf_radio/.gitignore b/gr-uhd/apps/hf_radio/.gitignore
deleted file mode 100644
index b6950912c..000000000
--- a/gr-uhd/apps/hf_radio/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-/Makefile
-/Makefile.in
-/*.pyc
diff --git a/gr-uhd/apps/hf_radio/Makefile.am b/gr-uhd/apps/hf_radio/Makefile.am
deleted file mode 100644
index e514076f6..000000000
--- a/gr-uhd/apps/hf_radio/Makefile.am
+++ /dev/null
@@ -1,39 +0,0 @@
-#
-# Copyright 2006,2009 Free Software Foundation, Inc.
-#
-# This file is part of GNU Radio
-#
-# GNU Radio is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3, or (at your option)
-# any later version.
-#
-# GNU Radio is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with GNU Radio; see the file COPYING. If not, write to
-# the Free Software Foundation, Inc., 51 Franklin Street,
-# Boston, MA 02110-1301, USA.
-#
-
-include $(top_srcdir)/Makefile.common
-
-ourdatadir = $(exampledir)/hf_radio
-
-dist_ourdata_DATA = \
- hfir.sci \
- radio.xml \
- input.py \
- output.py \
- README.TXT \
- ssbagc.py \
- ssbdemod.py \
- startup.py \
- ssb_taps
-
-dist_ourdata_SCRIPTS = \
- radio.py \
- ui.py
diff --git a/gr-uhd/apps/uhd_fft.py b/gr-uhd/apps/uhd_fft
index 18edc8f86..0267ce46f 100755
--- a/gr-uhd/apps/uhd_fft.py
+++ b/gr-uhd/apps/uhd_fft
@@ -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:
@@ -73,8 +74,8 @@ class app_top_block(stdgui2.std_top_block):
help="Set FFT update rate, [default=%default]")
parser.add_option("", "--wire-format", type="string", default="sc16",
help="Set wire format from USRP [default=%default]")
- parser.add_option("", "--scalar", type="int", default=1024,
- help="Set scalar multiplier value sc8 wire format [default=%default]")
+ parser.add_option("", "--stream-args", type="string", default="",
+ help="Set additional stream args [default=%default]")
parser.add_option("", "--show-async-msg", action="store_true", default=False,
help="Show asynchronous message notifications from UHD [default=%default]")
(options, args) = parser.parse_args()
@@ -84,10 +85,9 @@ class app_top_block(stdgui2.std_top_block):
self.options = options
self.show_debug_info = True
- scalar="scalar="+str(options.scalar)
self.u = uhd.usrp_source(device_addr=options.args,
stream_args=uhd.stream_args(cpu_format='fc32',
- otw_format=options.wire_format, args=scalar))
+ otw_format=options.wire_format, args=options.stream_args))
# Set the subdevice spec
if(options.spec):
@@ -195,6 +195,35 @@ class app_top_block(stdgui2.std_top_block):
min=int(glow), max=int(ghigh),
callback=self.set_gain)
+ try:
+ mboard_id = self.u.get_usrp_info().get("mboard_id").split(" ")[0]
+ mboard_serial = self.u.get_usrp_info().get("mboard_serial")
+ if mboard_serial == "":
+ mboard_serial = "no serial"
+ dboard_id = self.u.get_usrp_info().get("rx_id").split(" ")[0].split(",")[0]
+ dboard_serial = self.u.get_usrp_info().get("rx_serial")
+ if dboard_serial == "":
+ dboard_serial = "no serial"
+ subdev = self.u.get_subdev_spec()
+ antenna = self.u.get_antenna()
+
+ usrp_config_val = "%s (%s), %s (%s, %s, %s)" % (mboard_id, mboard_serial, dboard_id, dboard_serial, subdev, 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)
+ 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 +261,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 +279,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_rx_cfile.py b/gr-uhd/apps/uhd_rx_cfile
index 718bb80b7..a61361e43 100755
--- a/gr-uhd/apps/uhd_rx_cfile.py
+++ b/gr-uhd/apps/uhd_rx_cfile
@@ -39,15 +39,14 @@ class rx_cfile_block(gr.top_block):
def __init__(self, options, filename):
gr.top_block.__init__(self)
- scalar="scalar="+str(options.scalar)
# Create a UHD device source
if options.output_shorts:
self._u = uhd.usrp_source(device_addr=options.args, stream_args=uhd.stream_args('sc16',
- options.wire_format, args=scalar))
+ options.wire_format, args=options.stream_args))
self._sink = gr.file_sink(gr.sizeof_short*2, filename)
else:
self._u = uhd.usrp_source(device_addr=options.args, stream_args=uhd.stream_args('fc32',
- options.wire_format, args=scalar))
+ options.wire_format, args=options.stream_args))
self._sink = gr.file_sink(gr.sizeof_gr_complex, filename)
# Set the subdevice spec
@@ -143,8 +142,8 @@ def get_options():
help="set daughterboard LO offset to OFFSET [default=hw default]")
parser.add_option("", "--wire-format", type="string", default="sc16",
help="set wire format from USRP [default=%default")
- parser.add_option("", "--scalar", type="int", default=1024,
- help="set scalar multiplier value for sc8 wire format [default=%default]")
+ parser.add_option("", "--stream-args", type="string", default="",
+ help="set stream arguments [default=%default]")
parser.add_option("", "--show-async-msg", action="store_true", default=False,
help="Show asynchronous message notifications from UHD [default=%default]")
diff --git a/gr-uhd/apps/uhd_rx_nogui.py b/gr-uhd/apps/uhd_rx_nogui
index bcb52c619..bcb52c619 100755
--- a/gr-uhd/apps/uhd_rx_nogui.py
+++ b/gr-uhd/apps/uhd_rx_nogui
diff --git a/gr-uhd/apps/uhd_siggen b/gr-uhd/apps/uhd_siggen
new file mode 100755
index 000000000..26e0d79a4
--- /dev/null
+++ b/gr-uhd/apps/uhd_siggen
@@ -0,0 +1,51 @@
+#!/usr/bin/env python
+#
+# Copyright 2008,2009,2011,2012 Free Software Foundation, Inc.
+#
+# This file is part of GNU Radio
+#
+# GNU Radio is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# GNU Radio is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Radio; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street,
+# Boston, MA 02110-1301, USA.
+#
+
+from gnuradio import gr
+from gnuradio.uhd import uhd_siggen_base as uhd_siggen
+import sys
+
+def main():
+ if gr.enable_realtime_scheduling() != gr.RT_OK:
+ print "Note: failed to enable realtime scheduling, continuing"
+
+ # Grab command line options and create top block
+ try:
+ (options, args) = uhd_siggen.get_options()
+ tb = uhd_siggen.top_block(options, args)
+
+ except RuntimeError, e:
+ print e
+ sys.exit(1)
+
+ tb.start()
+ raw_input('Press Enter to quit: ')
+ tb.stop()
+ tb.wait()
+
+# Make sure to create the top block (tb) within a function:
+# That code in main will allow tb to go out of scope on return,
+# which will call the decontructor on usrp and stop transmit.
+# Whats odd is that grc works fine with tb in the __main__,
+# perhaps its because the try/except clauses around tb.
+if __name__ == "__main__":
+ main()
diff --git a/gr-uhd/apps/uhd_siggen.py b/gr-uhd/apps/uhd_siggen_base.py
index e1af586ae..3c16440ab 100755..100644
--- a/gr-uhd/apps/uhd_siggen.py
+++ b/gr-uhd/apps/uhd_siggen_base.py
@@ -107,12 +107,36 @@ 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_info()
+ mboard_id = usrp_info.get("mboard_id").split(" ")[0]
+ mboard_serial = usrp_info.get("mboard_serial")
+ if mboard_serial == "":
+ mboard_serial = "no serial"
+ dboard_id = usrp_info.get("tx_id").split(" ")[0].split(",")[0]
+ dboard_serial = usrp_info.get("tx_serial")
+ if dboard_serial == "":
+ dboard_serial = "no serial"
+ subdev = self._u.get_subdev_spec()
+ antenna = self._u.get_antenna()
+
+ desc_key_str = "Motherboard: %s [%s]\n" % (mboard_id, mboard_serial)
+ desc_key_str += "Daughterboard: %s [%s]\n" % (dboard_id, dboard_serial)
+ desc_key_str += "Subdev: %s\n" % subdev
+ desc_key_str += "Antenna: %s" % antenna
+ 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:
@@ -344,7 +368,7 @@ def get_options():
# If this script is executed, the following runs. If it is imported,
# the below does not run.
-def main():
+def test_main():
if gr.enable_realtime_scheduling() != gr.RT_OK:
print "Note: failed to enable realtime scheduling, continuing"
@@ -368,4 +392,4 @@ def main():
# Whats odd is that grc works fine with tb in the __main__,
# perhaps its because the try/except clauses around tb.
if __name__ == "__main__":
- main()
+ test_main()
diff --git a/gr-uhd/apps/uhd_siggen_gui.py b/gr-uhd/apps/uhd_siggen_gui
index 2ef6ea40f..7e0fdc041 100755
--- a/gr-uhd/apps/uhd_siggen_gui.py
+++ b/gr-uhd/apps/uhd_siggen_gui
@@ -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,10 +21,10 @@
#
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
+from gnuradio.uhd import uhd_siggen_base as uhd_siggen
import sys, math
class app_gui(pubsub):
@@ -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)