commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] [gnuradio] 01/28: basic: attempt at new component, par


From: git
Subject: [Commit-gnuradio] [gnuradio] 01/28: basic: attempt at new component, partial adder implementation
Date: Mon, 15 Aug 2016 00:47:04 +0000 (UTC)

This is an automated email from the git hooks/post-receive script.

nwest pushed a commit to annotated tag gr_basic_work
in repository gnuradio.

commit f00758905100d41d721360908c14407cdc728b4b
Author: Josh Blum <address@hidden>
Date:   Tue Nov 8 14:44:28 2011 -0800

    basic: attempt at new component, partial adder implementation
---
 CMakeLists.txt                             |   1 +
 gr-basic/CMakeLists.txt                    | 102 +++++++++++++++++++++++++++++
 gr-basic/gnuradio-basic.pc.in              |  11 ++++
 gr-basic/grc/CMakeLists.txt                |  29 ++++++++
 gr-basic/grc/basic_block_tree.xml          |  35 ++++++++++
 {grc/blocks => gr-basic/grc}/gr_add_xx.xml |  25 ++-----
 gr-basic/include/CMakeLists.txt            |  28 ++++++++
 gr-basic/include/gr_basic_add.h            |  43 ++++++++++++
 gr-basic/include/gr_basic_api.h            |  33 ++++++++++
 gr-basic/lib/CMakeLists.txt                |  45 +++++++++++++
 gr-basic/lib/gr_basic_add.cc               |  78 ++++++++++++++++++++++
 gr-basic/python/CMakeLists.txt             |  49 ++++++++++++++
 gr-basic/python/__init__.py                |  20 ++++++
 gr-basic/swig/CMakeLists.txt               |  47 +++++++++++++
 gr-basic/swig/basic_add.i                  |  33 ++++++++++
 gr-basic/swig/basic_swig.i                 |  32 +++++++++
 grc/blocks/block_tree.xml                  |   1 -
 17 files changed, 591 insertions(+), 21 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 17b79c5..a6b0c54 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -205,6 +205,7 @@ add_subdirectory(grc)
 
 add_subdirectory(gr-atsc)
 add_subdirectory(gr-audio)
+add_subdirectory(gr-basic)
 add_subdirectory(gr-comedi)
 add_subdirectory(gr-digital)
 add_subdirectory(gr-noaa)
diff --git a/gr-basic/CMakeLists.txt b/gr-basic/CMakeLists.txt
new file mode 100644
index 0000000..03f3b84
--- /dev/null
+++ b/gr-basic/CMakeLists.txt
@@ -0,0 +1,102 @@
+# Copyright 2011 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.
+
+########################################################################
+# Setup dependencies
+########################################################################
+include(GrBoost)
+
+########################################################################
+# Register component
+########################################################################
+include(GrComponent)
+GR_REGISTER_COMPONENT("gr-basic" ENABLE_GR_BASIC
+    Boost_FOUND
+    ENABLE_GR_CORE
+)
+
+GR_SET_GLOBAL(GR_BASIC_INCLUDE_DIRS
+    ${CMAKE_CURRENT_SOURCE_DIR}/include
+)
+
+########################################################################
+# Begin conditional configuration
+########################################################################
+if(ENABLE_GR_BASIC)
+
+########################################################################
+# Setup CPack components
+########################################################################
+include(GrPackage)
+CPACK_SET(CPACK_COMPONENT_GROUP_BASIC_DESCRIPTION "GNU Radio Basic Blocks")
+
+CPACK_COMPONENT("basic_runtime"
+    GROUP        "Basic"
+    DISPLAY_NAME "Runtime"
+    DESCRIPTION  "Dynamic link libraries"
+    DEPENDS      "core_runtime"
+)
+
+CPACK_COMPONENT("basic_devel"
+    GROUP        "Basic"
+    DISPLAY_NAME "Development"
+    DESCRIPTION  "C++ headers, package config, import libraries"
+    DEPENDS      "core_devel"
+)
+
+CPACK_COMPONENT("basic_python"
+    GROUP        "Basic"
+    DISPLAY_NAME "Python"
+    DESCRIPTION  "Python modules for runtime"
+    DEPENDS      "core_python;basic_runtime"
+)
+
+CPACK_COMPONENT("basic_swig"
+    GROUP        "Basic"
+    DISPLAY_NAME "SWIG"
+    DESCRIPTION  "SWIG development .i files"
+    DEPENDS      "core_swig;basic_python;basic_devel"
+)
+
+########################################################################
+# Add subdirectories
+########################################################################
+add_subdirectory(include)
+add_subdirectory(lib)
+if(ENABLE_PYTHON)
+    add_subdirectory(swig)
+    add_subdirectory(python)
+    add_subdirectory(grc)
+endif(ENABLE_PYTHON)
+
+########################################################################
+# Create Pkg Config File
+########################################################################
+configure_file(
+    ${CMAKE_CURRENT_SOURCE_DIR}/gnuradio-basic.pc.in
+    ${CMAKE_CURRENT_BINARY_DIR}/gnuradio-basic.pc
address@hidden)
+
+install(
+    FILES ${CMAKE_CURRENT_BINARY_DIR}/gnuradio-basic.pc
+    DESTINATION ${GR_LIBRARY_DIR}/pkgconfig
+    COMPONENT "basic_devel"
+)
+
+endif(ENABLE_GR_BASIC)
diff --git a/gr-basic/gnuradio-basic.pc.in b/gr-basic/gnuradio-basic.pc.in
new file mode 100644
index 0000000..5b63ecb
--- /dev/null
+++ b/gr-basic/gnuradio-basic.pc.in
@@ -0,0 +1,11 @@
address@hidden@
address@hidden@
address@hidden@
address@hidden@
+
+Name: gnuradio-basic
+Description: Basic GNU Radio blocks
+Requires: gnuradio-core
+Version: @LIBVER@
+Libs: -L${libdir} -lgnuradio-basic
+Cflags: -I${includedir}
diff --git a/gr-basic/grc/CMakeLists.txt b/gr-basic/grc/CMakeLists.txt
new file mode 100644
index 0000000..8738494
--- /dev/null
+++ b/gr-basic/grc/CMakeLists.txt
@@ -0,0 +1,29 @@
+# Copyright 2011 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.
+
+########################################################################
+# Install GRC xml files
+########################################################################
+file(GLOB xml_files ${CMAKE_CURRENT_SOURCE_DIR}/*.xml)
+
+install(FILES
+    ${xml_files}
+    DESTINATION ${GRC_BLOCKS_DIR}
+    COMPONENT "basic_python"
+)
diff --git a/gr-basic/grc/basic_block_tree.xml 
b/gr-basic/grc/basic_block_tree.xml
new file mode 100644
index 0000000..8cf14f3
--- /dev/null
+++ b/gr-basic/grc/basic_block_tree.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0"?>
+
+<!--
+ Copyright 2011 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.
+-->
+
+<!--
+###################################################
+##Block Tree for GR Basic blocks.
+###################################################
+ -->
+<cat>
+    <name></name> <!-- Blank for Root Name -->
+    <cat>
+        <name>Operators</name>
+        <block>gr_add_xx</block>
+    </cat>
+</cat>
diff --git a/grc/blocks/gr_add_xx.xml b/gr-basic/grc/gr_add_xx.xml
similarity index 66%
rename from grc/blocks/gr_add_xx.xml
rename to gr-basic/grc/gr_add_xx.xml
index 97ed928..320b6ce 100644
--- a/grc/blocks/gr_add_xx.xml
+++ b/gr-basic/grc/gr_add_xx.xml
@@ -8,31 +8,16 @@
 <block>
        <name>Add</name>
        <key>gr_add_xx</key>
-       <import>from gnuradio import gr</import>
-       <make>gr.add_v$(type.fcn)($vlen)</make>
+       <import>from gnuradio import basic</import>
+       <make>basic.add(basic.$type.enum, $vlen)</make>
        <param>
                <name>IO Type</name>
                <key>type</key>
                <type>enum</type>
                <option>
-                       <name>Complex</name>
-                       <key>complex</key>
-                       <opt>fcn:cc</opt>
-               </option>
-               <option>
-                       <name>Float</name>
-                       <key>float</key>
-                       <opt>fcn:ff</opt>
-               </option>
-               <option>
-                       <name>Int</name>
-                       <key>int</key>
-                       <opt>fcn:ii</opt>
-               </option>
-               <option>
-                       <name>Short</name>
-                       <key>short</key>
-                       <opt>fcn:ss</opt>
+                       <name>FC32</name>
+                       <key>fc32</key>
+                       <opt>enum:ADD_FC32</opt>
                </option>
        </param>
        <param>
diff --git a/gr-basic/include/CMakeLists.txt b/gr-basic/include/CMakeLists.txt
new file mode 100644
index 0000000..69a22c3
--- /dev/null
+++ b/gr-basic/include/CMakeLists.txt
@@ -0,0 +1,28 @@
+# Copyright 2011 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.
+
+########################################################################
+# Install header files
+########################################################################
+install(FILES
+    gr_basic_api.h
+    gr_basic_add.h
+    DESTINATION ${GR_INCLUDE_DIR}/gnuradio
+    COMPONENT "basic_devel"
+)
diff --git a/gr-basic/include/gr_basic_add.h b/gr-basic/include/gr_basic_add.h
new file mode 100644
index 0000000..24a5f18
--- /dev/null
+++ b/gr-basic/include/gr_basic_add.h
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2011 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_BASIC_ADD_H
+#define INCLUDED_GR_BASIC_ADD_H
+
+#include <gr_basic_api.h>
+#include <gr_sync_block.h>
+
+enum add_type{
+    ADD_FC32,
+    ADD_SC16,
+    ADD_F32,
+    ADD_S32,
+    ADD_S16,
+};
+
+class GR_BASIC_API basic_add : virtual public gr_sync_block{
+public:
+};
+
+GR_BASIC_API boost::shared_ptr<basic_add> basic_make_add(
+    add_type type, const size_t vlen = 1
+);
+
+#endif /* INCLUDED_GR_BASIC_ADD_H */
diff --git a/gr-basic/include/gr_basic_api.h b/gr-basic/include/gr_basic_api.h
new file mode 100644
index 0000000..d7f2d88
--- /dev/null
+++ b/gr-basic/include/gr_basic_api.h
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2011 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_BASIC_API_H
+#define INCLUDED_GR_BASIC_API_H
+
+#include <gruel/attributes.h>
+
+#ifdef gnuradio_basic_EXPORTS
+#  define GR_BASIC_API __GR_ATTR_EXPORT
+#else
+#  define GR_BASIC_API __GR_ATTR_IMPORT
+#endif
+
+#endif /* INCLUDED_GR_BASIC_API_H */
diff --git a/gr-basic/lib/CMakeLists.txt b/gr-basic/lib/CMakeLists.txt
new file mode 100644
index 0000000..dd4e551
--- /dev/null
+++ b/gr-basic/lib/CMakeLists.txt
@@ -0,0 +1,45 @@
+# Copyright 2011 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.
+
+########################################################################
+# Setup the include and linker paths
+########################################################################
+include_directories(
+    ${GNURADIO_CORE_INCLUDE_DIRS}
+    ${GR_BASIC_INCLUDE_DIRS}
+)
+
+include_directories(${Boost_INCLUDE_DIRS})
+link_directories(${Boost_LIBRARY_DIRS})
+
+########################################################################
+# Setup library
+########################################################################
+list(APPEND gr_basic_sources
+    gr_basic_add.cc
+)
+
+list(APPEND basic_libs
+    gnuradio-core
+    ${Boost_LIBRARIES}
+)
+
+add_library(gnuradio-basic SHARED ${gr_basic_sources})
+target_link_libraries(gnuradio-basic ${basic_libs})
+GR_LIBRARY_FOO(gnuradio-basic RUNTIME_COMPONENT "basic_runtime" 
DEVEL_COMPONENT "basic_devel")
diff --git a/gr-basic/lib/gr_basic_add.cc b/gr-basic/lib/gr_basic_add.cc
new file mode 100644
index 0000000..62e4207
--- /dev/null
+++ b/gr-basic/lib/gr_basic_add.cc
@@ -0,0 +1,78 @@
+/*
+ * Copyright 2011 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 <gr_basic_add.h>
+#include <gr_io_signature.h>
+#include <stdexcept>
+#include <complex>
+
+/***********************************************************************
+ * Adder implementation with complex float 32
+ **********************************************************************/
+class gr_basic_add_fc32 : public basic_add{
+public:
+    typedef std::complex<float> my_type;
+
+    gr_basic_add_fc32(const size_t vlen):
+        gr_sync_block(
+            "add fc32",
+            gr_make_io_signature (1, -1, sizeof(my_type)*vlen),
+            gr_make_io_signature (1, 1, sizeof(my_type)*vlen)
+        ),
+        _vlen(vlen)
+    {
+        //TODO this is where you set output multiple for volk
+    }
+
+    int work(
+        int noutput_items,
+        gr_vector_const_void_star &input_items,
+        gr_vector_void_star &output_items
+    ){
+        const size_t n_nums = noutput_items * _vlen;
+        my_type *out = reinterpret_cast<my_type *>(output_items[0]);
+        const my_type *in0 = reinterpret_cast<const my_type *>(input_items[0]);
+
+        for (size_t n = 1; n < input_items.size(); n++){
+            const my_type *in = reinterpret_cast<const my_type 
*>(input_items[n]);
+            //TODO - this is where you call into volk
+            for (size_t i = 0; i < n_nums; i++){
+                out[i] = in0[i] + in[i];
+            }
+            in0 = out; //for next input, we do output += input
+        }
+    }
+
+private:
+    const size_t _vlen;
+};
+
+/***********************************************************************
+ * Adder factory function
+ **********************************************************************/
+boost::shared_ptr<basic_add> basic_make_add(
+    add_type type, const size_t vlen
+){
+    switch(type){
+    case ADD_FC32: return boost::shared_ptr<basic_add>(new 
gr_basic_add_fc32(vlen));
+    default: throw std::invalid_argument("basic_make_add got unknown add 
type");
+    }
+}
diff --git a/gr-basic/python/CMakeLists.txt b/gr-basic/python/CMakeLists.txt
new file mode 100644
index 0000000..8b6e7a0
--- /dev/null
+++ b/gr-basic/python/CMakeLists.txt
@@ -0,0 +1,49 @@
+# Copyright 2011 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.
+
+########################################################################
+# Setup python install
+########################################################################
+include(GrPython)
+
+GR_PYTHON_INSTALL(
+    FILES
+    __init__.py
+    DESTINATION ${GR_PYTHON_DIR}/gnuradio/basic
+    COMPONENT "basic_python"
+)
+
+########################################################################
+# Handle the unit tests
+########################################################################
+if(ENABLE_TESTING)
+include(GrTest)
+file(GLOB py_qa_test_files "qa_*.py")
+foreach(py_qa_test_file ${py_qa_test_files})
+    get_filename_component(py_qa_test_name ${py_qa_test_file} NAME_WE)
+    set(GR_TEST_PYTHON_DIRS
+        ${CMAKE_BINARY_DIR}/gnuradio-core/src/python
+        ${CMAKE_BINARY_DIR}/gnuradio-core/src/lib/swig
+        ${CMAKE_BINARY_DIR}/gr-basic/python
+        ${CMAKE_BINARY_DIR}/gr-basic/swig
+    )
+    set(GR_TEST_TARGET_DEPS gruel gnuradio-core gnuradio-basic)
+    GR_ADD_TEST(${py_qa_test_name} ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B} 
${py_qa_test_file})
+endforeach(py_qa_test_file)
+endif(ENABLE_TESTING)
diff --git a/gr-basic/python/__init__.py b/gr-basic/python/__init__.py
new file mode 100644
index 0000000..38e4306
--- /dev/null
+++ b/gr-basic/python/__init__.py
@@ -0,0 +1,20 @@
+# Copyright 2011 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 basic_swig import *
diff --git a/gr-basic/swig/CMakeLists.txt b/gr-basic/swig/CMakeLists.txt
new file mode 100644
index 0000000..0a90bea
--- /dev/null
+++ b/gr-basic/swig/CMakeLists.txt
@@ -0,0 +1,47 @@
+# Copyright 2011 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.
+
+########################################################################
+# Setup swig generation
+########################################################################
+include(GrPython)
+include(GrSwig)
+
+set(GR_SWIG_INCLUDE_DIRS
+    ${GR_BASIC_INCLUDE_DIRS}
+    ${GNURADIO_CORE_SWIG_INCLUDE_DIRS}
+)
+
+set(GR_SWIG_LIBRARIES gnuradio-basic)
+
+GR_SWIG_MAKE(basic_swig basic_swig.i)
+
+GR_SWIG_INSTALL(
+    TARGETS basic_swig
+    DESTINATION ${GR_PYTHON_DIR}/gnuradio/basic
+    COMPONENT "basic_python"
+)
+
+install(
+    FILES
+    basic_swig.i
+    basic_add.i
+    DESTINATION ${GR_INCLUDE_DIR}/gnuradio/swig
+    COMPONENT "basic_swig"
+)
diff --git a/gr-basic/swig/basic_add.i b/gr-basic/swig/basic_add.i
new file mode 100644
index 0000000..234771c
--- /dev/null
+++ b/gr-basic/swig/basic_add.i
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2011 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.
+ */
+
+////////////////////////////////////////////////////////////////////////
+// block headers
+////////////////////////////////////////////////////////////////////////
+%{
+#include <gr_basic_add.h>
+%}
+
+////////////////////////////////////////////////////////////////////////
+// block magic
+////////////////////////////////////////////////////////////////////////
+GR_SWIG_BLOCK_MAGIC(basic,add)
+%include <gr_basic_add.h>
diff --git a/gr-basic/swig/basic_swig.i b/gr-basic/swig/basic_swig.i
new file mode 100644
index 0000000..0072dde
--- /dev/null
+++ b/gr-basic/swig/basic_swig.i
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2011 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.
+ */
+
+#define GR_BASIC_API
+
+////////////////////////////////////////////////////////////////////////
+// standard includes
+////////////////////////////////////////////////////////////////////////
+%include <gnuradio.i>
+
+////////////////////////////////////////////////////////////////////////
+// block includes
+////////////////////////////////////////////////////////////////////////
+%include <basic_add.i>
diff --git a/grc/blocks/block_tree.xml b/grc/blocks/block_tree.xml
index 183408c..0572e20 100644
--- a/grc/blocks/block_tree.xml
+++ b/grc/blocks/block_tree.xml
@@ -37,7 +37,6 @@
        </cat>
        <cat>
                <name>Operators</name>
-               <block>gr_add_xx</block>
                <block>gr_sub_xx</block>
                <block>gr_multiply_xx</block>
                <block>gr_divide_xx</block>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]