commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] r6352 - in gnuradio/branches/developers/jcorgan/t162:


From: jcorgan
Subject: [Commit-gnuradio] r6352 - in gnuradio/branches/developers/jcorgan/t162: gnuradio-core/src/python/gnuradio/blks2impl gnuradio-examples/python/digital
Date: Fri, 7 Sep 2007 11:47:53 -0600 (MDT)

Author: jcorgan
Date: 2007-09-07 11:47:53 -0600 (Fri, 07 Sep 2007)
New Revision: 6352

Modified:
   
gnuradio/branches/developers/jcorgan/t162/gnuradio-core/src/python/gnuradio/blks2impl/gmsk.py
   
gnuradio/branches/developers/jcorgan/t162/gnuradio-examples/python/digital/benchmark_rx.py
   
gnuradio/branches/developers/jcorgan/t162/gnuradio-examples/python/digital/receive_path.py
Log:
Converted benchmark_rx.py to new top block code.

Modified: 
gnuradio/branches/developers/jcorgan/t162/gnuradio-core/src/python/gnuradio/blks2impl/gmsk.py
===================================================================
--- 
gnuradio/branches/developers/jcorgan/t162/gnuradio-core/src/python/gnuradio/blks2impl/gmsk.py
       2007-09-07 17:40:15 UTC (rev 6351)
+++ 
gnuradio/branches/developers/jcorgan/t162/gnuradio-core/src/python/gnuradio/blks2impl/gmsk.py
       2007-09-07 17:47:53 UTC (rev 6352)
@@ -234,7 +234,7 @@
             self._setup_logging()
 
        # Connect & Initialize base class
-       self._fg.connect(self, self.fmdemod, self.clock_recovery, self.slicer, 
self)
+       self.connect(self, self.fmdemod, self.clock_recovery, self.slicer, self)
 
     def samples_per_symbol(self):
         return self._samples_per_symbol

Modified: 
gnuradio/branches/developers/jcorgan/t162/gnuradio-examples/python/digital/benchmark_rx.py
===================================================================
--- 
gnuradio/branches/developers/jcorgan/t162/gnuradio-examples/python/digital/benchmark_rx.py
  2007-09-07 17:40:15 UTC (rev 6351)
+++ 
gnuradio/branches/developers/jcorgan/t162/gnuradio-examples/python/digital/benchmark_rx.py
  2007-09-07 17:47:53 UTC (rev 6352)
@@ -39,12 +39,6 @@
 #raw_input('Attach and press enter: ')
 
 
-class my_graph(gr.flow_graph):
-
-    def __init__(self, demod_class, rx_callback, options):
-        gr.flow_graph.__init__(self)
-        self.rxpath = receive_path(self, demod_class, rx_callback, options)
-
 # /////////////////////////////////////////////////////////////////////////////
 #                                   main
 # /////////////////////////////////////////////////////////////////////////////
@@ -98,14 +92,14 @@
 
 
     # build the graph
-    fg = my_graph(demods[options.modulation], rx_callback, options)
+    tb = receive_path(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:

Modified: 
gnuradio/branches/developers/jcorgan/t162/gnuradio-examples/python/digital/receive_path.py
===================================================================
--- 
gnuradio/branches/developers/jcorgan/t162/gnuradio-examples/python/digital/receive_path.py
  2007-09-07 17:40:15 UTC (rev 6351)
+++ 
gnuradio/branches/developers/jcorgan/t162/gnuradio-examples/python/digital/receive_path.py
  2007-09-07 17:47:53 UTC (rev 6352)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2005,2006 Free Software Foundation, Inc.
+# Copyright 2005,2006,2007 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -20,7 +20,7 @@
 # Boston, MA 02110-1301, USA.
 # 
 
-from gnuradio import gr, gru, blks
+from gnuradio import gr, gru, blks2
 from gnuradio import usrp
 from gnuradio import eng_notation
 import copy
@@ -33,9 +33,11 @@
 #                              receive path
 # /////////////////////////////////////////////////////////////////////////////
 
-class receive_path(gr.hier_block):
-    def __init__(self, fg, demod_class, rx_callback, options):
+class receive_path(gr.top_block):
+    def __init__(self, demod_class, rx_callback, options):
 
+       gr.top_block.__init__(self, "receive_path")
+
         options = copy.copy(options)    # make a copy so we can destructively 
modify
 
         self._verbose            = options.verbose
@@ -96,11 +98,10 @@
 
         # receiver
         self.packet_receiver = \
-            blks.demod_pkts(fg,
-                            self._demod_class(fg, **demod_kwargs),
-                            access_code=None,
-                            callback=self._rx_callback,
-                            threshold=-1)
+            blks2.demod_pkts(self._demod_class(**demod_kwargs),
+                             access_code=None,
+                             callback=self._rx_callback,
+                             threshold=-1)
     
         # Carrier Sensing Blocks
         alpha = 0.001
@@ -109,17 +110,16 @@
         if options.log_rx_power == True:
             self.probe = gr.probe_avg_mag_sqrd_cf(thresh,alpha)
             self.power_sink = gr.file_sink(gr.sizeof_float, "rxpower.dat")
-            fg.connect(self.chan_filt, self.probe, self.power_sink)
+            self.connect(self.chan_filt, self.probe, self.power_sink)
         else:
             self.probe = gr.probe_avg_mag_sqrd_c(thresh,alpha)
-            fg.connect(self.chan_filt, self.probe)
+            self.connect(self.chan_filt, self.probe)
 
         # Display some information about the setup
         if self._verbose:
             self._print_verbage()
             
-        fg.connect(self.u, self.chan_filt, self.packet_receiver)
-        gr.hier_block.__init__(self, fg, None, None)
+        self.connect(self.u, self.chan_filt, self.packet_receiver)
 
     def _setup_usrp_source(self):
         self.u = usrp.source_c (fusb_block_size=self._fusb_block_size,





reply via email to

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