diff options
Diffstat (limited to 'gr-uhd/apps')
-rw-r--r-- | gr-uhd/apps/.gitignore | 3 | ||||
-rw-r--r-- | gr-uhd/apps/CMakeLists.txt | 17 | ||||
-rw-r--r-- | gr-uhd/apps/Makefile.am | 36 | ||||
-rw-r--r-- | gr-uhd/apps/hf_explorer/.gitignore | 3 | ||||
-rw-r--r-- | gr-uhd/apps/hf_explorer/Makefile.am | 31 | ||||
-rw-r--r-- | gr-uhd/apps/hf_radio/.gitignore | 3 | ||||
-rw-r--r-- | gr-uhd/apps/hf_radio/Makefile.am | 39 | ||||
-rwxr-xr-x | gr-uhd/apps/uhd_fft (renamed from gr-uhd/apps/uhd_fft.py) | 7 | ||||
-rwxr-xr-x | gr-uhd/apps/uhd_rx_cfile (renamed from gr-uhd/apps/uhd_rx_cfile.py) | 9 | ||||
-rwxr-xr-x | gr-uhd/apps/uhd_rx_nogui (renamed from gr-uhd/apps/uhd_rx_nogui.py) | 0 | ||||
-rwxr-xr-x | gr-uhd/apps/uhd_siggen | 51 | ||||
-rw-r--r--[-rwxr-xr-x] | gr-uhd/apps/uhd_siggen_base.py (renamed from gr-uhd/apps/uhd_siggen.py) | 4 | ||||
-rwxr-xr-x | gr-uhd/apps/uhd_siggen_gui (renamed from gr-uhd/apps/uhd_siggen_gui.py) | 2 |
13 files changed, 73 insertions, 132 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 2f2b0ebfa..0267ce46f 100755 --- a/gr-uhd/apps/uhd_fft.py +++ b/gr-uhd/apps/uhd_fft @@ -74,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() @@ -85,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): 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 add8d1bf3..3c16440ab 100755..100644 --- a/gr-uhd/apps/uhd_siggen.py +++ b/gr-uhd/apps/uhd_siggen_base.py @@ -368,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" @@ -392,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 1f6a73c2c..7e0fdc041 100755 --- a/gr-uhd/apps/uhd_siggen_gui.py +++ b/gr-uhd/apps/uhd_siggen_gui @@ -24,7 +24,7 @@ import wx 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): |