From 5977d9006bd7c81a35e347f946e5e7983145ff0c Mon Sep 17 00:00:00 2001 From: Marcus Leech Date: Mon, 20 Feb 2012 17:34:01 -0500 Subject: uhd: updated uhd programs to use stream_args concept from command line for more than just setting the scalar. --- gr-uhd/apps/uhd_fft.py | 7 +++---- gr-uhd/apps/uhd_rx_cfile.py | 9 ++++----- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/gr-uhd/apps/uhd_fft.py b/gr-uhd/apps/uhd_fft.py index 18edc8f86..39ba3838e 100755 --- a/gr-uhd/apps/uhd_fft.py +++ b/gr-uhd/apps/uhd_fft.py @@ -73,8 +73,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 +84,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.py index 718bb80b7..a61361e43 100755 --- a/gr-uhd/apps/uhd_rx_cfile.py +++ b/gr-uhd/apps/uhd_rx_cfile.py @@ -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]") -- cgit