diff options
author | Tom Rondeau <trondeau@vt.edu> | 2013-03-06 22:38:10 -0500 |
---|---|---|
committer | Tom Rondeau <trondeau@vt.edu> | 2013-03-06 22:38:10 -0500 |
commit | f075c96fbaab7ee69255871d27ba849a53793729 (patch) | |
tree | ac4345847af26c878b9d463564693c384fbcbb08 /gnuradio-core/src/lib | |
parent | 65700040d6b11da91e681e33f3b5368e2a294eb5 (diff) |
blocks: removing burst_tagger from core; now in gr-blocks.
Diffstat (limited to 'gnuradio-core/src/lib')
-rw-r--r-- | gnuradio-core/src/lib/general/CMakeLists.txt | 1 | ||||
-rw-r--r-- | gnuradio-core/src/lib/general/general.i | 2 | ||||
-rw-r--r-- | gnuradio-core/src/lib/general/gr_burst_tagger.cc | 109 | ||||
-rw-r--r-- | gnuradio-core/src/lib/general/gr_burst_tagger.h | 64 | ||||
-rw-r--r-- | gnuradio-core/src/lib/general/gr_burst_tagger.i | 35 |
5 files changed, 0 insertions, 211 deletions
diff --git a/gnuradio-core/src/lib/general/CMakeLists.txt b/gnuradio-core/src/lib/general/CMakeLists.txt index f9e12cfdcf..bbc6a7612b 100644 --- a/gnuradio-core/src/lib/general/CMakeLists.txt +++ b/gnuradio-core/src/lib/general/CMakeLists.txt @@ -164,7 +164,6 @@ set(gr_core_general_triple_threats gr_annotator_alltoall gr_annotator_1to1 gr_annotator_raw - gr_burst_tagger ) if(ENABLE_GR_CTRLPORT) diff --git a/gnuradio-core/src/lib/general/general.i b/gnuradio-core/src/lib/general/general.i index f824d9aba0..f7f7942577 100644 --- a/gnuradio-core/src/lib/general/general.i +++ b/gnuradio-core/src/lib/general/general.i @@ -49,7 +49,6 @@ #include <gr_annotator_alltoall.h> #include <gr_annotator_1to1.h> #include <gr_annotator_raw.h> -#include <gr_burst_tagger.h> #include <gr_vector_map.h> %} @@ -80,7 +79,6 @@ %include "gr_annotator_alltoall.i" %include "gr_annotator_1to1.i" %include "gr_annotator_raw.i" -%include "gr_burst_tagger.i" %include "gr_vector_map.i" %include "gr_block_gateway.i" diff --git a/gnuradio-core/src/lib/general/gr_burst_tagger.cc b/gnuradio-core/src/lib/general/gr_burst_tagger.cc deleted file mode 100644 index 72924109bf..0000000000 --- a/gnuradio-core/src/lib/general/gr_burst_tagger.cc +++ /dev/null @@ -1,109 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 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_burst_tagger.h> -#include <gr_io_signature.h> -#include <string.h> - -gr_burst_tagger_sptr -gr_make_burst_tagger(size_t itemsize) -{ - return gnuradio::get_initial_sptr(new gr_burst_tagger(itemsize)); -} - -gr_burst_tagger::gr_burst_tagger(size_t itemsize) - : gr_sync_block ("burst_tagger", - gr_make_io_signature2 (2, 2, itemsize, sizeof(short)), - gr_make_io_signature (1, 1, itemsize)), - d_itemsize(itemsize), d_state(false) -{ - std::stringstream str; - str << name() << unique_id(); - - d_true_key = pmt::string_to_symbol("burst"); - d_true_value = pmt::PMT_T; - - d_false_key = pmt::string_to_symbol("burst"); - d_false_value = pmt::PMT_F; - - d_id = pmt::string_to_symbol(str.str()); -} - -void -gr_burst_tagger::set_true_tag (const std::string &key, bool value) -{ - d_true_key = pmt::string_to_symbol(key); - if(value == true) { - d_true_value = pmt::PMT_T; - } - else { - d_true_value = pmt::PMT_F; - } -} - -void -gr_burst_tagger::set_false_tag (const std::string &key, bool value) -{ - d_false_key = pmt::string_to_symbol(key); - if(value == true) { - d_false_value = pmt::PMT_T; - } - else { - d_false_value = pmt::PMT_F; - } -} - -gr_burst_tagger::~gr_burst_tagger() -{ -} - -int -gr_burst_tagger::work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) -{ - const char *signal = (const char*)input_items[0]; - const short *trigger = (const short*)input_items[1]; - char *out = (char*)output_items[0]; - - memcpy(out, signal, noutput_items * d_itemsize); - - for(int i = 0; i < noutput_items; i++) { - if(trigger[i] > 0) { - if(d_state == false) { - d_state = true; - add_item_tag(0, nitems_written(0)+i, d_true_key, d_true_value, d_id); - } - } - else { - if(d_state == true) { - d_state = false; - add_item_tag(0, nitems_written(0)+i, d_false_key, d_false_value, d_id); - } - } - } - return noutput_items; -} diff --git a/gnuradio-core/src/lib/general/gr_burst_tagger.h b/gnuradio-core/src/lib/general/gr_burst_tagger.h deleted file mode 100644 index 9a7898b043..0000000000 --- a/gnuradio-core/src/lib/general/gr_burst_tagger.h +++ /dev/null @@ -1,64 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 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. - */ - -#ifndef INCLUDED_GR_BURST_TAGGER_H -#define INCLUDED_GR_BURST_TAGGER_H - -#include <gr_core_api.h> -#include <gr_sync_block.h> - -class gr_burst_tagger; -typedef boost::shared_ptr<gr_burst_tagger> gr_burst_tagger_sptr; - -GR_CORE_API gr_burst_tagger_sptr gr_make_burst_tagger(size_t itemsize); - -/*! - * \brief output[i] = input[i] - * \ingroup misc_blk - * - */ -class GR_CORE_API gr_burst_tagger : public gr_sync_block -{ - size_t d_itemsize; - bool d_state; - pmt::pmt_t d_true_key; - pmt::pmt_t d_true_value; - - pmt::pmt_t d_false_key; - pmt::pmt_t d_false_value; - - pmt::pmt_t d_id; - - friend GR_CORE_API gr_burst_tagger_sptr gr_make_burst_tagger(size_t itemsize); - gr_burst_tagger(size_t itemsize); - - public: - ~gr_burst_tagger(); - void set_true_tag (const std::string &key, bool value); - void set_false_tag (const std::string &key, bool value); - - int work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); -}; - -#endif diff --git a/gnuradio-core/src/lib/general/gr_burst_tagger.i b/gnuradio-core/src/lib/general/gr_burst_tagger.i deleted file mode 100644 index a5511e48ad..0000000000 --- a/gnuradio-core/src/lib/general/gr_burst_tagger.i +++ /dev/null @@ -1,35 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 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. - */ - -GR_SWIG_BLOCK_MAGIC(gr,burst_tagger) - -gr_burst_tagger_sptr gr_make_burst_tagger(size_t itemsize); - -class gr_burst_tagger : public gr_sync_block -{ - private: - gr_burst_tagger(size_t itemsize); - - public: - void set_true_tag(const std::string &key, bool value); - void set_false_tag(const std::string &key, bool value); -}; |