diff options
author | Johnathan Corgan <johnathan@corganlabs.com> | 2016-09-03 08:49:52 -0700 |
---|---|---|
committer | Johnathan Corgan <johnathan@corganlabs.com> | 2016-09-03 08:49:52 -0700 |
commit | 800acf31f56311ded2ba75283ca0123c48f0f305 (patch) | |
tree | d5bb377d719f8f5b445830c068ac3e16e35e124d | |
parent | 0f641e009eccc0c79adc07938db22ea3978e60a5 (diff) |
blocks: remove gr::blocks::message_burst_source
-rw-r--r-- | gr-blocks/grc/blocks_block_tree.xml | 1 | ||||
-rw-r--r-- | gr-blocks/grc/blocks_message_burst_source.xml | 58 | ||||
-rw-r--r-- | gr-blocks/include/gnuradio/blocks/CMakeLists.txt | 1 | ||||
-rw-r--r-- | gr-blocks/include/gnuradio/blocks/message_burst_source.h | 52 | ||||
-rw-r--r-- | gr-blocks/lib/CMakeLists.txt | 1 | ||||
-rw-r--r-- | gr-blocks/lib/message_burst_source_impl.cc | 149 | ||||
-rw-r--r-- | gr-blocks/lib/message_burst_source_impl.h | 58 | ||||
-rw-r--r-- | gr-blocks/swig/blocks_swig0.i | 3 |
8 files changed, 0 insertions, 323 deletions
diff --git a/gr-blocks/grc/blocks_block_tree.xml b/gr-blocks/grc/blocks_block_tree.xml index 56a2b9f163..cb9ad639c6 100644 --- a/gr-blocks/grc/blocks_block_tree.xml +++ b/gr-blocks/grc/blocks_block_tree.xml @@ -122,7 +122,6 @@ </cat> <cat> <name>Message Tools</name> - <block>blocks_message_burst_source</block> <block>blocks_message_strobe</block> <block>blocks_message_strobe_random</block> <block>blocks_message_debug</block> diff --git a/gr-blocks/grc/blocks_message_burst_source.xml b/gr-blocks/grc/blocks_message_burst_source.xml deleted file mode 100644 index 208955e557..0000000000 --- a/gr-blocks/grc/blocks_message_burst_source.xml +++ /dev/null @@ -1,58 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##Message Burst Source (the sink port is a message) -################################################### - --> -<block> - <name>Message Burst Source</name> - <key>blocks_message_burst_source</key> - <import>from gnuradio import blocks</import> - <make>blocks.message_burst_source($type.size*$vlen, $(id)_msgq_in)</make> - <param> - <name>Output Type</name> - <key>type</key> - <type>enum</type> - <option> - <name>Complex</name> - <key>complex</key> - <opt>size:gr.sizeof_gr_complex</opt> - </option> - <option> - <name>Float</name> - <key>float</key> - <opt>size:gr.sizeof_float</opt> - </option> - <option> - <name>Int</name> - <key>int</key> - <opt>size:gr.sizeof_int</opt> - </option> - <option> - <name>Short</name> - <key>short</key> - <opt>size:gr.sizeof_short</opt> - </option> - <option> - <name>Byte</name> - <key>byte</key> - <opt>size:gr.sizeof_char</opt> - </option> - </param> - <param> - <name>Vec Length</name> - <key>vlen</key> - <value>1</value> - <type>int</type> - </param> - <check>$vlen > 0</check> - <sink> - <name>in</name> - <type>msg</type> - </sink> - <source> - <name>out</name> - <type>$type</type> - <vlen>$vlen</vlen> - </source> -</block> diff --git a/gr-blocks/include/gnuradio/blocks/CMakeLists.txt b/gr-blocks/include/gnuradio/blocks/CMakeLists.txt index 9a8c96aa59..d566b3da67 100644 --- a/gr-blocks/include/gnuradio/blocks/CMakeLists.txt +++ b/gr-blocks/include/gnuradio/blocks/CMakeLists.txt @@ -122,7 +122,6 @@ install(FILES message_debug.h message_strobe.h message_strobe_random.h - message_burst_source.h multiply_cc.h multiply_ff.h multiply_conjugate_cc.h diff --git a/gr-blocks/include/gnuradio/blocks/message_burst_source.h b/gr-blocks/include/gnuradio/blocks/message_burst_source.h deleted file mode 100644 index b5c068dcd4..0000000000 --- a/gr-blocks/include/gnuradio/blocks/message_burst_source.h +++ /dev/null @@ -1,52 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2012-2013 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_MESSAGE_BURST_SOURCE_H -#define INCLUDED_GR_MESSAGE_BURST_SOURCE_H - -#include <gnuradio/blocks/api.h> -#include <gnuradio/sync_block.h> -#include <gnuradio/msg_queue.h> - -namespace gr { - namespace blocks { - - /*! - * \brief Turn received messages into a stream and tag them for UHD to send. - * \ingroup message_tools_blk - */ - class BLOCKS_API message_burst_source : virtual public sync_block - { - public: - // gr::blocks::message_source::sptr - typedef boost::shared_ptr<message_burst_source> sptr; - - static sptr make(size_t itemsize, int msgq_limit); - static sptr make(size_t itemsize, gr::msg_queue::sptr msgq); - - virtual gr::msg_queue::sptr msgq() const = 0; - }; - - } /* namespace blocks */ -} /* namespace gr */ - -#endif /* INCLUDED_GR_MESSAGE_BURST_SOURCE_H */ diff --git a/gr-blocks/lib/CMakeLists.txt b/gr-blocks/lib/CMakeLists.txt index 96fe7c0258..1f3b0ee041 100644 --- a/gr-blocks/lib/CMakeLists.txt +++ b/gr-blocks/lib/CMakeLists.txt @@ -142,7 +142,6 @@ list(APPEND gr_blocks_sources message_debug_impl.cc message_strobe_impl.cc message_strobe_random_impl.cc - message_burst_source_impl.cc multiply_cc_impl.cc multiply_ff_impl.cc multiply_conjugate_cc_impl.cc diff --git a/gr-blocks/lib/message_burst_source_impl.cc b/gr-blocks/lib/message_burst_source_impl.cc deleted file mode 100644 index 0ce0a9284f..0000000000 --- a/gr-blocks/lib/message_burst_source_impl.cc +++ /dev/null @@ -1,149 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2012-2013 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 "message_burst_source_impl.h" -#include <gnuradio/io_signature.h> -#include <cstdio> -#include <errno.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <fcntl.h> -#include <stdexcept> -#include <string.h> -#include <gnuradio/tags.h> - -namespace gr { - namespace blocks { - - message_burst_source::sptr - message_burst_source::make(size_t itemsize, int msgq_limit) - { - return gnuradio::get_initial_sptr - (new message_burst_source_impl(itemsize, msgq_limit)); - } - - message_burst_source::sptr - message_burst_source::make(size_t itemsize, msg_queue::sptr msgq) - { - return gnuradio::get_initial_sptr - (new message_burst_source_impl(itemsize, msgq)); - } - - message_burst_source_impl::message_burst_source_impl(size_t itemsize, int msgq_limit) - : sync_block("message_burst_source", - io_signature::make(0, 0, 0), - io_signature::make(1, 1, itemsize)), - d_itemsize(itemsize), d_msgq(msg_queue::make(msgq_limit)), - d_msg_offset(0), d_eof(false) - { - std::stringstream id; - id << name() << unique_id(); - d_me = pmt::string_to_symbol(id.str()); - } - - message_burst_source_impl::message_burst_source_impl(size_t itemsize, msg_queue::sptr msgq) - : sync_block("message_burst_source", - io_signature::make(0, 0, 0), - io_signature::make(1, 1, itemsize)), - d_itemsize(itemsize), d_msgq(msgq), - d_msg_offset(0), d_eof(false) - { - std::stringstream id; - id << name() << unique_id(); - d_me = pmt::string_to_symbol(id.str()); - } - - message_burst_source_impl::~message_burst_source_impl() - { - } - - int - message_burst_source_impl::work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) - { - char *out = (char*)output_items[0]; - int nn = 0; - - uint64_t abs_sample_count = nitems_written(0); - - while(nn < noutput_items) { - if(d_msg) { - // - // Consume whatever we can from the current message - // - - int mm = std::min(noutput_items - nn, - (int)((d_msg->length() - d_msg_offset) / d_itemsize)); - memcpy(out, &(d_msg->msg()[d_msg_offset]), mm * d_itemsize); - - nn += mm; - out += mm * d_itemsize; - d_msg_offset += mm * d_itemsize; - assert(d_msg_offset <= d_msg->length()); - - if(d_msg_offset == d_msg->length()) { - if(d_msg->type() == 1) // type == 1 sets EOF - d_eof = true; - d_msg.reset(); - //tag end of burst - add_item_tag(0, //stream ID - abs_sample_count+nn-1, //sample number - pmt::string_to_symbol("tx_eob"), - pmt::from_bool(1), - d_me); //block src id - } - } - else { - // - // No current message - // - if(d_msgq->empty_p() && nn > 0) { // no more messages in the queue, return what we've got - break; - } - - if(d_eof) - return -1; - - d_msg = d_msgq->delete_head(); // block, waiting for a message - d_msg_offset = 0; - //tag start of burst - add_item_tag(0, //stream ID - abs_sample_count+nn, //sample number - pmt::string_to_symbol("tx_sob"), - pmt::from_bool(1), - d_me); //block src id - - if((d_msg->length() % d_itemsize) != 0) - throw std::runtime_error("msg length is not a multiple of d_itemsize"); - } - } - - return nn; - } - - } /* namespace blocks */ -} /* namespace gr */ diff --git a/gr-blocks/lib/message_burst_source_impl.h b/gr-blocks/lib/message_burst_source_impl.h deleted file mode 100644 index a389a23942..0000000000 --- a/gr-blocks/lib/message_burst_source_impl.h +++ /dev/null @@ -1,58 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2012-2013 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_MESSAGE_BURST_SOURCE_IMPL_H -#define INCLUDED_GR_MESSAGE_BURST_SOURCE_IMPL_H - -#include <gnuradio/blocks/message_burst_source.h> -#include <gnuradio/message.h> - -namespace gr { - namespace blocks { - - class message_burst_source_impl : public message_burst_source - { - private: - size_t d_itemsize; - msg_queue::sptr d_msgq; - message::sptr d_msg; - unsigned d_msg_offset; - bool d_eof; - - pmt::pmt_t d_me; - - public: - message_burst_source_impl(size_t itemsize, int msgq_limit); - message_burst_source_impl(size_t itemsize, msg_queue::sptr msgq); - ~message_burst_source_impl(); - - msg_queue::sptr msgq() const { return d_msgq; } - - int work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - }; - - } /* namespace blocks */ -} /* namespace gr */ - -#endif /* INCLUDED_GR_MESSAGE_BURST_SOURCE_IMPL_H */ diff --git a/gr-blocks/swig/blocks_swig0.i b/gr-blocks/swig/blocks_swig0.i index 25ce2faea7..23efa7432f 100644 --- a/gr-blocks/swig/blocks_swig0.i +++ b/gr-blocks/swig/blocks_swig0.i @@ -45,7 +45,6 @@ #include "gnuradio/blocks/message_debug.h" #include "gnuradio/blocks/message_strobe.h" #include "gnuradio/blocks/message_strobe_random.h" -#include "gnuradio/blocks/message_burst_source.h" #include "gnuradio/blocks/nop.h" #include "gnuradio/blocks/null_sink.h" #include "gnuradio/blocks/null_source.h" @@ -69,7 +68,6 @@ %include "gnuradio/blocks/message_debug.h" %include "gnuradio/blocks/message_strobe.h" %include "gnuradio/blocks/message_strobe_random.h" -%include "gnuradio/blocks/message_burst_source.h" %include "gnuradio/blocks/nop.h" %include "gnuradio/blocks/null_sink.h" %include "gnuradio/blocks/null_source.h" @@ -90,7 +88,6 @@ GR_SWIG_BLOCK_MAGIC2(blocks, head); GR_SWIG_BLOCK_MAGIC2(blocks, message_debug); GR_SWIG_BLOCK_MAGIC2(blocks, message_strobe); GR_SWIG_BLOCK_MAGIC2(blocks, message_strobe_random); -GR_SWIG_BLOCK_MAGIC2(blocks, message_burst_source); GR_SWIG_BLOCK_MAGIC2(blocks, nop); GR_SWIG_BLOCK_MAGIC2(blocks, null_sink); GR_SWIG_BLOCK_MAGIC2(blocks, null_source); |