diff options
author | Tom Rondeau <trondeau@vt.edu> | 2013-02-21 19:34:27 -0500 |
---|---|---|
committer | Tom Rondeau <trondeau@vt.edu> | 2013-02-21 19:34:27 -0500 |
commit | 4f479665bc9f04e52b047cb270772ee61e319a59 (patch) | |
tree | 09a018da0d2c14f160520707ecc2a2ff6ae8e1f1 /gnuradio-core/src | |
parent | 7b4a518bfe47fb1d0b2a32fc5c93ed0157d2dc6c (diff) |
blocks: removing blocks from gnuradio-core.
delay, rms, packed_to_unpacked, unpacked_to_packed.
Diffstat (limited to 'gnuradio-core/src')
25 files changed, 177 insertions, 1770 deletions
diff --git a/gnuradio-core/src/examples/ctrlport/pfb_sync_test-qt.grc b/gnuradio-core/src/examples/ctrlport/pfb_sync_test-qt.grc index 5891500860..15452e5399 100644 --- a/gnuradio-core/src/examples/ctrlport/pfb_sync_test-qt.grc +++ b/gnuradio-core/src/examples/ctrlport/pfb_sync_test-qt.grc @@ -1,6 +1,6 @@ <?xml version='1.0' encoding='ASCII'?> <flow_graph> - <timestamp>Thu Feb 14 15:27:16 2013</timestamp> + <timestamp>Thu Feb 21 19:08:22 2013</timestamp> <block> <key>options</key> <param> @@ -130,37 +130,6 @@ </param> </block> <block> - <key>gr_throttle</key> - <param> - <key>id</key> - <value>gr_throttle_0</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>type</key> - <value>byte</value> - </param> - <param> - <key>samples_per_second</key> - <value>samp_rate</value> - </param> - <param> - <key>vlen</key> - <value>1</value> - </param> - <param> - <key>_coordinate</key> - <value>(623, 64)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> <key>variable</key> <param> <key>id</key> @@ -409,6 +378,10 @@ <value>2</value> </param> <param> + <key>update_time</key> + <value>0.10</value> + </param> + <param> <key>gui_hint</key> <value></value> </param> @@ -640,26 +613,22 @@ </param> </block> <block> - <key>gr_file_source</key> + <key>gr_throttle</key> <param> <key>id</key> - <value>gr_file_source_0</value> + <value>gr_throttle_0</value> </param> <param> <key>_enabled</key> - <value>False</value> - </param> - <param> - <key>file</key> - <value>/dev/urandom</value> + <value>True</value> </param> <param> <key>type</key> <value>byte</value> </param> <param> - <key>repeat</key> - <value>True</value> + <key>samples_per_second</key> + <value>samp_rate</value> </param> <param> <key>vlen</key> @@ -667,7 +636,7 @@ </param> <param> <key>_coordinate</key> - <value>(228, 56)</value> + <value>(623, 64)</value> </param> <param> <key>_rotation</key> @@ -702,7 +671,42 @@ </param> <param> <key>_coordinate</key> - <value>(235, 126)</value> + <value>(234, 126)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>gr_file_source</key> + <param> + <key>id</key> + <value>gr_file_source_0</value> + </param> + <param> + <key>_enabled</key> + <value>False</value> + </param> + <param> + <key>file</key> + <value>/dev/urandom</value> + </param> + <param> + <key>type</key> + <value>byte</value> + </param> + <param> + <key>repeat</key> + <value>True</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>_coordinate</key> + <value>(228, 56)</value> </param> <param> <key>_rotation</key> @@ -710,10 +714,10 @@ </param> </block> <block> - <key>gr_packed_to_unpacked_xx</key> + <key>blocks_packed_to_unpacked_xx</key> <param> <key>id</key> - <value>gr_packed_to_unpacked_xx_0</value> + <value>blocks_packed_to_unpacked_xx_0</value> </param> <param> <key>_enabled</key> @@ -737,7 +741,7 @@ </param> <param> <key>_coordinate</key> - <value>(408, 56)</value> + <value>(419, 56)</value> </param> <param> <key>_rotation</key> @@ -745,12 +749,6 @@ </param> </block> <connection> - <source_block_id>gr_packed_to_unpacked_xx_0</source_block_id> - <sink_block_id>gr_throttle_0</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> <source_block_id>gr_throttle_0</source_block_id> <sink_block_id>digital_psk_mod_0</sink_block_id> <source_key>0</source_key> @@ -763,12 +761,6 @@ <sink_key>0</sink_key> </connection> <connection> - <source_block_id>gr_file_source_0</source_block_id> - <sink_block_id>gr_packed_to_unpacked_xx_0</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> <source_block_id>digital_pfb_clock_sync_xxx_0</source_block_id> <sink_block_id>qtgui_const_sink_x_0</sink_block_id> <source_key>0</source_key> @@ -805,8 +797,20 @@ <sink_key>0</sink_key> </connection> <connection> + <source_block_id>blocks_packed_to_unpacked_xx_0</source_block_id> + <sink_block_id>gr_throttle_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> <source_block_id>gr_vector_source_x_0</source_block_id> - <sink_block_id>gr_packed_to_unpacked_xx_0</sink_block_id> + <sink_block_id>blocks_packed_to_unpacked_xx_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>gr_file_source_0</source_block_id> + <sink_block_id>blocks_packed_to_unpacked_xx_0</sink_block_id> <source_key>0</source_key> <sink_key>0</sink_key> </connection> diff --git a/gnuradio-core/src/examples/ctrlport/pfb_sync_test.grc b/gnuradio-core/src/examples/ctrlport/pfb_sync_test.grc index 0e470a619d..36238e5c18 100644 --- a/gnuradio-core/src/examples/ctrlport/pfb_sync_test.grc +++ b/gnuradio-core/src/examples/ctrlport/pfb_sync_test.grc @@ -1,6 +1,6 @@ <?xml version='1.0' encoding='ASCII'?> <flow_graph> - <timestamp>Wed Feb 6 17:02:42 2013</timestamp> + <timestamp>Thu Feb 21 19:08:39 2013</timestamp> <block> <key>options</key> <param> @@ -363,107 +363,6 @@ </param> </block> <block> - <key>gr_file_source</key> - <param> - <key>id</key> - <value>gr_file_source_0</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>file</key> - <value>/dev/urandom</value> - </param> - <param> - <key>type</key> - <value>byte</value> - </param> - <param> - <key>repeat</key> - <value>True</value> - </param> - <param> - <key>vlen</key> - <value>1</value> - </param> - <param> - <key>_coordinate</key> - <value>(228, 56)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>gr_packed_to_unpacked_xx</key> - <param> - <key>id</key> - <value>gr_packed_to_unpacked_xx_0</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>type</key> - <value>byte</value> - </param> - <param> - <key>bits_per_chunk</key> - <value>8</value> - </param> - <param> - <key>endianness</key> - <value>gr.GR_MSB_FIRST</value> - </param> - <param> - <key>num_ports</key> - <value>1</value> - </param> - <param> - <key>_coordinate</key> - <value>(408, 56)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>gr_throttle</key> - <param> - <key>id</key> - <value>gr_throttle_0</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>type</key> - <value>byte</value> - </param> - <param> - <key>samples_per_second</key> - <value>samp_rate</value> - </param> - <param> - <key>vlen</key> - <value>1</value> - </param> - <param> - <key>_coordinate</key> - <value>(623, 64)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> <key>digital_pfb_clock_sync_xxx</key> <param> <key>id</key> @@ -623,18 +522,107 @@ <value>0</value> </param> </block> - <connection> - <source_block_id>gr_packed_to_unpacked_xx_0</source_block_id> - <sink_block_id>gr_throttle_0</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> - <source_block_id>gr_file_source_0</source_block_id> - <sink_block_id>gr_packed_to_unpacked_xx_0</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> + <block> + <key>gr_file_source</key> + <param> + <key>id</key> + <value>gr_file_source_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>file</key> + <value>/dev/urandom</value> + </param> + <param> + <key>type</key> + <value>byte</value> + </param> + <param> + <key>repeat</key> + <value>True</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>_coordinate</key> + <value>(229, 56)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>gr_throttle</key> + <param> + <key>id</key> + <value>gr_throttle_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>byte</value> + </param> + <param> + <key>samples_per_second</key> + <value>samp_rate</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>_coordinate</key> + <value>(623, 64)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blocks_packed_to_unpacked_xx</key> + <param> + <key>id</key> + <value>blocks_packed_to_unpacked_xx_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>byte</value> + </param> + <param> + <key>bits_per_chunk</key> + <value>8</value> + </param> + <param> + <key>endianness</key> + <value>gr.GR_MSB_FIRST</value> + </param> + <param> + <key>num_ports</key> + <value>1</value> + </param> + <param> + <key>_coordinate</key> + <value>(415, 56)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> <connection> <source_block_id>gr_throttle_0</source_block_id> <sink_block_id>digital_psk_mod_0</sink_block_id> @@ -665,4 +653,16 @@ <source_key>0</source_key> <sink_key>0</sink_key> </connection> + <connection> + <source_block_id>gr_file_source_0</source_block_id> + <sink_block_id>blocks_packed_to_unpacked_xx_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_packed_to_unpacked_xx_0</source_block_id> + <sink_block_id>gr_throttle_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> </flow_graph> diff --git a/gnuradio-core/src/lib/general/CMakeLists.txt b/gnuradio-core/src/lib/general/CMakeLists.txt index c562224009..de75dee7b8 100644 --- a/gnuradio-core/src/lib/general/CMakeLists.txt +++ b/gnuradio-core/src/lib/general/CMakeLists.txt @@ -105,7 +105,6 @@ install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/gr_fxpt.h ${CMAKE_CURRENT_SOURCE_DIR}/gr_fxpt_nco.h ${CMAKE_CURRENT_SOURCE_DIR}/gr_fxpt_vco.h - ${CMAKE_CURRENT_SOURCE_DIR}/gr_log2_const.h ${CMAKE_CURRENT_SOURCE_DIR}/gr_math.h ${CMAKE_CURRENT_SOURCE_DIR}/gr_misc.h ${CMAKE_CURRENT_SOURCE_DIR}/gr_nco.h @@ -152,7 +151,6 @@ set(gr_core_general_triple_threats gr_complex_to_interleaved_short gr_complex_to_xxx gr_copy - gr_delay gr_endian_swap gr_fake_channel_coder_pp gr_feval @@ -170,8 +168,6 @@ set(gr_core_general_triple_threats gr_random_pdu gr_regenerate_bb gr_remez - gr_rms_cf - gr_rms_ff gr_skiphead gr_stretch_ff gr_test diff --git a/gnuradio-core/src/lib/general/general.i b/gnuradio-core/src/lib/general/general.i index 53dcac6fb6..092582475d 100644 --- a/gnuradio-core/src/lib/general/general.i +++ b/gnuradio-core/src/lib/general/general.i @@ -38,10 +38,7 @@ //#include <gr_endianness.h> #include <gr_endian_swap.h> #include <gr_firdes.h> -#include <gr_delay.h> #include <gr_random_pdu.h> -#include <gr_rms_cf.h> -#include <gr_rms_ff.h> #include <gr_fake_channel_coder_pp.h> #include <gr_throttle.h> #include <gr_transcendental.h> @@ -87,10 +84,7 @@ //%include "gr_endianness.i" %include "gr_endian_swap.i" %include "gr_firdes.i" -%include "gr_delay.i" %include "gr_random_pdu.i" -%include "gr_rms_cf.i" -%include "gr_rms_ff.i" %include "gr_fake_channel_coder_pp.i" %include "gr_throttle.i" %include "gr_transcendental.i" diff --git a/gnuradio-core/src/lib/general/general_generated.i b/gnuradio-core/src/lib/general/general_generated.i index 251406c99e..900237214e 100644 --- a/gnuradio-core/src/lib/general/general_generated.i +++ b/gnuradio-core/src/lib/general/general_generated.i @@ -6,9 +6,6 @@ #include <gr_mute_ff.h> #include <gr_mute_ii.h> #include <gr_mute_ss.h> -#include <gr_packed_to_unpacked_bb.h> -#include <gr_packed_to_unpacked_ii.h> -#include <gr_packed_to_unpacked_ss.h> #include <gr_probe_signal_b.h> #include <gr_probe_signal_s.h> #include <gr_probe_signal_i.h> @@ -19,9 +16,6 @@ #include <gr_probe_signal_vi.h> #include <gr_probe_signal_vf.h> #include <gr_probe_signal_vc.h> -#include <gr_unpacked_to_packed_bb.h> -#include <gr_unpacked_to_packed_ii.h> -#include <gr_unpacked_to_packed_ss.h> #include <gr_vector_sink_b.h> #include <gr_vector_sink_c.h> #include <gr_vector_sink_f.h> @@ -38,9 +32,6 @@ %include <gr_mute_ff.i> %include <gr_mute_ii.i> %include <gr_mute_ss.i> -%include <gr_packed_to_unpacked_bb.i> -%include <gr_packed_to_unpacked_ii.i> -%include <gr_packed_to_unpacked_ss.i> %include <gr_probe_signal_b.i> %include <gr_probe_signal_s.i> %include <gr_probe_signal_i.i> @@ -51,9 +42,6 @@ %include <gr_probe_signal_vi.i> %include <gr_probe_signal_vf.i> %include <gr_probe_signal_vc.i> -%include <gr_unpacked_to_packed_bb.i> -%include <gr_unpacked_to_packed_ii.i> -%include <gr_unpacked_to_packed_ss.i> %include <gr_vector_sink_b.i> %include <gr_vector_sink_c.i> %include <gr_vector_sink_f.i> diff --git a/gnuradio-core/src/lib/general/gr_delay.cc b/gnuradio-core/src/lib/general/gr_delay.cc deleted file mode 100644 index 8f728948df..0000000000 --- a/gnuradio-core/src/lib/general/gr_delay.cc +++ /dev/null @@ -1,129 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2007,2010,2012 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <gr_delay.h> -#include <gr_io_signature.h> -#include <string.h> - -gr_delay_sptr -gr_make_delay (size_t itemsize, int delay) -{ - return gnuradio::get_initial_sptr(new gr_delay (itemsize, delay)); -} - -gr_delay::gr_delay (size_t itemsize, int delay) - : gr_block ("delay", - gr_make_io_signature (1, -1, itemsize), - gr_make_io_signature (1, -1, itemsize)), - d_itemsize(itemsize) -{ - set_delay(delay); - d_delta = 0; -} - -void -gr_delay::forecast (int noutput_items, gr_vector_int &ninput_items_required) -{ - // make sure all inputs have noutput_items available - unsigned ninputs = ninput_items_required.size (); - for (unsigned i = 0; i < ninputs; i++) - ninput_items_required[i] = noutput_items; -} - -void -gr_delay::set_delay (int d) -{ - // only set a new delta if there is a change in the delay; this - // protects from quickly-repeated calls to this function that would - // end with d_delta=0. - if(d != delay()) { - gruel::scoped_lock l(d_mutex_delay); - int old = delay(); - set_history(d+1); - d_delta += delay() - old; - } -} - -int -gr_delay::general_work (int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) -{ - gruel::scoped_lock l(d_mutex_delay); - assert(input_items.size() == output_items.size()); - - const char *iptr; - char *optr; - int cons, ret; - - // No change in delay; just memcpy ins to outs - if(d_delta == 0) { - for(size_t i = 0; i < input_items.size(); i++) { - iptr = (const char *) input_items[i]; - optr = (char *) output_items[i]; - std::memcpy(optr, iptr, noutput_items*d_itemsize); - } - cons = noutput_items; - ret = noutput_items; - } - - // Skip over d_delta items on the input - else if(d_delta < 0) { - int n_to_copy, n_adj; - int delta = -d_delta; - n_to_copy = std::max(0, noutput_items-delta); - n_adj = std::min(delta, noutput_items); - for(size_t i = 0; i < input_items.size(); i++) { - iptr = (const char *) input_items[i]; - optr = (char *) output_items[i]; - std::memcpy(optr, iptr+delta*d_itemsize, n_to_copy*d_itemsize); - } - cons = noutput_items; - ret = n_to_copy; - delta -= n_adj; - d_delta = -delta; - } - - //produce but not consume (inserts zeros) - else { // d_delta > 0 - int n_from_input, n_padding; - n_from_input = std::max(0, noutput_items-d_delta); - n_padding = std::min(d_delta, noutput_items); - for(size_t i = 0; i < input_items.size(); i++) { - iptr = (const char *) input_items[i]; - optr = (char *) output_items[i]; - std::memset(optr, 0, n_padding*d_itemsize); - std::memcpy(optr, iptr, n_from_input*d_itemsize); - } - cons = n_from_input; - ret = noutput_items; - d_delta -= n_padding; - } - - consume_each(cons); - return ret; -} diff --git a/gnuradio-core/src/lib/general/gr_delay.h b/gnuradio-core/src/lib/general/gr_delay.h deleted file mode 100644 index ed05c47f43..0000000000 --- a/gnuradio-core/src/lib/general/gr_delay.h +++ /dev/null @@ -1,61 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2007,2012 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef INCLUDED_GR_DELAY_H -#define INCLUDED_GR_DELAY_H - -#include <gr_core_api.h> -#include <gr_block.h> -#include <gruel/thread.h> - -class gr_delay; -typedef boost::shared_ptr<gr_delay> gr_delay_sptr; - -GR_CORE_API gr_delay_sptr gr_make_delay (size_t itemsize, int delay); - -/*! - * \brief delay the input by a certain number of samples - * \ingroup misc_blk - */ -class GR_CORE_API gr_delay : public gr_block -{ - friend GR_CORE_API gr_delay_sptr gr_make_delay (size_t itemsize, int delay); - - gr_delay (size_t itemsize, int delay); - - void forecast (int noutput_items, gr_vector_int &ninput_items_required); - - size_t d_itemsize; - int d_delta; - gruel::mutex d_mutex_delay; - - public: - int delay () const { return history()-1; } - void set_delay (int delay); - - int general_work (int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); -}; - -#endif diff --git a/gnuradio-core/src/lib/general/gr_delay.i b/gnuradio-core/src/lib/general/gr_delay.i deleted file mode 100644 index f3d49891d7..0000000000 --- a/gnuradio-core/src/lib/general/gr_delay.i +++ /dev/null @@ -1,35 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2007 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -GR_SWIG_BLOCK_MAGIC(gr,delay) - - gr_delay_sptr gr_make_delay (size_t itemsize, int delay); - -class gr_delay : public gr_block -{ - private: - gr_delay (size_t itemsize, int delay); - - public: - int delay() const { return history()-1; } - void set_delay (int delay) { set_history(delay+1); } -}; diff --git a/gnuradio-core/src/lib/general/gr_log2_const.h b/gnuradio-core/src/lib/general/gr_log2_const.h deleted file mode 100644 index 40afcf8b80..0000000000 --- a/gnuradio-core/src/lib/general/gr_log2_const.h +++ /dev/null @@ -1,47 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - - -/* - * a bit of template hackery... - */ -#ifndef INCLUDED_GR_LOG2_CONST_H -#define INCLUDED_GR_LOG2_CONST_H - -#include <gr_core_api.h> -#include <assert.h> - -template<unsigned int k> static inline int gr_log2_const() { assert(0); return 0; } - -template<> inline int gr_log2_const<1>() { return 0; } -template<> inline int gr_log2_const<2>() { return 1; } -template<> inline int gr_log2_const<4>() { return 2; } -template<> inline int gr_log2_const<8>() { return 3; } -template<> inline int gr_log2_const<16>() { return 4; } -template<> inline int gr_log2_const<32>() { return 5; } -template<> inline int gr_log2_const<64>() { return 6; } -template<> inline int gr_log2_const<128>() { return 7; } -template<> inline int gr_log2_const<256>() { return 8; } -template<> inline int gr_log2_const<512>() { return 9; } -template<> inline int gr_log2_const<1024>(){ return 10; } - -#endif /* INCLUDED_GR_LOG2_CONST_H */ diff --git a/gnuradio-core/src/lib/general/gr_rms_cf.cc b/gnuradio-core/src/lib/general/gr_rms_cf.cc deleted file mode 100644 index 44eb2221ea..0000000000 --- a/gnuradio-core/src/lib/general/gr_rms_cf.cc +++ /dev/null @@ -1,71 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2005,2010 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif -#include <gr_rms_cf.h> -#include <gr_io_signature.h> -#include <cmath> - -gr_rms_cf_sptr -gr_make_rms_cf(double alpha) -{ - return gnuradio::get_initial_sptr(new gr_rms_cf(alpha)); -} - -gr_rms_cf::gr_rms_cf (double alpha) - : gr_sync_block ("rms_cf", - gr_make_io_signature(1, 1, sizeof(gr_complex)), - gr_make_io_signature(1, 1, sizeof(float))), - d_iir(alpha) -{ - -} - -gr_rms_cf::~gr_rms_cf() -{ -} - - -int -gr_rms_cf::work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) -{ - const gr_complex *in = (const gr_complex *) input_items[0]; - float *out = (float *) output_items[0]; - - for (int i = 0; i < noutput_items; i++){ - double mag_sqrd = in[i].real()*in[i].real() + in[i].imag()*in[i].imag(); - double f = d_iir.filter(mag_sqrd); - out[i] = sqrt(f); - } - - return noutput_items; -} - -void -gr_rms_cf::set_alpha(double alpha) -{ - d_iir.set_taps(alpha); -} diff --git a/gnuradio-core/src/lib/general/gr_rms_cf.h b/gnuradio-core/src/lib/general/gr_rms_cf.h deleted file mode 100644 index 9e701aa6a0..0000000000 --- a/gnuradio-core/src/lib/general/gr_rms_cf.h +++ /dev/null @@ -1,61 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2005 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ -#ifndef INCLUDED_GR_RMS_CF_H -#define INCLUDED_GR_RMS_CF_H - -#include <gr_core_api.h> -#include <gr_sync_block.h> -#include <gr_single_pole_iir.h> - -class gr_rms_cf; -typedef boost::shared_ptr<gr_rms_cf> gr_rms_cf_sptr; - -GR_CORE_API gr_rms_cf_sptr -gr_make_rms_cf (double alpha = 0.0001); - -/*! - * \brief RMS average power - * \ingroup math_blk - */ -class GR_CORE_API gr_rms_cf : public gr_sync_block -{ - gr_single_pole_iir<double,double,double> d_iir; - bool d_unmuted; - - friend GR_CORE_API gr_rms_cf_sptr - gr_make_rms_cf (double alpha); - - gr_rms_cf (double alpha); - -public: - ~gr_rms_cf (); - - int work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - - bool unmuted () const { return d_unmuted; } - - void set_alpha (double alpha); -}; - -#endif /* INCLUDED_GR_RMS_CF_H */ diff --git a/gnuradio-core/src/lib/general/gr_rms_cf.i b/gnuradio-core/src/lib/general/gr_rms_cf.i deleted file mode 100644 index a668200eef..0000000000 --- a/gnuradio-core/src/lib/general/gr_rms_cf.i +++ /dev/null @@ -1,33 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2005 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -GR_SWIG_BLOCK_MAGIC(gr,rms_cf); - -gr_rms_cf_sptr -gr_make_rms_cf (double alpha = 0.0001); - -class gr_rms_cf : public gr_sync_block -{ -public: - bool unmuted () const { return d_unmuted; } - void set_alpha (double alpha); -}; diff --git a/gnuradio-core/src/lib/general/gr_rms_ff.cc b/gnuradio-core/src/lib/general/gr_rms_ff.cc deleted file mode 100644 index 233f419cd2..0000000000 --- a/gnuradio-core/src/lib/general/gr_rms_ff.cc +++ /dev/null @@ -1,71 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2005,2010 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif -#include <gr_rms_ff.h> -#include <gr_io_signature.h> -#include <cmath> - -gr_rms_ff_sptr -gr_make_rms_ff(double alpha) -{ - return gnuradio::get_initial_sptr(new gr_rms_ff(alpha)); -} - -gr_rms_ff::gr_rms_ff (double alpha) - : gr_sync_block ("rms_ff", - gr_make_io_signature(1, 1, sizeof(float)), - gr_make_io_signature(1, 1, sizeof(float))), - d_iir(alpha) -{ - -} - -gr_rms_ff::~gr_rms_ff() -{ -} - - -int -gr_rms_ff::work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) -{ - const float *in = (const float *) input_items[0]; - float *out = (float *) output_items[0]; - - for (int i = 0; i < noutput_items; i++){ - double mag_sqrd = in[i]*in[i]; - double f = d_iir.filter(mag_sqrd); - out[i] = sqrt(f); - } - - return noutput_items; -} - -void -gr_rms_ff::set_alpha(double alpha) -{ - d_iir.set_taps(alpha); -} diff --git a/gnuradio-core/src/lib/general/gr_rms_ff.h b/gnuradio-core/src/lib/general/gr_rms_ff.h deleted file mode 100644 index 30cf7f9d9f..0000000000 --- a/gnuradio-core/src/lib/general/gr_rms_ff.h +++ /dev/null @@ -1,61 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2005 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ -#ifndef INCLUDED_GR_RMS_FF_H -#define INCLUDED_GR_RMS_FF_H - -#include <gr_core_api.h> -#include <gr_sync_block.h> -#include <gr_single_pole_iir.h> - -class gr_rms_ff; -typedef boost::shared_ptr<gr_rms_ff> gr_rms_ff_sptr; - -GR_CORE_API gr_rms_ff_sptr -gr_make_rms_ff (double alpha = 0.0001); - -/*! - * \brief RMS average power - * \ingroup math_blk - */ -class GR_CORE_API gr_rms_ff : public gr_sync_block -{ - gr_single_pole_iir<double,double,double> d_iir; - bool d_unmuted; - - friend GR_CORE_API gr_rms_ff_sptr - gr_make_rms_ff (double alpha); - - gr_rms_ff (double alpha); - -public: - ~gr_rms_ff (); - - int work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - - bool unmuted () const { return d_unmuted; } - - void set_alpha (double alpha); -}; - -#endif /* INCLUDED_GR_RMS_FF_H */ diff --git a/gnuradio-core/src/lib/general/gr_rms_ff.i b/gnuradio-core/src/lib/general/gr_rms_ff.i deleted file mode 100644 index 00b03f5d4b..0000000000 --- a/gnuradio-core/src/lib/general/gr_rms_ff.i +++ /dev/null @@ -1,33 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2005 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -GR_SWIG_BLOCK_MAGIC(gr,rms_ff); - -gr_rms_ff_sptr -gr_make_rms_ff (double alpha = 0.0001); - -class gr_rms_ff : public gr_sync_block -{ -public: - bool unmuted () const { return d_unmuted; } - void set_alpha (double alpha); -}; diff --git a/gnuradio-core/src/lib/gengen/CMakeLists.txt b/gnuradio-core/src/lib/gengen/CMakeLists.txt index d018876183..5d5b2536c3 100644 --- a/gnuradio-core/src/lib/gengen/CMakeLists.txt +++ b/gnuradio-core/src/lib/gengen/CMakeLists.txt @@ -90,8 +90,6 @@ expand_h_cc_i(gr_probe_signal_vX b s i f c) expand_h_cc_i(gr_mute_XX ss ii ff cc) expand_h_cc_i(gr_moving_average_XX ss ii ff cc) -expand_h_cc_i(gr_unpacked_to_packed_XX bb ss ii) -expand_h_cc_i(gr_packed_to_unpacked_XX bb ss ii) expand_h_cc_i(gr_sample_and_hold_XX bb ss ii ff) expand_h_cc_i(gr_argmax_XX fs is ss) expand_h_cc_i(gr_max_XX ff ii ss) diff --git a/gnuradio-core/src/lib/gengen/generate_common.py b/gnuradio-core/src/lib/gengen/generate_common.py index 6a04a75d72..ba9f7625e1 100755 --- a/gnuradio-core/src/lib/gengen/generate_common.py +++ b/gnuradio-core/src/lib/gengen/generate_common.py @@ -46,8 +46,6 @@ reg_roots = [ # other blocks others = ( - ('gr_unpacked_to_packed_XX', ('bb','ss','ii')), - ('gr_packed_to_unpacked_XX', ('bb','ss','ii')), ('gr_sample_and_hold_XX', ('bb','ss','ii','ff')), ('gr_argmax_XX', ('fs','is','ss')), ('gr_max_XX', ('ff','ii','ss')), diff --git a/gnuradio-core/src/lib/gengen/gr_packed_to_unpacked_XX.cc.t b/gnuradio-core/src/lib/gengen/gr_packed_to_unpacked_XX.cc.t deleted file mode 100644 index 75e53c4ca1..0000000000 --- a/gnuradio-core/src/lib/gengen/gr_packed_to_unpacked_XX.cc.t +++ /dev/null @@ -1,137 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2004 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -// @WARNING@ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <@NAME@.h> -#include <gr_io_signature.h> -#include <assert.h> -#include <gr_log2_const.h> - -static const unsigned int BITS_PER_TYPE = sizeof(@I_TYPE@) * 8; -static const unsigned int LOG2_L_TYPE = gr_log2_const<sizeof(@I_TYPE@) * 8>(); - - -@SPTR_NAME@ -gr_make_@BASE_NAME@ (unsigned int bits_per_chunk, gr_endianness_t endianness) -{ - return @SPTR_NAME@ - (new @NAME@ (bits_per_chunk,endianness)); -} - -@NAME@::@NAME@ (unsigned int bits_per_chunk, - gr_endianness_t endianness) - : gr_block ("@BASE_NAME@", - gr_make_io_signature (1, -1, sizeof (@I_TYPE@)), - gr_make_io_signature (1, -1, sizeof (@O_TYPE@))), - d_bits_per_chunk(bits_per_chunk),d_endianness(endianness),d_index(0) -{ - assert (bits_per_chunk <= BITS_PER_TYPE); - assert (bits_per_chunk > 0); - - set_relative_rate ((1.0 * BITS_PER_TYPE) / bits_per_chunk); -} - -void -@NAME@::forecast(int noutput_items, gr_vector_int &ninput_items_required) -{ - - int input_required = (int) ceil((d_index + noutput_items * d_bits_per_chunk) / (1.0 * BITS_PER_TYPE)); - unsigned ninputs = ninput_items_required.size(); - for (unsigned int i = 0; i < ninputs; i++) { - ninput_items_required[i] = input_required; - //printf("Forecast wants %d needs %d\n",noutput_items,ninput_items_required[i]); - } -} - -unsigned int -get_bit_le (const @I_TYPE@ *in_vector,unsigned int bit_addr) -{ - @I_TYPE@ x = in_vector[bit_addr>>LOG2_L_TYPE]; - return (x>>(bit_addr&(BITS_PER_TYPE-1)))&1; -} - -unsigned int -get_bit_be (const @I_TYPE@ *in_vector,unsigned int bit_addr) -{ - @I_TYPE@ x = in_vector[bit_addr>>LOG2_L_TYPE]; - return (x>>((BITS_PER_TYPE-1)-(bit_addr&(BITS_PER_TYPE-1))))&1; -} - -int -@NAME@::general_work (int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) -{ - unsigned int index_tmp = d_index; - - assert (input_items.size() == output_items.size()); - int nstreams = input_items.size(); - - for (int m=0; m < nstreams; m++){ - const @I_TYPE@ *in = (@I_TYPE@ *) input_items[m]; - @O_TYPE@ *out = (@O_TYPE@ *) output_items[m]; - index_tmp = d_index; - - // per stream processing - - switch (d_endianness){ - - case GR_MSB_FIRST: - for (int i = 0; i < noutput_items; i++){ - //printf("here msb %d\n",i); - @O_TYPE@ x = 0; - for(unsigned int j=0; j<d_bits_per_chunk; j++, index_tmp++) - x = (x<<1) | get_bit_be(in, index_tmp); - out[i] = x; - } - break; - - case GR_LSB_FIRST: - for (int i = 0; i < noutput_items; i++){ - //printf("here lsb %d\n",i); - @O_TYPE@ x = 0; - for(unsigned int j=0; j<d_bits_per_chunk; j++, index_tmp++) - x = (x<<1) | get_bit_le(in, index_tmp); - out[i] = x; - } - break; - - default: - assert(0); - } - - //printf("almost got to end\n"); - assert(ninput_items[m] >= (int) ((d_index+(BITS_PER_TYPE-1))>>LOG2_L_TYPE)); - } - - d_index = index_tmp; - consume_each (d_index >> LOG2_L_TYPE); - d_index = d_index & (BITS_PER_TYPE-1); - //printf("got to end\n"); - return noutput_items; -} diff --git a/gnuradio-core/src/lib/gengen/gr_packed_to_unpacked_XX.h.t b/gnuradio-core/src/lib/gengen/gr_packed_to_unpacked_XX.h.t deleted file mode 100644 index e95771b371..0000000000 --- a/gnuradio-core/src/lib/gengen/gr_packed_to_unpacked_XX.h.t +++ /dev/null @@ -1,85 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -// @WARNING@ - -#ifndef @GUARD_NAME@ -#define @GUARD_NAME@ - -#include <gr_core_api.h> -#include <gr_block.h> -#include <gr_endianness.h> - -class @NAME@; -typedef boost::shared_ptr<@NAME@> @SPTR_NAME@; - -GR_CORE_API @SPTR_NAME@ -gr_make_@BASE_NAME@ (unsigned int bits_per_chunk, gr_endianness_t endianness); - -/*! - * \brief Convert a stream of packed bytes or shorts to stream of unpacked bytes or shorts. - * \ingroup converter_blk - * - * input: stream of @I_TYPE@; output: stream of @O_TYPE@ - * - * This is the inverse of gr_unpacked_to_packed_XX. - * - * The bits in the bytes or shorts input stream are grouped into chunks of - * \p bits_per_chunk bits and each resulting chunk is written right- - * justified to the output stream of bytes or shorts. - * All b or 16 bits of the each input bytes or short are processed. - * The right thing is done if bits_per_chunk is not a power of two. - * - * The combination of gr_packed_to_unpacked_XX_ followed by - * gr_chunks_to_symbols_Xf or gr_chunks_to_symbols_Xc handles the - * general case of mapping from a stream of bytes or shorts into - * arbitrary float or complex symbols. - * - * \sa gr_packed_to_unpacked_bb, gr_unpacked_to_packed_bb, - * \sa gr_packed_to_unpacked_ss, gr_unpacked_to_packed_ss, - * \sa gr_chunks_to_symbols_bf, gr_chunks_to_symbols_bc. - * \sa gr_chunks_to_symbols_sf, gr_chunks_to_symbols_sc. - */ - -class GR_CORE_API @NAME@ : public gr_block -{ - friend GR_CORE_API @SPTR_NAME@ - gr_make_@BASE_NAME@ (unsigned int bits_per_chunk, gr_endianness_t endianness); - - @NAME@ (unsigned int bits_per_chunk, gr_endianness_t endianness); - - unsigned int d_bits_per_chunk; - gr_endianness_t d_endianness; - unsigned int d_index; - - public: - void forecast(int noutput_items, gr_vector_int &ninput_items_required); - int general_work (int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - - bool check_topology(int ninputs, int noutputs) { return ninputs == noutputs; } - -}; - -#endif diff --git a/gnuradio-core/src/lib/gengen/gr_packed_to_unpacked_XX.i.t b/gnuradio-core/src/lib/gengen/gr_packed_to_unpacked_XX.i.t deleted file mode 100644 index 1e978956a1..0000000000 --- a/gnuradio-core/src/lib/gengen/gr_packed_to_unpacked_XX.i.t +++ /dev/null @@ -1,33 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2004 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -// @WARNING@ - -GR_SWIG_BLOCK_MAGIC(gr,@BASE_NAME@); - -@SPTR_NAME@ -gr_make_@BASE_NAME@ (unsigned int bits_per_chunk, gr_endianness_t endianness); - -class @NAME@ : public gr_block -{ - @NAME@ (unsigned int bits_per_chunk, gr_endianness_t endianness); -}; diff --git a/gnuradio-core/src/lib/gengen/gr_unpacked_to_packed_XX.cc.t b/gnuradio-core/src/lib/gengen/gr_unpacked_to_packed_XX.cc.t deleted file mode 100644 index ed2b713dbb..0000000000 --- a/gnuradio-core/src/lib/gengen/gr_unpacked_to_packed_XX.cc.t +++ /dev/null @@ -1,129 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2004,2006 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -// @WARNING@ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <@NAME@.h> -#include <gr_io_signature.h> -#include <assert.h> - -static const unsigned int BITS_PER_TYPE = sizeof(@O_TYPE@) * 8; - - -@SPTR_NAME@ -gr_make_@BASE_NAME@ (unsigned int bits_per_chunk, gr_endianness_t endianness) -{ - return @SPTR_NAME@ - (new @NAME@ (bits_per_chunk,endianness)); -} - -@NAME@::@NAME@ (unsigned int bits_per_chunk, - gr_endianness_t endianness) - : gr_block ("@BASE_NAME@", - gr_make_io_signature (1, -1, sizeof (@I_TYPE@)), - gr_make_io_signature (1, -1, sizeof (@O_TYPE@))), - d_bits_per_chunk(bits_per_chunk),d_endianness(endianness),d_index(0) -{ - assert (bits_per_chunk <= BITS_PER_TYPE); - assert (bits_per_chunk > 0); - - set_relative_rate (bits_per_chunk/(1.0 * BITS_PER_TYPE)); -} - -void -@NAME@::forecast(int noutput_items, gr_vector_int &ninput_items_required) -{ - int input_required = (int) ceil( (d_index+noutput_items * 1.0 * BITS_PER_TYPE)/d_bits_per_chunk); - unsigned ninputs = ninput_items_required.size(); - for (unsigned int i = 0; i < ninputs; i++) { - ninput_items_required[i] = input_required; - } -} - -unsigned int -get_bit_be1 (const @I_TYPE@ *in_vector,unsigned int bit_addr, unsigned int bits_per_chunk) { - unsigned int byte_addr = (int)bit_addr/bits_per_chunk; - @I_TYPE@ x = in_vector[byte_addr]; - unsigned int residue = bit_addr - byte_addr * bits_per_chunk; - //printf("Bit addr %d byte addr %d residue %d val %d\n",bit_addr,byte_addr,residue,(x>>(bits_per_chunk-1-residue))&1); - return (x >> (bits_per_chunk-1-residue))&1; -} - -int -@NAME@::general_work (int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) -{ - unsigned int index_tmp = d_index; - - assert (input_items.size() == output_items.size()); - int nstreams = input_items.size(); - - for (int m=0; m< nstreams; m++) { - const @I_TYPE@ *in = (@I_TYPE@ *) input_items[m]; - @O_TYPE@ *out = (@O_TYPE@ *) output_items[m]; - index_tmp=d_index; - - // per stream processing - - //assert((ninput_items[m]-d_index)*d_bits_per_chunk >= noutput_items*BITS_PER_TYPE); - - switch(d_endianness){ - - case GR_MSB_FIRST: - for(int i=0;i<noutput_items;i++) { - @O_TYPE@ tmp=0; - for(unsigned int j=0; j<BITS_PER_TYPE; j++) { - tmp = (tmp<<1) | get_bit_be1(in,index_tmp,d_bits_per_chunk); - index_tmp++; - } - out[i] = tmp; - } - break; - - case GR_LSB_FIRST: - for(int i=0;i<noutput_items;i++) { - unsigned long tmp=0; - for(unsigned int j=0; j<BITS_PER_TYPE; j++) { - tmp = (tmp>>1)| (get_bit_be1(in,index_tmp,d_bits_per_chunk)<<(BITS_PER_TYPE-1)); - index_tmp++; - } - out[i] = tmp; - } - break; - - default: - assert(0); - } - } - - d_index = index_tmp; - consume_each ((int)(d_index/d_bits_per_chunk)); - d_index = d_index%d_bits_per_chunk; - - return noutput_items; -} diff --git a/gnuradio-core/src/lib/gengen/gr_unpacked_to_packed_XX.h.t b/gnuradio-core/src/lib/gengen/gr_unpacked_to_packed_XX.h.t deleted file mode 100644 index a7b7b54df9..0000000000 --- a/gnuradio-core/src/lib/gengen/gr_unpacked_to_packed_XX.h.t +++ /dev/null @@ -1,82 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -// @WARNING@ - -#ifndef @GUARD_NAME@ -#define @GUARD_NAME@ - -#include <gr_core_api.h> -#include <gr_block.h> -#include <gr_endianness.h> - -class @NAME@; -typedef boost::shared_ptr<@NAME@> @NAME@_sptr; - -GR_CORE_API @SPTR_NAME@ -gr_make_@BASE_NAME@ (unsigned int bits_per_chunk, gr_endianness_t endianness); - -/*! - * \brief Convert a stream of unpacked bytes or shorts into a stream of packed bytes or shorts. - * \ingroup converter_blk - * - * input: stream of @I_TYPE@; output: stream of @O_TYPE@ - * - * This is the inverse of gr_packed_to_unpacked_XX. - * - * The low \p bits_per_chunk bits are extracted from each input byte or short. - * These bits are then packed densely into the output bytes or shorts, such that - * all 8 or 16 bits of the output bytes or shorts are filled with valid input bits. - * The right thing is done if bits_per_chunk is not a power of two. - * - * The combination of gr_packed_to_unpacked_XX followed by - * gr_chunks_to_symbols_Xf or gr_chunks_to_symbols_Xc handles the - * general case of mapping from a stream of bytes or shorts into arbitrary float - * or complex symbols. - * - * \sa gr_packed_to_unpacked_bb, gr_unpacked_to_packed_bb, - * \sa gr_packed_to_unpacked_ss, gr_unpacked_to_packed_ss, - * \sa gr_chunks_to_symbols_bf, gr_chunks_to_symbols_bc. - * \sa gr_chunks_to_symbols_sf, gr_chunks_to_symbols_sc. - */ -class GR_CORE_API @NAME@ : public gr_block -{ - friend GR_CORE_API @SPTR_NAME@ - gr_make_@BASE_NAME@ (unsigned int bits_per_chunk, gr_endianness_t endianness); - - @NAME@ (unsigned int bits_per_chunk, gr_endianness_t endianness); - - unsigned int d_bits_per_chunk; - gr_endianness_t d_endianness; - unsigned int d_index; - - public: - void forecast(int noutput_items, gr_vector_int &ninput_items_required); - int general_work (int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - - bool check_topology(int ninputs, int noutputs) { return ninputs == noutputs; } -}; - -#endif diff --git a/gnuradio-core/src/lib/gengen/gr_unpacked_to_packed_XX.i.t b/gnuradio-core/src/lib/gengen/gr_unpacked_to_packed_XX.i.t deleted file mode 100644 index 1e978956a1..0000000000 --- a/gnuradio-core/src/lib/gengen/gr_unpacked_to_packed_XX.i.t +++ /dev/null @@ -1,33 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2004 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -// @WARNING@ - -GR_SWIG_BLOCK_MAGIC(gr,@BASE_NAME@); - -@SPTR_NAME@ -gr_make_@BASE_NAME@ (unsigned int bits_per_chunk, gr_endianness_t endianness); - -class @NAME@ : public gr_block -{ - @NAME@ (unsigned int bits_per_chunk, gr_endianness_t endianness); -}; diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_delay.py b/gnuradio-core/src/python/gnuradio/gr/qa_delay.py deleted file mode 100755 index 0d0bc1330f..0000000000 --- a/gnuradio-core/src/python/gnuradio/gr/qa_delay.py +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/env python -# -# Copyright 2004,2007,2010 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -from gnuradio import gr, gr_unittest -import math - -class test_delay (gr_unittest.TestCase): - - def setUp (self): - self.tb = gr.top_block () - - def tearDown (self): - self.tb = None - - def test_000 (self): - delta_t = 0 - tb = self.tb - src_data = [float(x) for x in range(0, 100)] - expected_result = tuple(delta_t*[0.0] + src_data) - - src = gr.vector_source_f(src_data) - op = gr.delay(gr.sizeof_float, delta_t) - dst = gr.vector_sink_f () - - tb.connect (src, op, dst) - tb.run () - dst_data = dst.data () - self.assertEqual (expected_result, dst_data) - - def test_010 (self): - delta_t = 10 - tb = self.tb - src_data = [float(x) for x in range(0, 100)] - expected_result = tuple(delta_t*[0.0] + src_data) - - src = gr.vector_source_f(src_data) - op = gr.delay(gr.sizeof_float, delta_t) - dst = gr.vector_sink_f () - - tb.connect (src, op, dst) - tb.run () - dst_data = dst.data () - self.assertEqual (expected_result, dst_data) - -if __name__ == '__main__': - gr_unittest.run(test_delay, "test_delay.xml") diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_packed_to_unpacked.py b/gnuradio-core/src/python/gnuradio/gr/qa_packed_to_unpacked.py deleted file mode 100755 index 08accd0ad1..0000000000 --- a/gnuradio-core/src/python/gnuradio/gr/qa_packed_to_unpacked.py +++ /dev/null @@ -1,405 +0,0 @@ -#!/usr/bin/env python -# -# Copyright 2005,2007,2010 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -from gnuradio import gr, gr_unittest -import random - -class test_packing(gr_unittest.TestCase): - - def setUp(self): - self.tb = gr.top_block () - - def tearDown(self): - self.tb = None - - def test_001(self): - """ - Test stream_to_streams. - """ - src_data = (0x80,) - expected_results = (1,0,0,0,0,0,0,0) - src = gr.vector_source_b(src_data,False) - op = gr.packed_to_unpacked_bb(1, gr.GR_MSB_FIRST) - self.tb.connect(src, op) - - dst = gr.vector_sink_b() - self.tb.connect(op, dst) - - self.tb.run() - - self.assertEqual(expected_results, dst.data()) - - def test_002(self): - """ - Test stream_to_streams. - """ - src_data = (0x80,) - expected_results = (0,0,0,0,0,0,0, 1) - src = gr.vector_source_b(src_data,False) - op = gr.packed_to_unpacked_bb(1, gr.GR_LSB_FIRST) - self.tb.connect(src, op) - - dst = gr.vector_sink_b() - self.tb.connect(op, dst) - - self.tb.run() - - self.assertEqual(expected_results, dst.data()) - - def test_003(self): - """ - Test stream_to_streams. - """ - src_data = (0x11,) - expected_results = (4, 2) - src = gr.vector_source_b(src_data,False) - op = gr.packed_to_unpacked_bb(3, gr.GR_LSB_FIRST) - self.tb.connect(src, op) - - dst = gr.vector_sink_b() - self.tb.connect(op, dst) - - self.tb.run() - - self.assertEqual(expected_results, dst.data()) - - def test_004(self): - """ - Test stream_to_streams. - """ - src_data = (0x11,) - expected_results = (0, 4) - src = gr.vector_source_b(src_data,False) - op = gr.packed_to_unpacked_bb(3, gr.GR_MSB_FIRST) - self.tb.connect(src, op) - - dst = gr.vector_sink_b() - self.tb.connect(op, dst) - - self.tb.run() - - self.assertEqual(expected_results, dst.data()) - - def test_005(self): - """ - Test stream_to_streams. - """ - src_data = (1,0,0,0,0,0,1,0,0,1,0,1,1,0,1,0) - expected_results = (0x82,0x5a) - src = gr.vector_source_b(src_data,False) - op = gr.unpacked_to_packed_bb(1, gr.GR_MSB_FIRST) - self.tb.connect(src, op) - - dst = gr.vector_sink_b() - self.tb.connect(op, dst) - - self.tb.run() - - self.assertEqual(expected_results, dst.data()) - - def test_006(self): - """ - Test stream_to_streams. - """ - src_data = (0,1,0,0,0,0,0,1,0,1,0,1,1,0,1,0) - expected_results = (0x82,0x5a) - src = gr.vector_source_b(src_data,False) - op = gr.unpacked_to_packed_bb(1, gr.GR_LSB_FIRST) - self.tb.connect(src, op) - - dst = gr.vector_sink_b() - self.tb.connect(op, dst) - - self.tb.run() - - self.assertEqual(expected_results, dst.data()) - - - def test_007(self): - """ - Test stream_to_streams. - """ - src_data = (4, 2, 0,0,0) - expected_results = (0x11,) - src = gr.vector_source_b(src_data,False) - op = gr.unpacked_to_packed_bb(3, gr.GR_LSB_FIRST) - self.tb.connect(src, op) - - dst = gr.vector_sink_b() - self.tb.connect(op, dst) - - self.tb.run() - - self.assertEqual(expected_results, dst.data()) - - def test_008(self): - """ - Test stream_to_streams. - """ - src_data = (0, 4, 2,0,0) - expected_results = (0x11,) - src = gr.vector_source_b(src_data,False) - op = gr.unpacked_to_packed_bb(3, gr.GR_MSB_FIRST) - self.tb.connect(src, op) - - dst = gr.vector_sink_b() - self.tb.connect(op, dst) - - self.tb.run() - - self.assertEqual(expected_results, dst.data()) - - def test_009(self): - """ - Test stream_to_streams. - """ - - random.seed(0) - src_data = [] - for i in xrange(202): - src_data.append((random.randint(0,255))) - src_data = tuple(src_data) - expected_results = src_data - - src = gr.vector_source_b(tuple(src_data),False) - op1 = gr.packed_to_unpacked_bb(3, gr.GR_MSB_FIRST) - op2 = gr.unpacked_to_packed_bb(3, gr.GR_MSB_FIRST) - self.tb.connect(src, op1, op2) - - dst = gr.vector_sink_b() - self.tb.connect(op2, dst) - - self.tb.run() - - self.assertEqual(expected_results[0:201], dst.data()) - - def test_010(self): - """ - Test stream_to_streams. - """ - - random.seed(0) - src_data = [] - for i in xrange(56): - src_data.append((random.randint(0,255))) - src_data = tuple(src_data) - expected_results = src_data - src = gr.vector_source_b(tuple(src_data),False) - op1 = gr.packed_to_unpacked_bb(7, gr.GR_MSB_FIRST) - op2 = gr.unpacked_to_packed_bb(7, gr.GR_MSB_FIRST) - self.tb.connect(src, op1, op2) - dst = gr.vector_sink_b() - self.tb.connect(op2, dst) - - self.tb.run() - self.assertEqual(expected_results[0:201], dst.data()) - - def test_011(self): - """ - Test stream_to_streams. - """ - - random.seed(0) - src_data = [] - for i in xrange(56): - src_data.append((random.randint(0,255))) - src_data = tuple(src_data) - expected_results = src_data - src = gr.vector_source_b(tuple(src_data),False) - op1 = gr.packed_to_unpacked_bb(7, gr.GR_LSB_FIRST) - op2 = gr.unpacked_to_packed_bb(7, gr.GR_LSB_FIRST) - self.tb.connect(src, op1, op2) - dst = gr.vector_sink_b() - self.tb.connect(op2, dst) - - self.tb.run() - self.assertEqual(expected_results[0:201], dst.data()) - - - # tests on shorts - - def test_100a(self): - """ - test short version - """ - random.seed(0) - src_data = [] - for i in xrange(100): - src_data.append((random.randint(-2**15,2**15-1))) - src_data = tuple(src_data) - expected_results = src_data - src = gr.vector_source_s(tuple(src_data),False) - op1 = gr.packed_to_unpacked_ss(1, gr.GR_MSB_FIRST) - op2 = gr.unpacked_to_packed_ss(1, gr.GR_MSB_FIRST) - self.tb.connect(src, op1, op2) - dst = gr.vector_sink_s() - self.tb.connect(op2, dst) - - self.tb.run() - self.assertEqual(expected_results, dst.data()) - - def test_100b(self): - """ - test short version - """ - random.seed(0) - src_data = [] - for i in xrange(100): - src_data.append((random.randint(-2**15,2**15-1))) - src_data = tuple(src_data) - expected_results = src_data - src = gr.vector_source_s(tuple(src_data),False) - op1 = gr.packed_to_unpacked_ss(1, gr.GR_LSB_FIRST) - op2 = gr.unpacked_to_packed_ss(1, gr.GR_LSB_FIRST) - self.tb.connect(src, op1, op2) - dst = gr.vector_sink_s() - self.tb.connect(op2, dst) - - self.tb.run() - self.assertEqual(expected_results, dst.data()) - - def test_101a(self): - """ - test short version - """ - random.seed(0) - src_data = [] - for i in xrange(100): - src_data.append((random.randint(-2**15,2**15-1))) - src_data = tuple(src_data) - expected_results = src_data - src = gr.vector_source_s(tuple(src_data),False) - op1 = gr.packed_to_unpacked_ss(8, gr.GR_MSB_FIRST) - op2 = gr.unpacked_to_packed_ss(8, gr.GR_MSB_FIRST) - self.tb.connect(src, op1, op2) - dst = gr.vector_sink_s() - self.tb.connect(op2, dst) - - self.tb.run() - self.assertEqual(expected_results, dst.data()) - - def test_101b(self): - """ - test short version - """ - random.seed(0) - src_data = [] - for i in xrange(100): - src_data.append((random.randint(-2**15,2**15-1))) - src_data = tuple(src_data) - expected_results = src_data - src = gr.vector_source_s(tuple(src_data),False) - op1 = gr.packed_to_unpacked_ss(8, gr.GR_LSB_FIRST) - op2 = gr.unpacked_to_packed_ss(8, gr.GR_LSB_FIRST) - self.tb.connect(src, op1, op2) - dst = gr.vector_sink_s() - self.tb.connect(op2, dst) - - self.tb.run() - self.assertEqual(expected_results, dst.data()) - - # tests on ints - - def test_200a(self): - """ - test int version - """ - random.seed(0) - src_data = [] - for i in xrange(100): - src_data.append((random.randint(-2**31,2**31-1))) - src_data = tuple(src_data) - expected_results = src_data - src = gr.vector_source_i(tuple(src_data),False) - op1 = gr.packed_to_unpacked_ii(1, gr.GR_MSB_FIRST) - op2 = gr.unpacked_to_packed_ii(1, gr.GR_MSB_FIRST) - self.tb.connect(src, op1, op2) - dst = gr.vector_sink_i() - self.tb.connect(op2, dst) - - self.tb.run() - self.assertEqual(expected_results, dst.data()) - - def test_200b(self): - """ - test int version - """ - random.seed(0) - src_data = [] - for i in xrange(100): - src_data.append((random.randint(-2**31,2**31-1))) - src_data = tuple(src_data) - expected_results = src_data - src = gr.vector_source_i(tuple(src_data),False) - op1 = gr.packed_to_unpacked_ii(1, gr.GR_LSB_FIRST) - op2 = gr.unpacked_to_packed_ii(1, gr.GR_LSB_FIRST) - self.tb.connect(src, op1, op2) - dst = gr.vector_sink_i() - self.tb.connect(op2, dst) - - self.tb.run() - self.assertEqual(expected_results, dst.data()) - - def test_201a(self): - """ - test int version - """ - random.seed(0) - src_data = [] - for i in xrange(100): - src_data.append((random.randint(-2**31,2**31-1))) - src_data = tuple(src_data) - expected_results = src_data - src = gr.vector_source_i(tuple(src_data),False) - op1 = gr.packed_to_unpacked_ii(8, gr.GR_MSB_FIRST) - op2 = gr.unpacked_to_packed_ii(8, gr.GR_MSB_FIRST) - self.tb.connect(src, op1, op2) - dst = gr.vector_sink_i() - self.tb.connect(op2, dst) - - self.tb.run() - self.assertEqual(expected_results, dst.data()) - - def test_201b(self): - """ - test int version - """ - random.seed(0) - src_data = [] - for i in xrange(100): - src_data.append((random.randint(-2**31,2**31-1))) - src_data = tuple(src_data) - expected_results = src_data - src = gr.vector_source_i(tuple(src_data),False) - op1 = gr.packed_to_unpacked_ii(8, gr.GR_LSB_FIRST) - op2 = gr.unpacked_to_packed_ii(8, gr.GR_LSB_FIRST) - self.tb.connect(src, op1, op2) - dst = gr.vector_sink_i() - self.tb.connect(op2, dst) - - self.tb.run() - self.assertEqual(expected_results, dst.data()) - - -if __name__ == '__main__': - gr_unittest.run(test_packing, "test_packing.xml") - |