summaryrefslogtreecommitdiff
path: root/gnuradio-core/src/lib/gengen
diff options
context:
space:
mode:
authorBen Reynwar <ben@reynwar.net>2012-02-29 16:03:43 -0700
committerBen Reynwar <ben@reynwar.net>2012-03-12 13:27:20 -0700
commit0cbaf1b350c5ef6fc25f429430f1c892e7844e01 (patch)
treeed7cdaac1af6cff617a2ca9576bcd2b458ace13f /gnuradio-core/src/lib/gengen
parent1c4175858b4cfd34f15ae2014385923ae06b32c5 (diff)
Added gr_probe_signal_X and gr_probe_signal_vX.
Diffstat (limited to 'gnuradio-core/src/lib/gengen')
-rw-r--r--gnuradio-core/src/lib/gengen/CMakeLists.txt2
-rw-r--r--gnuradio-core/src/lib/gengen/gr_probe_signal_X.cc.t59
-rw-r--r--gnuradio-core/src/lib/gengen/gr_probe_signal_X.h.t58
-rw-r--r--gnuradio-core/src/lib/gengen/gr_probe_signal_X.i.t32
-rw-r--r--gnuradio-core/src/lib/gengen/gr_probe_signal_vX.cc.t59
-rw-r--r--gnuradio-core/src/lib/gengen/gr_probe_signal_vX.h.t62
-rw-r--r--gnuradio-core/src/lib/gengen/gr_probe_signal_vX.i.t32
7 files changed, 304 insertions, 0 deletions
diff --git a/gnuradio-core/src/lib/gengen/CMakeLists.txt b/gnuradio-core/src/lib/gengen/CMakeLists.txt
index a7292f1316..a8d641e90d 100644
--- a/gnuradio-core/src/lib/gengen/CMakeLists.txt
+++ b/gnuradio-core/src/lib/gengen/CMakeLists.txt
@@ -84,6 +84,8 @@ expand_h_cc_i(gr_vector_source_X b s i f c)
expand_h_cc_i(gr_vector_sink_X b s i f c)
expand_h_cc_i(gr_noise_source_X s i f c)
expand_h_cc_i(gr_sig_source_X s i f c)
+expand_h_cc_i(gr_probe_signal_X b s i f c)
+expand_h_cc_i(gr_probe_signal_vX b s i f c)
expand_h_cc_i(gr_add_const_XX ss ii ff cc sf)
expand_h_cc_i(gr_multiply_const_XX ss ii ff cc)
diff --git a/gnuradio-core/src/lib/gengen/gr_probe_signal_X.cc.t b/gnuradio-core/src/lib/gengen/gr_probe_signal_X.cc.t
new file mode 100644
index 0000000000..d60a5126a9
--- /dev/null
+++ b/gnuradio-core/src/lib/gengen/gr_probe_signal_X.cc.t
@@ -0,0 +1,59 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2005,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 <@NAME@.h>
+#include <gr_io_signature.h>
+
+@NAME@_sptr
+gr_make_@BASE_NAME@()
+{
+ return gnuradio::get_initial_sptr(new @NAME@());
+}
+
+@NAME@::@NAME@ ()
+: gr_sync_block ("@BASE_NAME@",
+ gr_make_io_signature(1, 1, sizeof(@TYPE@)),
+ gr_make_io_signature(0, 0, 0)),
+ d_level(0)
+{
+}
+
+@NAME@::~@NAME@()
+{
+}
+
+
+int
+@NAME@::work(int noutput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items)
+{
+ const @TYPE@ *in = (const @TYPE@ *) input_items[0];
+
+ if (noutput_items > 0)
+ d_level = in[noutput_items-1];
+
+ return noutput_items;
+}
diff --git a/gnuradio-core/src/lib/gengen/gr_probe_signal_X.h.t b/gnuradio-core/src/lib/gengen/gr_probe_signal_X.h.t
new file mode 100644
index 0000000000..26a95b9b2f
--- /dev/null
+++ b/gnuradio-core/src/lib/gengen/gr_probe_signal_X.h.t
@@ -0,0 +1,58 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2005, 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 @GUARD_NAME@
+#define @GUARD_NAME@
+
+#include <gr_core_api.h>
+#include <gr_sync_block.h>
+
+class @NAME@;
+typedef boost::shared_ptr<@NAME@> @NAME@_sptr;
+
+GR_CORE_API @NAME@_sptr
+gr_make_@BASE_NAME@ ();
+
+/*!
+ * \brief Sink that allows a sample to be grabbed from Python.
+ * \ingroup sink_blk
+ */
+class GR_CORE_API @NAME@ : public gr_sync_block
+{
+ @TYPE@ d_level;
+
+ friend GR_CORE_API @NAME@_sptr
+ gr_make_@BASE_NAME@();
+
+ @NAME@();
+
+public:
+ ~@NAME@();
+
+ int work(int noutput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items);
+
+ @TYPE@ level() const { return d_level; }
+
+};
+
+#endif /* @GUARD_NAME@ */
diff --git a/gnuradio-core/src/lib/gengen/gr_probe_signal_X.i.t b/gnuradio-core/src/lib/gengen/gr_probe_signal_X.i.t
new file mode 100644
index 0000000000..3f1ef8ffdb
--- /dev/null
+++ b/gnuradio-core/src/lib/gengen/gr_probe_signal_X.i.t
@@ -0,0 +1,32 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2005, 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,@BASE_NAME@);
+
+@NAME@_sptr
+gr_make_@BASE_NAME@ ();
+
+class @NAME@ : public gr_sync_block
+{
+public:
+ @TYPE@ level ();
+};
diff --git a/gnuradio-core/src/lib/gengen/gr_probe_signal_vX.cc.t b/gnuradio-core/src/lib/gengen/gr_probe_signal_vX.cc.t
new file mode 100644
index 0000000000..712b55b9a0
--- /dev/null
+++ b/gnuradio-core/src/lib/gengen/gr_probe_signal_vX.cc.t
@@ -0,0 +1,59 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2005,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 <@NAME@.h>
+#include <gr_io_signature.h>
+#include <iostream>
+
+@NAME@_sptr
+gr_make_@BASE_NAME@(size_t size)
+{
+ return gnuradio::get_initial_sptr(new @NAME@(size));
+}
+
+@NAME@::@NAME@ (size_t size)
+: gr_sync_block ("@BASE_NAME@",
+ gr_make_io_signature(1, 1, size*sizeof(@TYPE@)),
+ gr_make_io_signature(0, 0, 0)),
+ d_level(size, 0), d_size(size)
+{
+}
+
+@NAME@::~@NAME@()
+{
+}
+
+int
+@NAME@::work(int noutput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items)
+{
+ const @TYPE@ *in = (const @TYPE@ *) input_items[0];
+
+ for (int i=0; i<d_size; i++)
+ d_level[i] = in[(noutput_items-1)*d_size+i];
+
+ return noutput_items;
+}
diff --git a/gnuradio-core/src/lib/gengen/gr_probe_signal_vX.h.t b/gnuradio-core/src/lib/gengen/gr_probe_signal_vX.h.t
new file mode 100644
index 0000000000..3a7277b93d
--- /dev/null
+++ b/gnuradio-core/src/lib/gengen/gr_probe_signal_vX.h.t
@@ -0,0 +1,62 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2005, 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 @GUARD_NAME@
+#define @GUARD_NAME@
+
+#include <vector>
+
+#include <gr_core_api.h>
+#include <gr_sync_block.h>
+
+class @NAME@;
+typedef boost::shared_ptr<@NAME@> @NAME@_sptr;
+
+GR_CORE_API @NAME@_sptr
+gr_make_@BASE_NAME@ (size_t size);
+
+/*!
+ * \brief Sink that allows a sample to be grabbed from Python.
+ * \ingroup sink_blk
+ */
+class GR_CORE_API @NAME@ : public gr_sync_block
+{
+ std::vector<@TYPE@> d_level;
+
+ friend GR_CORE_API @NAME@_sptr
+ gr_make_@BASE_NAME@(size_t size);
+
+ @NAME@(size_t size);
+
+ size_t d_size;
+
+public:
+ ~@NAME@();
+
+ int work(int noutput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items);
+
+ std::vector<@TYPE@> level() const { return d_level; }
+
+};
+
+#endif /* @GUARD_NAME@ */
diff --git a/gnuradio-core/src/lib/gengen/gr_probe_signal_vX.i.t b/gnuradio-core/src/lib/gengen/gr_probe_signal_vX.i.t
new file mode 100644
index 0000000000..20191948a7
--- /dev/null
+++ b/gnuradio-core/src/lib/gengen/gr_probe_signal_vX.i.t
@@ -0,0 +1,32 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2005, 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,@BASE_NAME@);
+
+@NAME@_sptr
+gr_make_@BASE_NAME@ (size_t size);
+
+class @NAME@ : public gr_sync_block
+{
+public:
+ std::vector<@TYPE@> level ();
+};