From 5c7b8118d4d0f8413d64933cabec84b18cdaf193 Mon Sep 17 00:00:00 2001
From: Tom Rondeau
Date: Mon, 25 Feb 2013 21:16:19 -0500
Subject: blocks: moved transcendental block to gr-blocks.
---
gr-blocks/grc/blocks_block_tree.xml | 1 +
gr-blocks/grc/blocks_transcendental.xml | 41 ++++++++
gr-blocks/include/blocks/CMakeLists.txt | 1 +
gr-blocks/include/blocks/transcendental.h | 56 +++++++++++
gr-blocks/lib/CMakeLists.txt | 1 +
gr-blocks/lib/transcendental_impl.cc | 150 ++++++++++++++++++++++++++++++
gr-blocks/lib/transcendental_impl.h | 51 ++++++++++
gr-blocks/python/qa_transcendental.py | 90 ++++++++++++++++++
gr-blocks/swig/blocks_swig.i | 3 +
9 files changed, 394 insertions(+)
create mode 100644 gr-blocks/grc/blocks_transcendental.xml
create mode 100644 gr-blocks/include/blocks/transcendental.h
create mode 100644 gr-blocks/lib/transcendental_impl.cc
create mode 100644 gr-blocks/lib/transcendental_impl.h
create mode 100644 gr-blocks/python/qa_transcendental.py
diff --git a/gr-blocks/grc/blocks_block_tree.xml b/gr-blocks/grc/blocks_block_tree.xml
index 6ab84c94e..5e304d3c3 100644
--- a/gr-blocks/grc/blocks_block_tree.xml
+++ b/gr-blocks/grc/blocks_block_tree.xml
@@ -50,6 +50,7 @@
blocks_integrate_xxblocks_nlog10_ffblocks_rms_xx
+ blocks_transcendentalBoolean Operations (New)
diff --git a/gr-blocks/grc/blocks_transcendental.xml b/gr-blocks/grc/blocks_transcendental.xml
new file mode 100644
index 000000000..a883a2eef
--- /dev/null
+++ b/gr-blocks/grc/blocks_transcendental.xml
@@ -0,0 +1,41 @@
+
+
+
+ Transcendental
+ blocks_transcendental
+ from gnuradio import blocks
+ blocks.transcendental($name, "$type")
+
+ Type
+ type
+ enum
+
+
+
+
+ Function Name
+ name
+ cos
+ string
+
+
+ in
+ $type.type
+
+
+ out
+ $type.type
+
+
diff --git a/gr-blocks/include/blocks/CMakeLists.txt b/gr-blocks/include/blocks/CMakeLists.txt
index 8d5fe9b13..d3c08f6e6 100644
--- a/gr-blocks/include/blocks/CMakeLists.txt
+++ b/gr-blocks/include/blocks/CMakeLists.txt
@@ -141,6 +141,7 @@ install(FILES
stretch_ff.h
threshold_ff.h
throttle.h
+ transcendental.h
uchar_to_float.h
vector_to_stream.h
vector_to_streams.h
diff --git a/gr-blocks/include/blocks/transcendental.h b/gr-blocks/include/blocks/transcendental.h
new file mode 100644
index 000000000..f8a0d5d80
--- /dev/null
+++ b/gr-blocks/include/blocks/transcendental.h
@@ -0,0 +1,56 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2011,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_TRANSCENDENTAL_H
+#define INCLUDED_GR_TRANSCENDENTAL_H
+
+#include
+#include
+#include
+
+namespace gr {
+ namespace blocks {
+
+ /*!
+ * \brief A block that performs various transcendental math operations.
+ *
+ * Possible function names can be found in the cmath library. IO
+ * may be either complex or real, double or single precision.
+ *
+ * Possible type strings: float, double, complex_float, complex_double
+ *
+ * output[i] = trans_fcn(input[i])
+ */
+ class BLOCKS_API transcendental : virtual public gr_sync_block
+ {
+ public:
+ // gr::blocks::transcendental::sptr
+ typedef boost::shared_ptr sptr;
+
+ static sptr make(const std::string &name,
+ const std::string &type="float");
+ };
+
+ } /* namespace blocks */
+} /* namespace gr */
+
+#endif /* INCLUDED_GR_TRANSCENDENTAL_H */
diff --git a/gr-blocks/lib/CMakeLists.txt b/gr-blocks/lib/CMakeLists.txt
index e1b9b4f00..20e3ae4aa 100644
--- a/gr-blocks/lib/CMakeLists.txt
+++ b/gr-blocks/lib/CMakeLists.txt
@@ -180,6 +180,7 @@ list(APPEND gr_blocks_sources
stretch_ff_impl.cc
threshold_ff_impl.cc
throttle_impl.cc
+ transcendental_impl.cc
uchar_array_to_float.cc
uchar_to_float_impl.cc
vector_to_stream_impl.cc
diff --git a/gr-blocks/lib/transcendental_impl.cc b/gr-blocks/lib/transcendental_impl.cc
new file mode 100644
index 000000000..725899ca8
--- /dev/null
+++ b/gr-blocks/lib/transcendental_impl.cc
@@ -0,0 +1,150 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2011,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.
+ */
+
+#include "transcendental_impl.h"
+#include
+#include
+#include //complex math
+#include //real math
+#include