commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] r9674 - in gnuradio/branches/developers/jcorgan/dsss/g


From: jcorgan
Subject: [Commit-gnuradio] r9674 - in gnuradio/branches/developers/jcorgan/dsss/gr-dsss: include/dsss lib python
Date: Sun, 28 Sep 2008 22:39:21 -0600 (MDT)

Author: jcorgan
Date: 2008-09-28 22:39:20 -0600 (Sun, 28 Sep 2008)
New Revision: 9674

Added:
   gnuradio/branches/developers/jcorgan/dsss/gr-dsss/include/dsss/code_gen_1b.h
   gnuradio/branches/developers/jcorgan/dsss/gr-dsss/lib/code_gen_1b.cc
   gnuradio/branches/developers/jcorgan/dsss/gr-dsss/lib/qa_code_gen_1b.cc
   gnuradio/branches/developers/jcorgan/dsss/gr-dsss/lib/qa_code_gen_1b.h
   gnuradio/branches/developers/jcorgan/dsss/gr-dsss/python/code_gen_1b.i
Removed:
   gnuradio/branches/developers/jcorgan/dsss/gr-dsss/include/dsss/test.h
Modified:
   gnuradio/branches/developers/jcorgan/dsss/gr-dsss/include/dsss/Makefile.am
   gnuradio/branches/developers/jcorgan/dsss/gr-dsss/lib/Makefile.am
   gnuradio/branches/developers/jcorgan/dsss/gr-dsss/lib/qa_dsss.cc
   gnuradio/branches/developers/jcorgan/dsss/gr-dsss/python/Makefile.am
   gnuradio/branches/developers/jcorgan/dsss/gr-dsss/python/dsss.i
   gnuradio/branches/developers/jcorgan/dsss/gr-dsss/python/qa_dsss.py
Log:
wip, adds gr.dsss.code_gen_1b() base class, swig seems to do the right thing 
with namespaces.  This base class will become the virtual base class for all 
unpacked binary chipping sequence code generators.

Modified: 
gnuradio/branches/developers/jcorgan/dsss/gr-dsss/include/dsss/Makefile.am
===================================================================
--- gnuradio/branches/developers/jcorgan/dsss/gr-dsss/include/dsss/Makefile.am  
2008-09-28 22:03:22 UTC (rev 9673)
+++ gnuradio/branches/developers/jcorgan/dsss/gr-dsss/include/dsss/Makefile.am  
2008-09-29 04:39:20 UTC (rev 9674)
@@ -23,4 +23,4 @@
 ourincludedir = $(grincludedir)/dsss
 
 ourinclude_HEADERS = \
-    test.h
+    code_gen_1b.h

Added: 
gnuradio/branches/developers/jcorgan/dsss/gr-dsss/include/dsss/code_gen_1b.h
===================================================================
--- 
gnuradio/branches/developers/jcorgan/dsss/gr-dsss/include/dsss/code_gen_1b.h    
                            (rev 0)
+++ 
gnuradio/branches/developers/jcorgan/dsss/gr-dsss/include/dsss/code_gen_1b.h    
    2008-09-29 04:39:20 UTC (rev 9674)
@@ -0,0 +1,48 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2008 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_DSSS_CODE_GEN_1B_H
+#define INCLUDED_DSSS_CODE_GEN_1B_H
+
+#include <boost/shared_ptr.hpp>
+
+namespace dsss {
+
+  class code_gen_1b;
+  typedef boost::shared_ptr<code_gen_1b> code_gen_1b_sptr;
+
+  code_gen_1b_sptr make_code_gen_1b();
+
+  class code_gen_1b
+  {
+  private:
+    friend code_gen_1b_sptr make_code_gen_1b();
+    code_gen_1b();
+  
+  public:
+    ~code_gen_1b();
+  
+    virtual unsigned char next();
+  };
+
+} /* namespace dsss */
+
+#endif /* INCLUDED_DSSS_CODE_GEN_1B_H */

Deleted: gnuradio/branches/developers/jcorgan/dsss/gr-dsss/include/dsss/test.h

Modified: gnuradio/branches/developers/jcorgan/dsss/gr-dsss/lib/Makefile.am
===================================================================
--- gnuradio/branches/developers/jcorgan/dsss/gr-dsss/lib/Makefile.am   
2008-09-28 22:03:22 UTC (rev 9673)
+++ gnuradio/branches/developers/jcorgan/dsss/gr-dsss/lib/Makefile.am   
2008-09-29 04:39:20 UTC (rev 9674)
@@ -20,7 +20,8 @@
 
 include $(top_srcdir)/Makefile.common
 
-AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(CPPUNIT_CPPFLAGS)
+AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(CPPUNIT_CPPFLAGS) \
+    -I$(top_srcdir)/gr-dsss/include
 
 # list of programs run by "make check" and "make distcheck"
 TESTS = test_all
@@ -34,7 +35,8 @@
 # ----------------------------------------------------------------
 #                      The main library
 # ----------------------------------------------------------------
-libgr_dsss_la_SOURCES =
+libgr_dsss_la_SOURCES = \
+       code_gen_1b.cc
 
 libgr_dsss_la_LDFLAGS = $(NO_UNDEFINED) -version-info 0:0:0
 
@@ -44,9 +46,10 @@
 #        The QA library.  Note libdsss.la in LIBADD
 # ----------------------------------------------------------------
 libgr_dsss_qa_la_SOURCES = \
-       qa_dsss.cc
+       qa_dsss.cc \
+       qa_code_gen_1b.cc
 
-libgr_dsss_qa_la_LDFLAGS = $(NO_UNDEFINED) -version-info 0:0:0
+libgr_dsss_qa_la_LDFLAGS = $(NO_UNDEFINED)
 
 libgr_dsss_qa_la_LIBADD = \
        libgr-dsss.la \
@@ -56,7 +59,8 @@
 # headers that don't get installed
 # ----------------------------------------------------------------
 noinst_HEADERS = \
-       qa_dsss.h
+       qa_dsss.h \
+       qa_code_gen_1b.h
 
 # ----------------------------------------------------------------
 # Our test program

Added: gnuradio/branches/developers/jcorgan/dsss/gr-dsss/lib/code_gen_1b.cc
===================================================================
--- gnuradio/branches/developers/jcorgan/dsss/gr-dsss/lib/code_gen_1b.cc        
                        (rev 0)
+++ gnuradio/branches/developers/jcorgan/dsss/gr-dsss/lib/code_gen_1b.cc        
2008-09-29 04:39:20 UTC (rev 9674)
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2008 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 <dsss/code_gen_1b.h>
+
+namespace dsss {
+
+  code_gen_1b_sptr
+  make_code_gen_1b()
+  {
+    return code_gen_1b_sptr(new code_gen_1b());
+  }
+
+  code_gen_1b::code_gen_1b()
+  {
+    // NOP
+  }
+
+  code_gen_1b::~code_gen_1b()
+  {
+    // NOP
+  }
+
+  unsigned char
+  code_gen_1b::next()
+  {
+    return 0;
+  }
+
+} /* namespace dsss */

Added: gnuradio/branches/developers/jcorgan/dsss/gr-dsss/lib/qa_code_gen_1b.cc
===================================================================
--- gnuradio/branches/developers/jcorgan/dsss/gr-dsss/lib/qa_code_gen_1b.cc     
                        (rev 0)
+++ gnuradio/branches/developers/jcorgan/dsss/gr-dsss/lib/qa_code_gen_1b.cc     
2008-09-29 04:39:20 UTC (rev 9674)
@@ -0,0 +1,31 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2008 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 this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include <qa_code_gen_1b.h>
+#include <cppunit/TestAssert.h>
+#include <dsss/code_gen_1b.h>
+
+void
+qa_code_gen_1b::t1()
+{
+  dsss::code_gen_1b_sptr g = dsss::make_code_gen_1b();
+  CPPUNIT_ASSERT(g->next() == 0);
+}

Added: gnuradio/branches/developers/jcorgan/dsss/gr-dsss/lib/qa_code_gen_1b.h
===================================================================
--- gnuradio/branches/developers/jcorgan/dsss/gr-dsss/lib/qa_code_gen_1b.h      
                        (rev 0)
+++ gnuradio/branches/developers/jcorgan/dsss/gr-dsss/lib/qa_code_gen_1b.h      
2008-09-29 04:39:20 UTC (rev 9674)
@@ -0,0 +1,38 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2008 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 this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#ifndef INCLUDED_QA_CODE_GEN_1B_H
+#define INCLUDED_QA_CODE_GEN_1B_H
+
+#include <cppunit/extensions/HelperMacros.h>
+#include <cppunit/TestCase.h>
+
+class qa_code_gen_1b : public CppUnit::TestCase {
+
+  CPPUNIT_TEST_SUITE (qa_code_gen_1b);
+  CPPUNIT_TEST (t1);
+  CPPUNIT_TEST_SUITE_END ();
+
+ private:
+  void t1 ();
+};
+
+
+#endif /* INCLUDED_QA_CODE_GEN_1B_H */

Modified: gnuradio/branches/developers/jcorgan/dsss/gr-dsss/lib/qa_dsss.cc
===================================================================
--- gnuradio/branches/developers/jcorgan/dsss/gr-dsss/lib/qa_dsss.cc    
2008-09-28 22:03:22 UTC (rev 9673)
+++ gnuradio/branches/developers/jcorgan/dsss/gr-dsss/lib/qa_dsss.cc    
2008-09-29 04:39:20 UTC (rev 9674)
@@ -26,14 +26,14 @@
  */
 
 #include <qa_dsss.h>
-// #include <qa_....h>
+#include <qa_code_gen_1b.h>
 
 CppUnit::TestSuite *
 qa_dsss::suite()
 {
   CppUnit::TestSuite   *s = new CppUnit::TestSuite("dsss");
 
-  // s->addTest(...);
+  s->addTest(qa_code_gen_1b::suite());
   
   return s;
 }

Modified: gnuradio/branches/developers/jcorgan/dsss/gr-dsss/python/Makefile.am
===================================================================
--- gnuradio/branches/developers/jcorgan/dsss/gr-dsss/python/Makefile.am        
2008-09-28 22:03:22 UTC (rev 9673)
+++ gnuradio/branches/developers/jcorgan/dsss/gr-dsss/python/Makefile.am        
2008-09-29 04:39:20 UTC (rev 9674)
@@ -24,7 +24,9 @@
 ourpyexecdir = $(grpyexecdir)/dsss
 ourswigincludedir = $(grincludedir)/dsss/swig
 
-AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(PYTHON_CPPFLAGS)
+AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(PYTHON_CPPFLAGS) \
+    -I$(top_srcdir)/gr-dsss/include
+    
 SWIGPYTHONARGS = $(SWIGPYTHONFLAGS) $(SWIGGRFLAGS) $(STD_DEFINES_AND_INCLUDES) 
\
        $(WITH_INCLUDES) $(WITH_SWIG_INCLUDES)
 

Added: gnuradio/branches/developers/jcorgan/dsss/gr-dsss/python/code_gen_1b.i
===================================================================
--- gnuradio/branches/developers/jcorgan/dsss/gr-dsss/python/code_gen_1b.i      
                        (rev 0)
+++ gnuradio/branches/developers/jcorgan/dsss/gr-dsss/python/code_gen_1b.i      
2008-09-29 04:39:20 UTC (rev 9674)
@@ -0,0 +1,47 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2008 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 <dsss/code_gen_1b.h>
+%}
+
+namespace dsss {
+
+  // subset of GR_SWIG_BLOCK_MAGIC
+  class code_gen_1b;
+  typedef boost::shared_ptr<code_gen_1b> code_gen_1b_sptr;
+  %template(code_gen_1b_sptr) boost::shared_ptr<code_gen_1b>;
+  %rename(code_gen_1b) make_code_gen_1b;
+  %ignore code_gen_1b;
+
+  code_gen_1b_sptr make_code_gen_1b();
+
+  class code_gen_1b
+  {
+  private:
+    code_gen_1b();
+        
+  public:
+    unsigned char next();
+  };
+
+} 

Modified: gnuradio/branches/developers/jcorgan/dsss/gr-dsss/python/dsss.i
===================================================================
--- gnuradio/branches/developers/jcorgan/dsss/gr-dsss/python/dsss.i     
2008-09-28 22:03:22 UTC (rev 9673)
+++ gnuradio/branches/developers/jcorgan/dsss/gr-dsss/python/dsss.i     
2008-09-29 04:39:20 UTC (rev 9674)
@@ -21,27 +21,12 @@
 
 %feature("autodoc", "1");              // generate python docstrings
 
-%include "exception.i"
-%import "gnuradio.i"                   // the common stuff
+%include <exception.i>
+%import <gnuradio.i>                   // the common stuff
 
 %{
 #include "gnuradio_swig_bug_workaround.h"      // mandatory bug fix
 #include <stdexcept>
 %}
 
-// ----------------------------------------------------------------
-
-/*
- * Gather all .i files in this directory together.
- */
-
-%{
-
-// The .h files
-// #include <dsss/...h>
-
-%}
-
-// The .i files
-// %include <dsss_....i>
-
+%include "code_gen_1b.i"

Modified: gnuradio/branches/developers/jcorgan/dsss/gr-dsss/python/qa_dsss.py
===================================================================
--- gnuradio/branches/developers/jcorgan/dsss/gr-dsss/python/qa_dsss.py 
2008-09-28 22:03:22 UTC (rev 9673)
+++ gnuradio/branches/developers/jcorgan/dsss/gr-dsss/python/qa_dsss.py 
2008-09-29 04:39:20 UTC (rev 9674)
@@ -21,7 +21,7 @@
 # 
 
 from gnuradio import gr, gr_unittest
-import dsss_swig
+import dsss_swig as dsss
 
 class qa_dsss(gr_unittest.TestCase):
 
@@ -32,7 +32,8 @@
         self.tb = None
 
     def test_001_nop(self):
-       pass
+       g = dsss.code_gen_1b()
+       self.assertTrue(g.next() == 0)
                
 if __name__ == '__main__':
     gr_unittest.main()





reply via email to

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