Implements ticket:208
authorjcorgan <jcorgan@221aa14e-8319-0410-a670-987f0aec2ac5>
Tue, 27 Nov 2007 20:06:08 +0000 (20:06 +0000)
committerjcorgan <jcorgan@221aa14e-8319-0410-a670-987f0aec2ac5>
Tue, 27 Nov 2007 20:06:08 +0000 (20:06 +0000)
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@7045 221aa14e-8319-0410-a670-987f0aec2ac5

13 files changed:
gr-comedi/src/qa_comedi.py
gr-gsm-fr-vocoder/src/python/encdec.py
gr-gsm-fr-vocoder/src/python/qa_gsm_full_rate.py
gr-pager/src/qa_pager.py
gr-radio-astronomy/src/python/qa_ra.py
gr-radio-astronomy/src/python/ra_fftsink.py
gr-radio-astronomy/src/python/ra_stripchartsink.py
gr-radio-astronomy/src/python/ra_waterfallsink.py
gr-radio-astronomy/src/python/usrp_psr_receiver.py
gr-radio-astronomy/src/python/usrp_ra_receiver.py
gr-sounder/src/python/sounder.py
gr-usrp/src/qa_usrp.py
gr-video-sdl/src/qa_video_sdl.py

index 9f62eb47afe95070be5d889a36219a27240d843b..e690dfa19877177bec6de931cb92b98724de2a82 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2005 Free Software Foundation, Inc.
+# Copyright 2005,2007 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -26,10 +26,10 @@ import comedi
 class qa_comedi (gr_unittest.TestCase):
 
     def setUp (self):
-        self.fg = gr.flow_graph ()
+        self.tb = gr.top_block ()
 
     def tearDown (self):
-        self.fg = None
+        self.tb = None
 
     def test_000_nop (self):
         """Just see if we can import the module...
index 1a976ee7f7168e96038cba26c381e4761aa44719..94e4e5b823af26224a3d0cbad9af047a2e85d117 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2005 Free Software Foundation, Inc.
+# Copyright 2005,2007 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -25,7 +25,7 @@ from gnuradio import audio
 from gnuradio.vocoder import gsm_full_rate
 
 def build_graph():
-    fg = gr.flow_graph()
+    tb = gr.top_block()
     src = audio.source(8000)
     src_scale = gr.multiply_const_ff(32767)
     f2s = gr.float_to_short ()
@@ -34,11 +34,11 @@ def build_graph():
     s2f = gr.short_to_float ()
     sink_scale = gr.multiply_const_ff(1.0/32767.)
     sink = audio.sink(8000)
-    fg.connect(src, src_scale, f2s, enc, dec, s2f, sink_scale, sink)
-    return fg
+    tb.connect(src, src_scale, f2s, enc, dec, s2f, sink_scale, sink)
+    return tb
 
 if __name__ == '__main__':
-    fg = build_graph()
-    fg.start()
+    tb = build_graph()
+    tb.start()
     raw_input ('Press Enter to exit: ')
-    fg.stop()
+    tb.stop()
index d470584ad7450ebccc274786347aee80b1203284..ac508407288ef2ecfa4db2b81bc5be5685edc064 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2004 Free Software Foundation, Inc.
+# Copyright 2004,2007 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -26,10 +26,10 @@ import gsm_full_rate
 class qa_howto (gr_unittest.TestCase):
 
     def setUp (self):
-        self.fg = gr.flow_graph ()
+        self.tb = gr.top_block ()
 
     def tearDown (self):
-        self.fg = None
+        self.tb = None
 
 if __name__ == '__main__':
     gr_unittest.main ()
index 7609c1ccd0ed831d28bfbe4e82fda535e12deb3d..5bf72b5613d625cc3209b6041b03595c99ee41ae 100755 (executable)
@@ -26,10 +26,10 @@ import pager_swig
 class qa_pgr(gr_unittest.TestCase):
 
     def setUp (self):
-        self.fg = gr.flow_graph ()
+        self.tb = gr.top_block ()
 
     def tearDown (self):
-        self.fg = None
+        self.tb = None
 
 if __name__ == '__main__':
     gr_unittest.main ()
index 687a75c6a2d8d576c125c27f5fb72e3242bd003e..1c44e23adaeb8445091c5dfedfcabeb0a92099c1 100755 (executable)
@@ -26,10 +26,10 @@ import ra
 class qa_ra (gr_unittest.TestCase):
 
     def setUp (self):
-        self.fg = gr.flow_graph ()
+        self.tb = gr.top_block ()
 
     def tearDown (self):
-        self.fg = None
+        self.tb = None
 
     def test_000_(self):          # ensure that we can load the module
         pass
index f654864180929302ad5e1c7f977c9a7519dc63b5..aa2624b898f011e0ee74a8d8e8d198a7aea2706b 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2003,2004,2005 Free Software Foundation, Inc.
+# Copyright 2003,2004,2005,2007 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -21,7 +21,7 @@
 # 
 
 from gnuradio import gr, gru, window
-from gnuradio.wxgui import stdgui
+from gnuradio.wxgui import stdgui2
 import wx
 import gnuradio.wxgui.plot as plot
 import numpy
@@ -94,12 +94,16 @@ class ra_fft_sink_base(object):
         self.baseband_freq = baseband_freq
         
 
-class ra_fft_sink_f(gr.hier_block, ra_fft_sink_base):
-    def __init__(self, fg, parent, baseband_freq=0,
-                 y_per_div=10, sc_y_per_div=0.5, sc_ref_level=40, ref_level=50,                  sample_rate=1, fft_size=512,
+class ra_fft_sink_f(gr.hier_block2, ra_fft_sink_base):
+    def __init__(self, parent, baseband_freq=0,
+                 y_per_div=10, sc_y_per_div=0.5, sc_ref_level=40, ref_level=50, sample_rate=1, fft_size=512,
                  fft_rate=15, average=False, avg_alpha=None, title='',
                  size=default_ra_fftsink_size, peak_hold=False, ofunc=None,
                  xydfunc=None):
+       gr.hier_block2.__init__(self, "ra_fft_sink_f",
+                               gr.io_signature(1, 1, gr.sizeof_float),
+                               gr.io_signature(0, 0, 0))
+                               
         ra_fft_sink_base.__init__(self, input_is_real=True, baseband_freq=baseband_freq,
                                y_per_div=y_per_div, sc_y_per_div=sc_y_per_div,
                                sc_ref_level=sc_ref_level, ref_level=ref_level,
@@ -120,19 +124,23 @@ class ra_fft_sink_f(gr.hier_block, ra_fft_sink_base):
         log = gr.nlog10_ff(20, fft_size, -20*math.log10(fft_size))
         sink = gr.message_sink(gr.sizeof_float * fft_size, self.msgq, True)
 
-        fg.connect (s2p, one_in_n, fft, c2mag, self.avg, log, sink)
-        gr.hier_block.__init__(self, fg, s2p, sink)
+        self.connect (self, s2p, one_in_n, fft, c2mag, self.avg, log, sink)
 
         self.win = fft_window(self, parent, size=size)
         self.set_average(self.average)
 
-class ra_fft_sink_c(gr.hier_block, ra_fft_sink_base):
-    def __init__(self, fg, parent, baseband_freq=0,
+class ra_fft_sink_c(gr.hier_block2, ra_fft_sink_base):
+    def __init__(self, parent, baseband_freq=0,
                  y_per_div=10, sc_y_per_div=0.5, sc_ref_level=40,
                  ref_level=50, sample_rate=1, fft_size=512,
                  fft_rate=15, average=False, avg_alpha=None, title='',
                  size=default_ra_fftsink_size, peak_hold=False, ofunc=None, xydfunc=None):
 
+       gr.hier_block2.__init__(self, "ra_fft_sink_c",
+                               gr.io_signature(1, 1, gr.sizeof_gr_complex),
+                               gr.io_signature(0, 0, 0))
+                               
+
         ra_fft_sink_base.__init__(self, input_is_real=False, baseband_freq=baseband_freq,
                                y_per_div=y_per_div, sc_y_per_div=sc_y_per_div,
                                sc_ref_level=sc_ref_level, ref_level=ref_level,
@@ -153,8 +161,7 @@ class ra_fft_sink_c(gr.hier_block, ra_fft_sink_base):
         log = gr.nlog10_ff(20, fft_size, -20*math.log10(fft_size))
         sink = gr.message_sink(gr.sizeof_float * fft_size, self.msgq, True)
 
-        fg.connect(s2p, one_in_n, fft, c2mag, self.avg, log, sink)
-        gr.hier_block.__init__(self, fg, s2p, sink)
+        self.connect(self, s2p, one_in_n, fft, c2mag, self.avg, log, sink)
 
         self.win = fft_window(self, parent, size=size)
         self.set_average(self.average)
@@ -443,37 +450,13 @@ def next_down(v, seq):
     return v
 
 
-# ----------------------------------------------------------------
-#                    Deprecated interfaces
-# ----------------------------------------------------------------
-
-# returns (block, win).
-#   block requires a single input stream of float
-#   win is a subclass of wxWindow
-
-def make_ra_fft_sink_f(fg, parent, title, fft_size, input_rate, ymin = 0, ymax=50):
-    
-    block = ra_fft_sink_f(fg, parent, title=title, fft_size=fft_size, sample_rate=input_rate,
-                       y_per_div=(ymax - ymin)/8, ref_level=ymax)
-    return (block, block.win)
-
-# returns (block, win).
-#   block requires a single input stream of gr_complex
-#   win is a subclass of wxWindow
-
-def make_ra_fft_sink_c(fg, parent, title, fft_size, input_rate, ymin=0, ymax=50):
-    block = ra_fft_sink_c(fg, parent, title=title, fft_size=fft_size, sample_rate=input_rate,
-                       y_per_div=(ymax - ymin)/8, ref_level=ymax)
-    return (block, block.win)
-
-
 # ----------------------------------------------------------------
 # Standalone test app
 # ----------------------------------------------------------------
 
-class test_app_flow_graph (stdgui.gui_flow_graph):
+class test_app_flow_graph (stdgui2.std_top_block):
     def __init__(self, frame, panel, vbox, argv):
-        stdgui.gui_flow_graph.__init__ (self, frame, panel, vbox, argv)
+        stdgui2.std_top_block.__init__ (self, frame, panel, vbox, argv)
 
         fft_size = 256
 
@@ -488,7 +471,7 @@ class test_app_flow_graph (stdgui.gui_flow_graph):
         # suck down all the CPU available.  Normally you wouldn't use these.
         thr1 = gr.throttle(gr.sizeof_gr_complex, input_rate)
 
-        sink1 = ra_fft_sink_c (self, panel, title="Complex Data", fft_size=fft_size,
+        sink1 = ra_fft_sink_c (panel, title="Complex Data", fft_size=fft_size,
                             sample_rate=input_rate, baseband_freq=100e3,
                             ref_level=60, y_per_div=10)
         vbox.Add (sink1.win, 1, wx.EXPAND)
@@ -497,14 +480,14 @@ class test_app_flow_graph (stdgui.gui_flow_graph):
         src2 = gr.sig_source_f (input_rate, gr.GR_SIN_WAVE, 5.75e3, 1000)
         #src2 = gr.sig_source_f (input_rate, gr.GR_CONST_WAVE, 5.75e3, 1000)
         thr2 = gr.throttle(gr.sizeof_float, input_rate)
-        sink2 = ra_fft_sink_f (self, panel, title="Real Data", fft_size=fft_size*2,
+        sink2 = ra_fft_sink_f (panel, title="Real Data", fft_size=fft_size*2,
                             sample_rate=input_rate, baseband_freq=100e3,
                             ref_level=60, y_per_div=10)
         vbox.Add (sink2.win, 1, wx.EXPAND)
         self.connect (src2, thr2, sink2)
 
 def main ():
-    app = stdgui.stdapp (test_app_flow_graph,
+    app = stdgui2.stdapp (test_app_flow_graph,
                          "FFT Sink Test App")
     app.MainLoop ()
 
index 4efb0cd564063856c1de46f4385fa276933e265b..5e6d5b3938874cbc7cd812d1743cd42a347ca962 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2003,2004,2005 Free Software Foundation, Inc.
+# Copyright 2003,2004,2005,2007 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -21,7 +21,7 @@
 # 
 
 from gnuradio import gr, gru
-from gnuradio.wxgui import stdgui
+from gnuradio.wxgui import stdgui2
 import wx
 import gnuradio.wxgui.plot as plot
 import Numeric
@@ -67,14 +67,18 @@ class stripchart_sink_base(object):
     def set_autoscale(self, auto):
         self.autoscale = auto
 
-class stripchart_sink_f(gr.hier_block, stripchart_sink_base):
-    def __init__(self, fg, parent,
+class stripchart_sink_f(gr.hier_block2, stripchart_sink_base):
+    def __init__(self, parent,
                  y_per_div=10, ref_level=50, sample_rate=1,
                  title='', stripsize=4,
                  size=default_stripchartsink_size,xlabel="X", 
                  ylabel="Y", divbase=0.025,
                  parallel=False, scaling=1.0, autoscale=False):
 
+       gr.hier_block2.__init__(self, "stripchart_sink_f",
+                               gr.io_signature(1, 1, gr.sizeof_float),
+                               gr.io_signature(0, 0, 0))
+       
         stripchart_sink_base.__init__(self, input_is_real=True,
                                y_per_div=y_per_div, ref_level=ref_level,
                                sample_rate=sample_rate,
@@ -90,9 +94,7 @@ class stripchart_sink_f(gr.hier_block, stripchart_sink_base):
         else:
             one = gr.keep_one_in_n (gr.sizeof_float, 1)
             sink = gr.message_sink(gr.sizeof_float, self.msgq, True)
-        fg.connect (one, sink)
-
-        gr.hier_block.__init__(self, fg, one, sink)
+        self.connect (self, one, sink)
 
         self.win = stripchart_window(self, parent, size=size)
 
index 5ca7072c8bfa040cab592c94902abc9672c26cb8..e946f3a1056d18208f4b66397b5acd7ed04ca587 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2003,2004,2005 Free Software Foundation, Inc.
+# Copyright 2003,2004,2005,2007 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -21,7 +21,7 @@
 # 
 
 from gnuradio import gr, gru, window
-from gnuradio.wxgui import stdgui
+from gnuradio.wxgui import stdgui2
 import wx
 import gnuradio.wxgui.plot as plot
 import numpy
@@ -86,9 +86,6 @@ class waterfall_sink_base(object):
         self.input_is_real = input_is_real
         self.msgq = gr.msg_queue(2)         # queue up to 2 messages
 
-    def reconnect( self, fg ):
-        fg.connect( *self.block_list )
-
     def set_average(self, average):
         self.average = average
         if average:
@@ -109,12 +106,16 @@ class waterfall_sink_base(object):
     def _set_n(self):
         self.one_in_n.set_n(max(1, int(self.sample_rate/self.fft_size/self.fft_rate)))
         
-class waterfall_sink_f(gr.hier_block, waterfall_sink_base):
-    def __init__(self, fg, parent, baseband_freq=0,
+class waterfall_sink_f(gr.hier_block2, waterfall_sink_base):
+    def __init__(self, parent, baseband_freq=0,
                  ref_level=0, sample_rate=1, fft_size=512,
                  fft_rate=default_fft_rate, average=False, avg_alpha=None,
                  title='', size=default_fftsink_size, report=None, span=40, ofunc=None, xydfunc=None):
 
+       gr.hier_block2.__init__(self, "waterfall_sink_f",
+                               gr.io_signature(1, 1, gr.sizeof_float),
+                               gr.io_signature(0, 0, 0))
+                               
         waterfall_sink_base.__init__(self, input_is_real=True,
                                      baseband_freq=baseband_freq,
                                      sample_rate=sample_rate,
@@ -132,21 +133,22 @@ class waterfall_sink_f(gr.hier_block, waterfall_sink_base):
         log = gr.nlog10_ff(20, self.fft_size, -20*math.log10(self.fft_size))
         sink = gr.message_sink(gr.sizeof_float * self.fft_size, self.msgq, True)
 
-        self.block_list = (s2p, self.one_in_n, fft, c2mag, self.avg, log, sink)
-        self.reconnect( fg )
-        gr.hier_block.__init__(self, fg, s2p, sink)
-
+       self.connect(self, s2p, self.one_in_n, fft, c2mag, self.avg, log, sink)
         self.win = waterfall_window(self, parent, size=size, report=report,
                                     ref_level=ref_level, span=span, ofunc=ofunc, xydfunc=xydfunc)
         self.set_average(self.average)
 
 
-class waterfall_sink_c(gr.hier_block, waterfall_sink_base):
-    def __init__(self, fg, parent, baseband_freq=0,
+class waterfall_sink_c(gr.hier_block2, waterfall_sink_base):
+    def __init__(self, parent, baseband_freq=0,
                  ref_level=0, sample_rate=1, fft_size=512,
                  fft_rate=default_fft_rate, average=False, avg_alpha=None, 
                  title='', size=default_fftsink_size, report=None, span=40, ofunc=None, xydfunc=None):
 
+       gr.hier_block2.__init__(self, "waterfall_sink_c",
+                               gr.io_signature(1, 1, gr.sizeof_gr_complex),
+                               gr.io_signature(0, 0, 0))
+                               
         waterfall_sink_base.__init__(self, input_is_real=False,
                                      baseband_freq=baseband_freq,
                                      sample_rate=sample_rate,
@@ -166,10 +168,7 @@ class waterfall_sink_c(gr.hier_block, waterfall_sink_base):
         log = gr.nlog10_ff(20, self.fft_size, -20*math.log10(self.fft_size))
         sink = gr.message_sink(gr.sizeof_float * self.fft_size, self.msgq, True)
 
-        self.block_list = (s2p, self.one_in_n, fft, c2mag, self.avg, log, sink)
-        self.reconnect( fg )
-        gr.hier_block.__init__(self, fg, s2p, sink)
-
+       self.connect(self, s2p, self.one_in_n, fft, c2mag, self.avg, log, sink)
         self.win = waterfall_window(self, parent, size=size, report=report,
                                     ref_level=ref_level, span=span, ofunc=ofunc, xydfunc=xydfunc)
         self.set_average(self.average)
@@ -601,37 +600,13 @@ def tab_item( parent, label, chars, units, style=wx.TE_RIGHT, value="" ):
     return s
 
 
-# ----------------------------------------------------------------
-#                    Deprecated interfaces
-# ----------------------------------------------------------------
-
-# returns (block, win).
-#   block requires a single input stream of float
-#   win is a subclass of wxWindow
-
-def make_waterfall_sink_f(fg, parent, title, fft_size, input_rate):
-    
-    block = waterfall_sink_f(fg, parent, title=title, fft_size=fft_size,
-                             sample_rate=input_rate)
-    return (block, block.win)
-
-# returns (block, win).
-#   block requires a single input stream of gr_complex
-#   win is a subclass of wxWindow
-
-def make_waterfall_sink_c(fg, parent, title, fft_size, input_rate):
-    block = waterfall_sink_c(fg, parent, title=title, fft_size=fft_size,
-                             sample_rate=input_rate)
-    return (block, block.win)
-
-
 # ----------------------------------------------------------------
 # Standalone test app
 # ----------------------------------------------------------------
 
-class test_app_flow_graph (stdgui.gui_flow_graph):
+class test_app_flow_graph (stdgui2.std_top_block):
     def __init__(self, frame, panel, vbox, argv):
-        stdgui.gui_flow_graph.__init__ (self, frame, panel, vbox, argv)
+        stdgui2.std_top_block.__init__ (self, frame, panel, vbox, argv)
 
         fft_size = 512
 
@@ -646,7 +621,7 @@ class test_app_flow_graph (stdgui.gui_flow_graph):
         # suck down all the CPU available.  Normally you wouldn't use these.
         thr1 = gr.throttle(gr.sizeof_gr_complex, input_rate)
 
-        sink1 = waterfall_sink_c (self, panel, title="Complex Data",
+        sink1 = waterfall_sink_c (panel, title="Complex Data",
                                   fft_size=fft_size,
                                   sample_rate=input_rate, baseband_freq=0,
                                   size=(600,144) )
@@ -657,13 +632,13 @@ class test_app_flow_graph (stdgui.gui_flow_graph):
         src2 = gr.sig_source_f (input_rate, gr.GR_SIN_WAVE, 5.75e3, 1000)
         #src2 = gr.sig_source_f (input_rate, gr.GR_CONST_WAVE, 5.75e3, 1000)
         thr2 = gr.throttle(gr.sizeof_float, input_rate)
-        sink2 = waterfall_sink_f (self, panel, title="Real Data", fft_size=fft_size,
+        sink2 = waterfall_sink_f (panel, title="Real Data", fft_size=fft_size,
                                   sample_rate=input_rate, baseband_freq=0)
         vbox.Add (sink2.win, 1, wx.EXPAND)
         self.connect (src2, thr2, sink2)
 
 def main ():
-    app = stdgui.stdapp (test_app_flow_graph,
+    app = stdgui2.stdapp (test_app_flow_graph,
                          "Waterfall Sink Test App")
     app.MainLoop ()
 
index 21b02127a529d93fd54b8dd7d18b6bf0312b03ba..3937cb5ae0a5bdfe33cff6124caa6e22bd8ee038 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2004,2005 Free Software Foundation, Inc.
+# Copyright 2004,2005,2007 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -29,7 +29,7 @@
 #  and epoch folding analysis
 #
 #
-from gnuradio import gr, gru, blks, audio
+from gnuradio import gr, gru, blks2, audio
 from usrpm import usrp_dbid
 from gnuradio import usrp, optfir
 from gnuradio import eng_notation
@@ -46,9 +46,9 @@ import os
 import math
 
 
-class app_flow_graph(stdgui.gui_flow_graph):
+class app_flow_graph(stdgui2.std_top_block):
     def __init__(self, frame, panel, vbox, argv):
-        stdgui.gui_flow_graph.__init__(self)
+        stdgui2.std_top_block.__init__(self)
 
         self.frame = frame
         self.panel = panel
@@ -292,7 +292,7 @@ class app_flow_graph(stdgui.gui_flow_graph):
         #
         # Create the appropriate FFT scope
         #
-        self.scope = ra_fftsink.ra_fft_sink_f (self, panel, 
+        self.scope = ra_fftsink.ra_fft_sink_f (panel, 
            fft_size=int(options.fft_size), sample_rate=PULSAR_MAX_FREQ*2,
            title="Post-detector spectrum",  
            ofunc=self.pulsarfunc, xydfunc=self.xydfunc, fft_rate=200)
@@ -366,7 +366,7 @@ class app_flow_graph(stdgui.gui_flow_graph):
             self.folder_comb = gr.fft_filter_ccc(1,bogtaps)
 
         # Rational resampler
-        self.folder_rr = blks.rational_resampler_fff(self, self.interp, self.decim)
+        self.folder_rr = blks2.rational_resampler_fff(self.interp, self.decim)
 
         # Epoch folder bandpass
         bogtaps = Numeric.zeros(1, Numeric.Float64)
index 9023545281533e1863852b42affd0355f5757659..c6052a569739ee8654575ca54da842ae7ae5c961 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2004,2005 Free Software Foundation, Inc.
+# Copyright 2004,2005,2007 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -25,7 +25,7 @@ from gnuradio import usrp
 from usrpm import usrp_dbid
 from gnuradio import eng_notation
 from gnuradio.eng_option import eng_option
-from gnuradio.wxgui import stdgui, ra_fftsink, ra_stripchartsink, ra_waterfallsink, form, slider, waterfallsink
+from gnuradio.wxgui import stdgui2, ra_fftsink, ra_stripchartsink, ra_waterfallsink, form, slider, waterfallsink
 from optparse import OptionParser
 import wx
 import sys
@@ -40,9 +40,9 @@ class continuum_calibration(gr.feval_dd):
         exec(str)
         return(x)
 
-class app_flow_graph(stdgui.gui_flow_graph):
+class app_flow_graph(stdgui2.std_top_block):
     def __init__(self, frame, panel, vbox, argv):
-        stdgui.gui_flow_graph.__init__(self)
+        stdgui2.std_top_block.__init__(self, frame, panel, vbox, argv)
 
         self.frame = frame
         self.panel = panel
@@ -1082,7 +1082,7 @@ class app_flow_graph(stdgui.gui_flow_graph):
          self.notch_taps = FFT.inverse_fft(tmptaps)
 
 def main ():
-    app = stdgui.stdapp(app_flow_graph, "RADIO ASTRONOMY SPECTRAL/CONTINUUM RECEIVER: $Revision$", nstatus=1)
+    app = stdgui2.stdapp(app_flow_graph, "RADIO ASTRONOMY SPECTRAL/CONTINUUM RECEIVER: $Revision$", nstatus=1)
     app.MainLoop()
 
 if __name__ == '__main__':
index 16eca4be6dbf84c43af5d42647dd99c513c164d0..85c03b0e1dc8c74ec9f06301dc40cebad26dd88f 100644 (file)
@@ -90,7 +90,7 @@ class sounder_rx:
        self._verbose = verbose
        self._debug = debug
                
-        self._fg = gr.flow_graph()
+        self._tb = gr.top_block()
         self._u = usrp.source_c(fpga_filename='usrp_sounder.rbf')
        if not self._loopback:
             if self._subdev_spec == None:
@@ -110,7 +110,7 @@ class sounder_rx:
            print "Using smoothing alpha of", self._alpha
         self._lpf = gr.single_pole_iir_filter_cc(self._alpha, self._length)
         self._sink = gr.message_sink(self._vblen, self._msgq, True)
-        self._fg.connect(self._u, self._s2v, self._lpf, self._sink)
+        self._tb.connect(self._u, self._s2v, self._lpf, self._sink)
 
     def tune(self, frequency):
         if self._verbose:
@@ -135,17 +135,17 @@ class sounder_rx:
     def start(self):
         if self._debug:
             print "Starting receiver flow graph."
-        self._fg.start()
+        self._tb.start()
 
     def wait(self):
         if self._debug:
             print "Waiting for threads..."
-        self._fg.wait()
+        self._tb.wait()
 
     def stop(self):
         if self._debug:
             print "Stopping receiver flow graph."
-        self._fg.stop()
+        self._tb.stop()
         self.wait()
         if self._debug:
             print "Receiver flow graph stopped."
index 8588410cbff33617952d36f94c7fb8e9750664f6..99d1cfa6fe6ed247c63d29d01ccc8b59481642e4 100755 (executable)
@@ -26,10 +26,10 @@ import usrp1
 class qa_usrp (gr_unittest.TestCase):
 
     def setUp (self):
-        self.fg = gr.flow_graph ()
+        self.tb = gr.top_block ()
 
     def tearDown (self):
-        self.fg = None
+        self.tb = None
 
     def test_000_nop (self):
         """Just see if we can import the module...
index 9f1e84791943708960d9d711469995db4134d1e1..98da85f6b32d552be2dc2cf93d422a71e39bef0a 100755 (executable)
@@ -26,10 +26,10 @@ import video_sdl
 class qa_video_sdl (gr_unittest.TestCase):
 
     def setUp (self):
-        self.fg = gr.flow_graph ()
+        self.tb = gr.top_block ()
 
     def tearDown (self):
-        self.fg = None
+        self.tb = None
 
     def test_000_nop (self):
         """Just see if we can import the module...