X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=gnuradio-examples%2Fpython%2Fdigital%2Fbenchmark_rx.py;h=ccb0c896338c928cac63474297d4ed379be4b08e;hb=ea29b08aeb54227e6628f655ccfdb96fe4d8c378;hp=26ccdac4776e030ff522b09820ddf139b690966f;hpb=18a684bf3dc144c48fc4cc6cc72f5070febd8074;p=debian%2Fgnuradio diff --git a/gnuradio-examples/python/digital/benchmark_rx.py b/gnuradio-examples/python/digital/benchmark_rx.py index 26ccdac4..ccb0c896 100755 --- a/gnuradio-examples/python/digital/benchmark_rx.py +++ b/gnuradio-examples/python/digital/benchmark_rx.py @@ -1,12 +1,12 @@ #!/usr/bin/env python # -# Copyright 2005,2006 Free Software Foundation, Inc. +# Copyright 2005,2006,2007,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 2, or (at your option) +# 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, @@ -31,19 +31,20 @@ import struct import sys # from current dir -from receive_path import receive_path -import fusb_options +import usrp_receive_path #import os #print os.getpid() #raw_input('Attach and press enter: ') +class my_top_block(gr.top_block): + def __init__(self, demodulator, rx_callback, options): + gr.top_block.__init__(self) -class my_graph(gr.flow_graph): + # Set up receive path + self.rxpath = usrp_receive_path.usrp_receive_path(demodulator, rx_callback, options) - def __init__(self, demod_class, rx_callback, options): - gr.flow_graph.__init__(self) - self.rxpath = receive_path(self, demod_class, rx_callback, options) + self.connect(self.rxpath) # ///////////////////////////////////////////////////////////////////////////// # main @@ -79,12 +80,11 @@ def main(): help="Select modulation from: %s [default=%%default]" % (', '.join(demods.keys()),)) - receive_path.add_options(parser, expert_grp) + usrp_receive_path.add_options(parser, expert_grp) for mod in demods.values(): mod.add_options(expert_grp) - fusb_options.add_options(expert_grp) (options, args) = parser.parse_args () if len(args) != 0: @@ -98,14 +98,14 @@ def main(): # build the graph - fg = my_graph(demods[options.modulation], rx_callback, options) + tb = my_top_block(demods[options.modulation], rx_callback, options) r = gr.enable_realtime_scheduling() if r != gr.RT_OK: print "Warning: Failed to enable realtime scheduling." - fg.start() # start flow graph - fg.wait() # wait for it to finish + tb.start() # start flow graph + tb.wait() # wait for it to finish if __name__ == '__main__': try: