diff options
author | Tom Rondeau <trondeau@vt.edu> | 2013-03-06 18:06:32 -0500 |
---|---|---|
committer | Tom Rondeau <trondeau@vt.edu> | 2013-03-06 18:06:32 -0500 |
commit | e848923bbb827427ccc27984a9e130de8c17a7e6 (patch) | |
tree | 0421521cf3ed4539f60edf29ba7645ff94fd0ccd | |
parent | a8245890a789cdb70868df57730170f57dc3668e (diff) |
blocks: removing gr_tag_debug from core; now in gr-blocks.
Also removes stray reference to gri_fft.h.
-rw-r--r-- | gnuradio-core/src/lib/general/CMakeLists.txt | 2 | ||||
-rw-r--r-- | gnuradio-core/src/lib/general/general.i | 2 | ||||
-rw-r--r-- | gnuradio-core/src/lib/general/gr_tag_debug.cc | 104 | ||||
-rw-r--r-- | gnuradio-core/src/lib/general/gr_tag_debug.h | 85 | ||||
-rw-r--r-- | gnuradio-core/src/lib/general/gr_tag_debug.i | 35 | ||||
-rwxr-xr-x | gnuradio-core/src/python/gnuradio/gr/qa_tag_debug.py | 43 | ||||
-rw-r--r-- | gr-blocks/examples/metadata/file_metadata_source.grc | 6 | ||||
-rw-r--r-- | gr-blocks/examples/metadata/file_metadata_vector_source.grc | 6 | ||||
-rw-r--r-- | gr-blocks/python/qa_file_metadata.py | 4 | ||||
-rwxr-xr-x | gr-blocks/python/qa_pdu.py | 2 | ||||
-rw-r--r-- | grc/blocks/block_tree.xml | 1 | ||||
-rw-r--r-- | grc/blocks/gr_tag_debug.xml | 82 |
12 files changed, 9 insertions, 363 deletions
diff --git a/gnuradio-core/src/lib/general/CMakeLists.txt b/gnuradio-core/src/lib/general/CMakeLists.txt index 55593aed40..779064a900 100644 --- a/gnuradio-core/src/lib/general/CMakeLists.txt +++ b/gnuradio-core/src/lib/general/CMakeLists.txt @@ -114,7 +114,6 @@ install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/gri_add_const_ss.h ${CMAKE_CURRENT_SOURCE_DIR}/gri_control_loop.h ${CMAKE_CURRENT_SOURCE_DIR}/gri_debugger_hook.h - ${CMAKE_CURRENT_SOURCE_DIR}/gri_fft.h ${CMAKE_CURRENT_SOURCE_DIR}/gri_lfsr_15_1_0.h ${CMAKE_CURRENT_SOURCE_DIR}/gri_lfsr_32k.h ${CMAKE_CURRENT_SOURCE_DIR}/malloc16.h @@ -167,7 +166,6 @@ set(gr_core_general_triple_threats gr_annotator_1to1 gr_annotator_raw gr_burst_tagger - gr_tag_debug ) if(ENABLE_GR_CTRLPORT) diff --git a/gnuradio-core/src/lib/general/general.i b/gnuradio-core/src/lib/general/general.i index b67530cc33..f824d9aba0 100644 --- a/gnuradio-core/src/lib/general/general.i +++ b/gnuradio-core/src/lib/general/general.i @@ -51,7 +51,6 @@ #include <gr_annotator_raw.h> #include <gr_burst_tagger.h> #include <gr_vector_map.h> -#include <gr_tag_debug.h> %} %include "gri_control_loop.i" @@ -83,7 +82,6 @@ %include "gr_annotator_raw.i" %include "gr_burst_tagger.i" %include "gr_vector_map.i" -%include "gr_tag_debug.i" %include "gr_block_gateway.i" diff --git a/gnuradio-core/src/lib/general/gr_tag_debug.cc b/gnuradio-core/src/lib/general/gr_tag_debug.cc deleted file mode 100644 index 9c66e890af..0000000000 --- a/gnuradio-core/src/lib/general/gr_tag_debug.cc +++ /dev/null @@ -1,104 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 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_tag_debug.h> -#include <gr_io_signature.h> -#include <iostream> -#include <iomanip> - -gr_tag_debug_sptr -gr_make_tag_debug(size_t sizeof_stream_item, const std::string &name) -{ - return gnuradio::get_initial_sptr - (new gr_tag_debug(sizeof_stream_item, name)); -} - -gr_tag_debug::gr_tag_debug(size_t sizeof_stream_item, const std::string &name) - : gr_sync_block("tag_debug", - gr_make_io_signature(1, -1, sizeof_stream_item), - gr_make_io_signature(0, 0, 0)), - d_name(name), d_display(true) -{ -} - -std::vector<gr_tag_t> -gr_tag_debug::current_tags() -{ - gruel::scoped_lock l(d_mutex); - return d_tags; -} - -void -gr_tag_debug::set_display(bool d) -{ - gruel::scoped_lock l(d_mutex); - d_display = d; -} - -int -gr_tag_debug::work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) -{ - gruel::scoped_lock l(d_mutex); - - std::stringstream sout; - if(d_display) { - sout << std::endl - << "----------------------------------------------------------------------"; - sout << std::endl << "Tag Debug: " << d_name << std::endl; - } - - uint64_t abs_N, end_N; - for(size_t i = 0; i < input_items.size(); i++) { - abs_N = nitems_read(i); - end_N = abs_N + (uint64_t)(noutput_items); - - d_tags.clear(); - get_tags_in_range(d_tags, i, abs_N, end_N); - - if(d_display) { - sout << "Input Stream: " << std::setw(2) << std::setfill('0') << i << std::setfill(' ') << std::endl; - for(d_tags_itr = d_tags.begin(); d_tags_itr != d_tags.end(); d_tags_itr++) { - sout << std::setw(10) << "Offset: " << d_tags_itr->offset - << std::setw(10) << "Source: " << (pmt::is_symbol(d_tags_itr->srcid) ? pmt::symbol_to_string(d_tags_itr->srcid) : "n/a") - << std::setw(10) << "Key: " << pmt::symbol_to_string(d_tags_itr->key) - << std::setw(10) << "Value: "; - sout << d_tags_itr->value << std::endl; - } - } - } - - if(d_display) { - sout << "----------------------------------------------------------------------"; - sout << std::endl; - - if(d_tags.size() > 0) - std::cout << sout.str(); - } - - return noutput_items; -} diff --git a/gnuradio-core/src/lib/general/gr_tag_debug.h b/gnuradio-core/src/lib/general/gr_tag_debug.h deleted file mode 100644 index 57578884a8..0000000000 --- a/gnuradio-core/src/lib/general/gr_tag_debug.h +++ /dev/null @@ -1,85 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 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_TAG_DEBUG_H -#define INCLUDED_GR_TAG_DEBUG_H - -#include <gr_core_api.h> -#include <gr_sync_block.h> -#include <gruel/thread.h> -#include <stddef.h> - -class gr_tag_debug; -typedef boost::shared_ptr<gr_tag_debug> gr_tag_debug_sptr; - -GR_CORE_API gr_tag_debug_sptr -gr_make_tag_debug(size_t sizeof_stream_item, const std::string &name); - -/*! - * \brief Bit bucket that prints out any tag received. - * \ingroup sink_blk - * - * This block collects all tags sent to it on all input ports and - * displays them to stdout in a formatted way. The \p name parameter - * is used to identify which debug sink generated the tag, so when - * connecting a block to this debug sink, an appropriate name is - * something that identifies the input block. - * - * This block otherwise acts as a NULL sink in that items from the - * input stream are ignored. It is designed to be able to attach to - * any block and watch all tags streaming out of that block for - * debugging purposes. - * - * The tags from the last call to this work function are stored and - * can be retrieved using the function 'current_tags'. - */ -class GR_CORE_API gr_tag_debug : public gr_sync_block -{ - private: - friend GR_CORE_API gr_tag_debug_sptr - gr_make_tag_debug(size_t sizeof_stream_item, const std::string &name); - gr_tag_debug(size_t sizeof_stream_item, const std::string &name); - - std::string d_name; - std::vector<gr_tag_t> d_tags; - std::vector<gr_tag_t>::iterator d_tags_itr; - bool d_display; - gruel::mutex d_mutex; - - public: - /*! - * \brief Returns a vector of gr_tag_t items as of the last call to - * work. - */ - std::vector<gr_tag_t> current_tags(); - - /*! - * \brief Set the display of tags to stdout on/off. - */ - void set_display(bool d); - - int work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); -}; - -#endif /* INCLUDED_GR_TAG_DEBUG_H */ diff --git a/gnuradio-core/src/lib/general/gr_tag_debug.i b/gnuradio-core/src/lib/general/gr_tag_debug.i deleted file mode 100644 index 3af1bdcfef..0000000000 --- a/gnuradio-core/src/lib/general/gr_tag_debug.i +++ /dev/null @@ -1,35 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 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. - */ - -GR_SWIG_BLOCK_MAGIC(gr,tag_debug) - -%include <gr_tags.i> - -gr_tag_debug_sptr -gr_make_tag_debug(size_t sizeof_stream_item, const std::string &name); - -class gr_tag_debug : public gr_sync_block -{ -public: - std::vector<gr_tag_t> current_tags(); - void set_display(bool d); -}; diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_tag_debug.py b/gnuradio-core/src/python/gnuradio/gr/qa_tag_debug.py deleted file mode 100755 index 81babca048..0000000000 --- a/gnuradio-core/src/python/gnuradio/gr/qa_tag_debug.py +++ /dev/null @@ -1,43 +0,0 @@ -#!/usr/bin/env python -# -# Copyright 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. -# - -from gnuradio import gr, gr_unittest - -class test_tag_debug(gr_unittest.TestCase): - - def setUp(self): - self.tb = gr.top_block() - - def tearDown(self): - self.tb = None - - def test_001(self): - # Just run some data through and make sure it doesn't puke. - src_data = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10) - src = gr.vector_source_i(src_data) - op = gr.tag_debug(gr.sizeof_int, "tag QA") - self.tb.connect(src, op) - self.tb.run() - x = op.current_tags() - -if __name__ == '__main__': - gr_unittest.run(test_tag_debug, "test_tag_debug.xml") diff --git a/gr-blocks/examples/metadata/file_metadata_source.grc b/gr-blocks/examples/metadata/file_metadata_source.grc index 2ce73c029f..f45c151d3f 100644 --- a/gr-blocks/examples/metadata/file_metadata_source.grc +++ b/gr-blocks/examples/metadata/file_metadata_source.grc @@ -84,10 +84,10 @@ </param> </block> <block> - <key>gr_tag_debug</key> + <key>blocks_tag_debug</key> <param> <key>id</key> - <value>gr_tag_debug_0</value> + <value>blocks_tag_debug_0</value> </param> <param> <key>_enabled</key> @@ -325,7 +325,7 @@ </connection> <connection> <source_block_id>blocks_throttle_0</source_block_id> - <sink_block_id>gr_tag_debug_0</sink_block_id> + <sink_block_id>blocks_tag_debug_0</sink_block_id> <source_key>0</source_key> <sink_key>0</sink_key> </connection> diff --git a/gr-blocks/examples/metadata/file_metadata_vector_source.grc b/gr-blocks/examples/metadata/file_metadata_vector_source.grc index 2d95d4c947..584a033c2d 100644 --- a/gr-blocks/examples/metadata/file_metadata_vector_source.grc +++ b/gr-blocks/examples/metadata/file_metadata_vector_source.grc @@ -119,10 +119,10 @@ </param> </block> <block> - <key>gr_tag_debug</key> + <key>blocks_tag_debug</key> <param> <key>id</key> - <value>gr_tag_debug_0</value> + <value>blocks_tag_debug_0</value> </param> <param> <key>_enabled</key> @@ -313,7 +313,7 @@ </connection> <connection> <source_block_id>blocks_throttle_0</source_block_id> - <sink_block_id>gr_tag_debug_0</sink_block_id> + <sink_block_id>blocks_tag_debug_0</sink_block_id> <source_key>0</source_key> <sink_key>0</sink_key> </connection> diff --git a/gr-blocks/python/qa_file_metadata.py b/gr-blocks/python/qa_file_metadata.py index c2319a800e..cf7a075f42 100644 --- a/gr-blocks/python/qa_file_metadata.py +++ b/gr-blocks/python/qa_file_metadata.py @@ -97,7 +97,7 @@ class test_file_metadata(gr_unittest.TestCase): src.rewind() fsrc = blocks.file_meta_source(outfile, False) vsnk = gr.vector_sink_c() - tsnk = gr.tag_debug(gr.sizeof_gr_complex, "QA") + tsnk = blocks.tag_debug(gr.sizeof_gr_complex, "QA") ssnk = gr.vector_sink_c() self.tb.disconnect(src, fsnk) self.tb.connect(fsrc, vsnk) @@ -176,7 +176,7 @@ class test_file_metadata(gr_unittest.TestCase): src.rewind() fsrc = blocks.file_meta_source(outfile, False, detached, outfile_hdr) vsnk = gr.vector_sink_c() - tsnk = gr.tag_debug(gr.sizeof_gr_complex, "QA") + tsnk = blocks.tag_debug(gr.sizeof_gr_complex, "QA") ssnk = gr.vector_sink_c() self.tb.disconnect(src, fsnk) self.tb.connect(fsrc, vsnk) diff --git a/gr-blocks/python/qa_pdu.py b/gr-blocks/python/qa_pdu.py index 8f708a2a86..d0c0093810 100755 --- a/gr-blocks/python/qa_pdu.py +++ b/gr-blocks/python/qa_pdu.py @@ -40,7 +40,7 @@ class test_pdu(gr_unittest.TestCase): src = blocks.pdu_to_tagged_stream(blocks.byte_t) snk3 = blocks.tagged_stream_to_pdu(blocks.byte_t) snk2 = gr.vector_sink_b() - snk = gr.tag_debug(1, "test") + snk = blocks.tag_debug(1, "test") snk.set_display(False) dbg = blocks.message_debug() diff --git a/grc/blocks/block_tree.xml b/grc/blocks/block_tree.xml index 74430f94d2..e4c059500a 100644 --- a/grc/blocks/block_tree.xml +++ b/grc/blocks/block_tree.xml @@ -28,7 +28,6 @@ <block>gr_wavfile_sink</block> <block>pad_sink</block> <block>virtual_sink</block> - <block>gr_tag_debug</block> </cat> <cat> <name>Operators</name> diff --git a/grc/blocks/gr_tag_debug.xml b/grc/blocks/gr_tag_debug.xml deleted file mode 100644 index 4af7729be9..0000000000 --- a/grc/blocks/gr_tag_debug.xml +++ /dev/null @@ -1,82 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -## Tag Debug -################################################### - --> -<block> - <name>Tag Debug</name> - <key>gr_tag_debug</key> - <import>from gnuradio import gr</import> - <make>gr.tag_debug($type.size*$vlen, $name)</make> - <callback>set_display($display)</callback> - <param> - <name>Input 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>Name</name> - <key>name</key> - <type>string</type> - </param> - <param> - <name>Num Inputs</name> - <key>num_inputs</key> - <value>1</value> - <type>int</type> - </param> - <param> - <name>Vec Length</name> - <key>vlen</key> - <value>1</value> - <type>int</type> - </param> - <param> - <name>Display</name> - <key>display</key> - <value>True</value> - <type>bool</type> - <option> - <name>On</name> - <key>True</key> - </option> - <option> - <name>Off</name> - <key>False</key> - </option> - </param> - <check>$num_inputs >= 1</check> - <check>$vlen > 0</check> - <sink> - <name>in</name> - <type>$type</type> - <vlen>$vlen</vlen> - <nports>$num_inputs</nports> - </sink> -</block> |