diff options
Diffstat (limited to 'gr-howto-write-a-block')
-rw-r--r-- | gr-howto-write-a-block/apps/howto_square.grc | 6 | ||||
-rwxr-xr-x | gr-howto-write-a-block/apps/howto_square.py | 6 | ||||
-rw-r--r-- | gr-howto-write-a-block/lib/qa_square2_ff.cc | 10 | ||||
-rw-r--r-- | gr-howto-write-a-block/lib/qa_square_ff.cc | 10 | ||||
-rw-r--r-- | gr-howto-write-a-block/python/qa_howto.py | 15 |
5 files changed, 24 insertions, 23 deletions
diff --git a/gr-howto-write-a-block/apps/howto_square.grc b/gr-howto-write-a-block/apps/howto_square.grc index 1f3324e4eb..0eea15426c 100644 --- a/gr-howto-write-a-block/apps/howto_square.grc +++ b/gr-howto-write-a-block/apps/howto_square.grc @@ -143,7 +143,7 @@ </param> <param> <key>trig_mode</key> - <value>gr.gr_TRIG_MODE_AUTO</value> + <value>wxgui.TRIG_MODE_AUTO</value> </param> <param> <key>y_axis_label</key> @@ -209,7 +209,7 @@ </param> </block> <block> - <key>gr_vector_source_x</key> + <key>blocks_vector_source_x</key> <param> <key>id</key> <value>src</value> @@ -303,7 +303,7 @@ </param> <param> <key>trig_mode</key> - <value>gr.gr_TRIG_MODE_AUTO</value> + <value>wxgui.TRIG_MODE_AUTO</value> </param> <param> <key>y_axis_label</key> diff --git a/gr-howto-write-a-block/apps/howto_square.py b/gr-howto-write-a-block/apps/howto_square.py index fd03b74c42..818e776232 100755 --- a/gr-howto-write-a-block/apps/howto_square.py +++ b/gr-howto-write-a-block/apps/howto_square.py @@ -30,7 +30,7 @@ class howto_square(grc_wxgui.top_block_gui): # Blocks ################################################## self.thr = blocks.throttle(gr.sizeof_float*1, samp_rate) - self.src = gr.vector_source_f(([float(n)-50 for n in range(100)]), True, 1) + self.src = blocks.vector_source_f(([float(n)-50 for n in range(100)]), True, 1) self.sqr = howto.square_ff() self.sink2 = scopesink2.scope_sink_f( self.GetWin(), @@ -42,7 +42,7 @@ class howto_square(grc_wxgui.top_block_gui): ac_couple=False, xy_mode=False, num_inputs=1, - trig_mode=gr.gr_TRIG_MODE_AUTO, + trig_mode=wxgui.TRIG_MODE_AUTO, y_axis_label="Counts", ) self.Add(self.sink2.win) @@ -56,7 +56,7 @@ class howto_square(grc_wxgui.top_block_gui): ac_couple=False, xy_mode=False, num_inputs=1, - trig_mode=gr.gr_TRIG_MODE_AUTO, + trig_mode=wxgui.TRIG_MODE_AUTO, y_axis_label="Counts", ) self.Add(self.sink.win) diff --git a/gr-howto-write-a-block/lib/qa_square2_ff.cc b/gr-howto-write-a-block/lib/qa_square2_ff.cc index 672e75691b..b73c7ce1d7 100644 --- a/gr-howto-write-a-block/lib/qa_square2_ff.cc +++ b/gr-howto-write-a-block/lib/qa_square2_ff.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2011,2012 Free Software Foundation, Inc. + * Copyright 2011-2013 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -24,8 +24,8 @@ #include <vector> #include <gr_top_block.h> -#include <gr_vector_source_f.h> -#include <gr_vector_sink_f.h> +#include <blocks/vector_source_f.h> +#include <blocks/vector_sink_f.h> #include <howto/square2_ff.h> namespace gr { @@ -43,8 +43,8 @@ namespace gr { } gr_top_block_sptr tb = gr_make_top_block("dial_tone"); - gr_vector_source_f_sptr src = gr_make_vector_source_f(data); - gr_vector_sink_f_sptr snk = gr_make_vector_sink_f(); + gr::blocks::vector_source_f::sptr src = gr::blocks::vector_source_f::make(data); + gr::blocks::vector_sink_f::sptr snk = gr::blocks::vector_sink_f::make(); square2_ff::sptr op = square2_ff::make(); diff --git a/gr-howto-write-a-block/lib/qa_square_ff.cc b/gr-howto-write-a-block/lib/qa_square_ff.cc index dedd934e16..a8e7ac2b92 100644 --- a/gr-howto-write-a-block/lib/qa_square_ff.cc +++ b/gr-howto-write-a-block/lib/qa_square_ff.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2011,2012 Free Software Foundation, Inc. + * Copyright 2011-2013 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -24,8 +24,8 @@ #include <vector> #include <gr_top_block.h> -#include <gr_vector_source_f.h> -#include <gr_vector_sink_f.h> +#include <blocks/vector_source_f.h> +#include <blocks/vector_sink_f.h> #include <howto/square_ff.h> namespace gr { @@ -43,8 +43,8 @@ namespace gr { } gr_top_block_sptr tb = gr_make_top_block("dial_tone"); - gr_vector_source_f_sptr src = gr_make_vector_source_f(data); - gr_vector_sink_f_sptr snk = gr_make_vector_sink_f(); + gr::blocks::vector_source_f::sptr src = gr::blocks::vector_source_f::make(data); + gr::blocks::vector_sink_f::sptr snk = gr::blocks::vector_sink_f::make(); square_ff::sptr op = square_ff::make(); diff --git a/gr-howto-write-a-block/python/qa_howto.py b/gr-howto-write-a-block/python/qa_howto.py index 203b06922b..7b58c35f4d 100644 --- a/gr-howto-write-a-block/python/qa_howto.py +++ b/gr-howto-write-a-block/python/qa_howto.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2004,2007,2012 Free Software Foundation, Inc. +# Copyright 2004,2007,2012,2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -21,6 +21,7 @@ # from gnuradio import gr, gr_unittest +from gnuradio import blocks import howto_swig as howto from square3_ff import square3_ff @@ -35,9 +36,9 @@ class qa_howto(gr_unittest.TestCase): def test_001_square_ff(self): src_data = (-3, 4, -5.5, 2, 3) expected_result = (9, 16, 30.25, 4, 9) - src = gr.vector_source_f(src_data) + src = blocks.vector_source_f(src_data) sqr = howto.square_ff() - dst = gr.vector_sink_f() + dst = blocks.vector_sink_f() self.tb.connect(src, sqr) self.tb.connect(sqr, dst) self.tb.run() @@ -47,9 +48,9 @@ class qa_howto(gr_unittest.TestCase): def test_002_square2_ff(self): src_data = (-3, 4, -5.5, 2, 3) expected_result = (9, 16, 30.25, 4, 9) - src = gr.vector_source_f(src_data) + src = blocks.vector_source_f(src_data) sqr = howto.square2_ff() - dst = gr.vector_sink_f() + dst = blocks.vector_sink_f() self.tb.connect(src, sqr) self.tb.connect(sqr, dst) self.tb.run() @@ -59,9 +60,9 @@ class qa_howto(gr_unittest.TestCase): def test_003_square3_ff (self): src_data = (-3, 4, -5.5, 2, 3) expected_result = (9, 16, 30.25, 4, 9) - src = gr.vector_source_f (src_data) + src = blocks.vector_source_f (src_data) sqr = square3_ff () - dst = gr.vector_sink_f () + dst = blocks.vector_sink_f () self.tb.connect (src, sqr) self.tb.connect (sqr, dst) self.tb.run () |