commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] r4221 - gnuradio/branches/developers/trondeau/digital-


From: trondeau
Subject: [Commit-gnuradio] r4221 - gnuradio/branches/developers/trondeau/digital-wip2/gnuradio-examples/python/hier/digital
Date: Tue, 2 Jan 2007 17:00:09 -0700 (MST)

Author: trondeau
Date: 2007-01-02 17:00:09 -0700 (Tue, 02 Jan 2007)
New Revision: 4221

Modified:
   
gnuradio/branches/developers/trondeau/digital-wip2/gnuradio-examples/python/hier/digital/benchmark_rx.py
   
gnuradio/branches/developers/trondeau/digital-wip2/gnuradio-examples/python/hier/digital/benchmark_tx.py
Log:
these should be ready to work with the USRP, but there's a problem (I think 
with the hier_block2's handling of it)

Modified: 
gnuradio/branches/developers/trondeau/digital-wip2/gnuradio-examples/python/hier/digital/benchmark_rx.py
===================================================================
--- 
gnuradio/branches/developers/trondeau/digital-wip2/gnuradio-examples/python/hier/digital/benchmark_rx.py
    2007-01-02 23:58:25 UTC (rev 4220)
+++ 
gnuradio/branches/developers/trondeau/digital-wip2/gnuradio-examples/python/hier/digital/benchmark_rx.py
    2007-01-03 00:00:09 UTC (rev 4221)
@@ -39,12 +39,15 @@
 #raw_input('Attach and press enter: ')
 
 
-class my_graph(gr.flow_graph):
-
+class my_graph(gr.hier_block2):
     def __init__(self, demod_class, rx_callback, options):
-        gr.flow_graph.__init__(self)
-        self.rxpath = receive_path(self, demod_class, rx_callback, options)
+        gr.hier_block2.__init__(self, "my_graph",
+                                gr.io_signature(0,0,0), # Input signature
+                                gr.io_signature(0,0,0)) # Output signature
+        self.rxpath = receive_path(demod_class, rx_callback, options)
+        self.define_component("rxpath", self.rxpath)
 
+
 # /////////////////////////////////////////////////////////////////////////////
 #                                   main
 # /////////////////////////////////////////////////////////////////////////////
@@ -96,17 +99,19 @@
         parser.print_help(sys.stderr)
         sys.exit(1)
 
-
-    # build the graph
-    fg = my_graph(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
+    # Create an instance of a hierarchical block
+    top_block = my_graph(demods[options.modulation], rx_callback, options)
+    
+    # Create an instance of a runtime, passing it the top block
+    runtime = gr.runtime(top_block)
+    runtime.start()
 
+    runtime.wait()         # wait for it to finish
+
 if __name__ == '__main__':
     try:
         main()

Modified: 
gnuradio/branches/developers/trondeau/digital-wip2/gnuradio-examples/python/hier/digital/benchmark_tx.py
===================================================================
--- 
gnuradio/branches/developers/trondeau/digital-wip2/gnuradio-examples/python/hier/digital/benchmark_tx.py
    2007-01-02 23:58:25 UTC (rev 4220)
+++ 
gnuradio/branches/developers/trondeau/digital-wip2/gnuradio-examples/python/hier/digital/benchmark_tx.py
    2007-01-03 00:00:09 UTC (rev 4221)
@@ -91,17 +91,17 @@
         parser.print_help(sys.stderr)
         sys.exit(1)
 
+    r = gr.enable_realtime_scheduling()
+    if r != gr.RT_OK:
+        print "Warning: failed to enable realtime scheduling"
+
     # Create an instance of a hierarchical block
-    top_block = my_graph(mods[options.modulation], options)
+    top_block = my_graph(demods[options.modulation], options)
     
     # Create an instance of a runtime, passing it the top block
     runtime = gr.runtime(top_block)
     runtime.start()
 
-    r = gr.enable_realtime_scheduling()
-    if r != gr.RT_OK:
-        print "Warning: failed to enable realtime scheduling"
-
     # generate and send packets
     nbytes = int(1e6 * options.megabytes)
     n = 0





reply via email to

[Prev in Thread] Current Thread [Next in Thread]