diff options
Diffstat (limited to 'gr-wxgui/src/python/numbersink2.py')
-rw-r--r-- | gr-wxgui/src/python/numbersink2.py | 43 |
1 files changed, 22 insertions, 21 deletions
diff --git a/gr-wxgui/src/python/numbersink2.py b/gr-wxgui/src/python/numbersink2.py index 011acdfd5e..f85d9c3ee1 100644 --- a/gr-wxgui/src/python/numbersink2.py +++ b/gr-wxgui/src/python/numbersink2.py @@ -1,5 +1,5 @@ # -# Copyright 2008 Free Software Foundation, Inc. +# Copyright 2008,2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -24,7 +24,8 @@ ################################################## import number_window import common -from gnuradio import gr, blks2 +from gnuradio import gr, blks2, filter +from gnuradio import analog from pubsub import pubsub from constants import * @@ -74,11 +75,11 @@ class _number_sink_base(gr.hier_block2, common.wxgui_hb): if self._real: mult = gr.multiply_const_ff(factor) add = gr.add_const_ff(ref_level) - avg = gr.single_pole_iir_filter_ff(1.0) + avg = filter.single_pole_iir_filter_ff(1.0) else: mult = gr.multiply_const_cc(factor) add = gr.add_const_cc(ref_level) - avg = gr.single_pole_iir_filter_cc(1.0) + avg = filter.single_pole_iir_filter_cc(1.0) msgq = gr.msg_queue(2) sink = gr.message_sink(self._item_size, msgq, True) #controller @@ -134,38 +135,38 @@ class number_sink_c(_number_sink_base): import wx from gnuradio.wxgui import stdgui2 -class test_app_flow_graph (stdgui2.std_top_block): +class test_app_flow_graph(stdgui2.std_top_block): def __init__(self, frame, panel, vbox, argv): - stdgui2.std_top_block.__init__ (self, frame, panel, vbox, argv) + stdgui2.std_top_block.__init__(self, frame, panel, vbox, argv) # build our flow graph input_rate = 20.48e3 # Generate a real and complex sinusoids - src1 = gr.sig_source_f (input_rate, gr.GR_SIN_WAVE, 2.21e3, 1) - src2 = gr.sig_source_c (input_rate, gr.GR_SIN_WAVE, 2.21e3, 1) + src1 = analog.sig_source_f(input_rate, analog.GR_SIN_WAVE, 2.21e3, 1) + src2 = analog.sig_source_c(input_rate, analog.GR_SIN_WAVE, 2.21e3, 1) # We add these throttle blocks so that this demo doesn't # suck down all the CPU available. Normally you wouldn't use these. thr1 = gr.throttle(gr.sizeof_float, input_rate) thr2 = gr.throttle(gr.sizeof_gr_complex, input_rate) - sink1 = number_sink_f (panel, unit='V',label="Real Data", avg_alpha=0.001, - sample_rate=input_rate, minval=-1, maxval=1, - ref_level=0, decimal_places=3) - vbox.Add (sink1.win, 1, wx.EXPAND) - sink2 = number_sink_c (panel, unit='V',label="Complex Data", avg_alpha=0.001, - sample_rate=input_rate, minval=-1, maxval=1, - ref_level=0, decimal_places=3) - vbox.Add (sink2.win, 1, wx.EXPAND) + sink1 = number_sink_f(panel, unit='V',label="Real Data", avg_alpha=0.001, + sample_rate=input_rate, minval=-1, maxval=1, + ref_level=0, decimal_places=3) + vbox.Add(sink1.win, 1, wx.EXPAND) + sink2 = number_sink_c(panel, unit='V',label="Complex Data", avg_alpha=0.001, + sample_rate=input_rate, minval=-1, maxval=1, + ref_level=0, decimal_places=3) + vbox.Add(sink2.win, 1, wx.EXPAND) - self.connect (src1, thr1, sink1) - self.connect (src2, thr2, sink2) + self.connect(src1, thr1, sink1) + self.connect(src2, thr2, sink2) def main (): - app = stdgui2.stdapp (test_app_flow_graph, "Number Sink Test App") - app.MainLoop () + app = stdgui2.stdapp(test_app_flow_graph, "Number Sink Test App") + app.MainLoop() if __name__ == '__main__': - main () + main() |