summaryrefslogtreecommitdiff
path: root/gnuradio-core
diff options
context:
space:
mode:
Diffstat (limited to 'gnuradio-core')
-rw-r--r--gnuradio-core/src/lib/general/CMakeLists.txt1
-rw-r--r--gnuradio-core/src/lib/gengen/CMakeLists.txt2
-rw-r--r--gnuradio-core/src/lib/gengen/gr_probe_signal_X.cc.t (renamed from gnuradio-core/src/lib/general/gr_probe_signal_f.cc)23
-rw-r--r--gnuradio-core/src/lib/gengen/gr_probe_signal_X.h.t (renamed from gnuradio-core/src/lib/general/gr_probe_signal_f.h)30
-rw-r--r--gnuradio-core/src/lib/gengen/gr_probe_signal_X.i.t (renamed from gnuradio-core/src/lib/general/gr_probe_signal_f.i)12
-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
8 files changed, 187 insertions, 34 deletions
diff --git a/gnuradio-core/src/lib/general/CMakeLists.txt b/gnuradio-core/src/lib/general/CMakeLists.txt
index 6ecaa930a..24fed23d2 100644
--- a/gnuradio-core/src/lib/general/CMakeLists.txt
+++ b/gnuradio-core/src/lib/general/CMakeLists.txt
@@ -245,7 +245,6 @@ set(gr_core_general_triple_threats
gr_probe_avg_mag_sqrd_c
gr_probe_avg_mag_sqrd_cf
gr_probe_avg_mag_sqrd_f
- gr_probe_signal_f
gr_pwr_squelch_cc
gr_pwr_squelch_ff
gr_quadrature_demod_cf
diff --git a/gnuradio-core/src/lib/gengen/CMakeLists.txt b/gnuradio-core/src/lib/gengen/CMakeLists.txt
index a7292f131..a8d641e90 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/general/gr_probe_signal_f.cc b/gnuradio-core/src/lib/gengen/gr_probe_signal_X.cc.t
index ee1a18e89..d60a5126a 100644
--- a/gnuradio-core/src/lib/general/gr_probe_signal_f.cc
+++ b/gnuradio-core/src/lib/gengen/gr_probe_signal_X.cc.t
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2005,2010 Free Software Foundation, Inc.
+ * Copyright 2005,2010,2012 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -23,38 +23,37 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
-#include <gr_probe_signal_f.h>
+#include <@NAME@.h>
#include <gr_io_signature.h>
-gr_probe_signal_f_sptr
-gr_make_probe_signal_f()
+@NAME@_sptr
+gr_make_@BASE_NAME@()
{
- return gnuradio::get_initial_sptr(new gr_probe_signal_f());
+ return gnuradio::get_initial_sptr(new @NAME@());
}
-gr_probe_signal_f::gr_probe_signal_f ()
- : gr_sync_block ("probe_signal_f",
- gr_make_io_signature(1, 1, sizeof(float)),
+@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)
{
}
-gr_probe_signal_f::~gr_probe_signal_f()
+@NAME@::~@NAME@()
{
}
int
-gr_probe_signal_f::work(int noutput_items,
+@NAME@::work(int noutput_items,
gr_vector_const_void_star &input_items,
gr_vector_void_star &output_items)
{
- const float *in = (const float *) input_items[0];
+ 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/general/gr_probe_signal_f.h b/gnuradio-core/src/lib/gengen/gr_probe_signal_X.h.t
index b99c76976..26a95b9b2 100644
--- a/gnuradio-core/src/lib/general/gr_probe_signal_f.h
+++ b/gnuradio-core/src/lib/gengen/gr_probe_signal_X.h.t
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2005 Free Software Foundation, Inc.
+ * Copyright 2005, 2012 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -19,40 +19,40 @@
* the Free Software Foundation, Inc., 51 Franklin Street,
* Boston, MA 02110-1301, USA.
*/
-#ifndef INCLUDED_GR_PROBE_SIGNAL_F_H
-#define INCLUDED_GR_PROBE_SIGNAL_F_H
+#ifndef @GUARD_NAME@
+#define @GUARD_NAME@
#include <gr_core_api.h>
#include <gr_sync_block.h>
-class gr_probe_signal_f;
-typedef boost::shared_ptr<gr_probe_signal_f> gr_probe_signal_f_sptr;
+class @NAME@;
+typedef boost::shared_ptr<@NAME@> @NAME@_sptr;
-GR_CORE_API gr_probe_signal_f_sptr
-gr_make_probe_signal_f ();
+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 gr_probe_signal_f : public gr_sync_block
+class GR_CORE_API @NAME@ : public gr_sync_block
{
- float d_level;
+ @TYPE@ d_level;
- friend GR_CORE_API gr_probe_signal_f_sptr
- gr_make_probe_signal_f();
+ friend GR_CORE_API @NAME@_sptr
+ gr_make_@BASE_NAME@();
- gr_probe_signal_f();
+ @NAME@();
public:
- ~gr_probe_signal_f();
+ ~@NAME@();
int work(int noutput_items,
gr_vector_const_void_star &input_items,
gr_vector_void_star &output_items);
- float level() const { return d_level; }
+ @TYPE@ level() const { return d_level; }
};
-#endif /* INCLUDED_GR_PROBE_SIGNAL_F_H */
+#endif /* @GUARD_NAME@ */
diff --git a/gnuradio-core/src/lib/general/gr_probe_signal_f.i b/gnuradio-core/src/lib/gengen/gr_probe_signal_X.i.t
index 4255e5dfd..3f1ef8ffd 100644
--- a/gnuradio-core/src/lib/general/gr_probe_signal_f.i
+++ b/gnuradio-core/src/lib/gengen/gr_probe_signal_X.i.t
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2005 Free Software Foundation, Inc.
+ * Copyright 2005, 2012 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -20,13 +20,13 @@
* Boston, MA 02110-1301, USA.
*/
-GR_SWIG_BLOCK_MAGIC(gr,probe_signal_f);
+GR_SWIG_BLOCK_MAGIC(gr,@BASE_NAME@);
-gr_probe_signal_f_sptr
-gr_make_probe_signal_f ();
+@NAME@_sptr
+gr_make_@BASE_NAME@ ();
-class gr_probe_signal_f : public gr_sync_block
+class @NAME@ : public gr_sync_block
{
public:
- float level () const { return d_level; }
+ @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 000000000..712b55b9a
--- /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 000000000..3a7277b93
--- /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 000000000..20191948a
--- /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 ();
+};