[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] r9452 - gnuradio/branches/features/gr-usrp2/gr-usrp2/s
From: |
jcorgan |
Subject: |
[Commit-gnuradio] r9452 - gnuradio/branches/features/gr-usrp2/gr-usrp2/src |
Date: |
Fri, 29 Aug 2008 17:11:09 -0600 (MDT) |
Author: jcorgan
Date: 2008-08-29 17:11:08 -0600 (Fri, 29 Aug 2008)
New Revision: 9452
Added:
gnuradio/branches/features/gr-usrp2/gr-usrp2/src/qa_usrp2.py
Removed:
gnuradio/branches/features/gr-usrp2/gr-usrp2/src/Makefile.swig
Modified:
gnuradio/branches/features/gr-usrp2/gr-usrp2/src/
gnuradio/branches/features/gr-usrp2/gr-usrp2/src/Makefile.am
gnuradio/branches/features/gr-usrp2/gr-usrp2/src/run_tests.in
gnuradio/branches/features/gr-usrp2/gr-usrp2/src/usrp2.i
Log:
wip. Building usrp2 module works, but tune_result is broken.
Property changes on: gnuradio/branches/features/gr-usrp2/gr-usrp2/src
___________________________________________________________________
Name: svn:ignore
- Makefile
Makefile.in
.libs
.deps
usrp2.py
usrp2.cc
run_tests
test_gr_usrp2
+ Makefile
Makefile.in
.libs
.deps
usrp2.py
usrp2.cc
run_tests
test_gr_usrp2
*.pyc
Modified: gnuradio/branches/features/gr-usrp2/gr-usrp2/src/Makefile.am
===================================================================
--- gnuradio/branches/features/gr-usrp2/gr-usrp2/src/Makefile.am
2008-08-29 21:42:16 UTC (rev 9451)
+++ gnuradio/branches/features/gr-usrp2/gr-usrp2/src/Makefile.am
2008-08-29 23:11:08 UTC (rev 9452)
@@ -64,16 +64,69 @@
test_gr_usrp2_SOURCES = test_gr_usrp2.cc
test_gr_usrp2_LDADD = libgr-usrp2.la
-# Uncomment to include swig part of build
-include Makefile.swig
+# ----------------------------------------------------------------------
+# Python SWIG wrapper around C++ library
+#
+# usrp2.py
+# _usrp2.so
+# ----------------------------------------------------------------------
+# Python installation locations
+ourpythondir = $(grpythondir)
+ourlibdir = $(grpyexecdir)
+
+# SWIG interface files
+LOCAL_IFILES = usrp2.i
+NON_LOCAL_IFILES = $(GNURADIO_I)
+ALL_IFILES = $(LOCAL_IFILES) $(NON_LOCAL_IFILES)
+
+# Install the SWIG interface files
+swiginclude_HEADERS = $(LOCAL_IFILES)
+
+# Generated by SWIG wrapper generator
+BUILT_SOURCES = usrp2.cc usrp2.py
+
+# Install the SWIG python output
+ourpython_PYTHON = usrp2.py
+
+# Arguments to the swig wrapper generator
+SWIGPYTHONARGS = \
+ $(STD_DEFINES_AND_INCLUDES) \
+ $(SWIGPYTHONFLAGS) \
+ -I$(USRP2_INCLUDEDIR) \
+ $(WITH_INCLUDES) \
+ $(WITH_SWIG_INCLUDES)
+
+# Invoke SWIG wrapper generator
+usrp2.cc usrp2.py: $(ALL_IFILES)
+ $(SWIG) $(SWIGPYTHONARGS) -module usrp2 -o usrp2.cc usrp2.i
+
+# Create the Python shared library
+ourlib_LTLIBRARIES = _usrp2.la
+_usrp2_la_SOURCES = usrp2.cc
+_usrp2_la_CXXFLAGS = @swig_CXXFLAGS@
+_usrp2_la_LDFLAGS = $(swig_CXXFLAGS) $(NO_UNDEFINED) -module -avoid-version
+
+# Link the library as needed
+_usrp2_la_LIBADD = \
+ $(PYTHON_LDFLAGS) \
+ libgr-usrp2.la \
+ $(GNURADIO_CORE_LA) \
+ $(USRP2_LIBS) \
+ -lstdc++
+
+# Don't distribute output of swig
+dist-hook:
+ @for file in $(BUILT_SOURCES); do echo $(RM) $(distdir)/$$file; done
+ @for file in $(BUILT_SOURCES); do $(RM) $(distdir)/$$file; done
+
# ----------------------------------------------------------------------
# Local Python files, not installed
#
# qa_usrp2.py
# ----------------------------------------------------------------------
-#noinst_PYTHON = qa_usrp.py
+noinst_PYTHON = qa_usrp2.py
# ----------------------------------------------------------------------
Deleted: gnuradio/branches/features/gr-usrp2/gr-usrp2/src/Makefile.swig
Added: gnuradio/branches/features/gr-usrp2/gr-usrp2/src/qa_usrp2.py
===================================================================
--- gnuradio/branches/features/gr-usrp2/gr-usrp2/src/qa_usrp2.py
(rev 0)
+++ gnuradio/branches/features/gr-usrp2/gr-usrp2/src/qa_usrp2.py
2008-08-29 23:11:08 UTC (rev 9452)
@@ -0,0 +1,40 @@
+#!/usr/bin/env python
+#
+# Copyright 2005,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.
+#
+
+from gnuradio import gr, gr_unittest
+import usrp2
+
+class qa_usrp2(gr_unittest.TestCase):
+
+ def setUp(self):
+ self.tb = gr.top_block()
+
+ def tearDown(self):
+ self.tb = None
+
+ def test_000_nop (self):
+ """Just see if we can import the module...
+ They may not have a USRP2 connected, etc. Don't try to run anything"""
+ pass
+
+if __name__ == '__main__':
+ gr_unittest.main ()
Property changes on:
gnuradio/branches/features/gr-usrp2/gr-usrp2/src/qa_usrp2.py
___________________________________________________________________
Name: svn:executable
+ *
Modified: gnuradio/branches/features/gr-usrp2/gr-usrp2/src/run_tests.in
===================================================================
--- gnuradio/branches/features/gr-usrp2/gr-usrp2/src/run_tests.in
2008-08-29 21:42:16 UTC (rev 9451)
+++ gnuradio/branches/features/gr-usrp2/gr-usrp2/src/run_tests.in
2008-08-29 23:11:08 UTC (rev 9452)
@@ -5,13 +5,13 @@
# 3rd parameter is path to Python QA directory
# For OS/X
address@hidden@/usrp/host/lib/legacy:@abs_top_builddir@/usrp/host/lib/legacy/.libs:$DYLD_LIBRARY_PATH
address@hidden@/usrp2/host/lib/legacy:@abs_top_builddir@/usrp2/host/lib/legacy/.libs:$DYLD_LIBRARY_PATH
export DYLD_LIBRARY_PATH
# For Win32
address@hidden@/usrp/host/lib/legacy:@abs_top_builddir@/usrp/host/lib/legacy/.libs:$PATH
address@hidden@/usrp2/host/lib/legacy:@abs_top_builddir@/usrp2/host/lib/legacy/.libs:$PATH
@top_builddir@/run_tests.sh \
- @abs_top_srcdir@/gr-usrp \
- @abs_top_builddir@/gr-usrp \
+ @abs_top_srcdir@/gr-usrp2 \
+ @abs_top_builddir@/gr-usrp2 \
@srcdir@
Modified: gnuradio/branches/features/gr-usrp2/gr-usrp2/src/usrp2.i
===================================================================
--- gnuradio/branches/features/gr-usrp2/gr-usrp2/src/usrp2.i 2008-08-29
21:42:16 UTC (rev 9451)
+++ gnuradio/branches/features/gr-usrp2/gr-usrp2/src/usrp2.i 2008-08-29
23:11:08 UTC (rev 9452)
@@ -45,25 +45,9 @@
~usrp2_sink_base();
};
-#endif
// ----------------------------------------------------------------
-class usrp2_source_base : public gr_sync_block {
-
-protected:
- usrp2_source_base(const std::string &name,
- gr_io_signature_sptr output_signature)
- throw (std::runtime_error);
-
-public:
- ~usrp2_source_base();
-
-};
-
-#if 0
-// ----------------------------------------------------------------
-
GR_SWIG_BLOCK_MAGIC(usrp2,sink_32fc)
usrp2_sink_32fc_sptr
@@ -79,8 +63,23 @@
};
#endif
+
// ----------------------------------------------------------------
+class usrp2_source_base : public gr_sync_block {
+
+protected:
+ usrp2_source_base(const std::string &name,
+ gr_io_signature_sptr output_signature)
+ throw (std::runtime_error);
+
+public:
+ ~usrp2_source_base();
+
+};
+
+// ----------------------------------------------------------------
+
GR_SWIG_BLOCK_MAGIC(usrp2,source_32fc)
usrp2_source_32fc_sptr
@@ -98,6 +97,6 @@
~usrp2_source_32fc();
bool set_gain(double gain);
- //bool set_center_freq(double frequency, tune_result r);
+ //bool set_center_freq(double frequency, usrp2::tune_result r);
bool set_decim(int decimation_factor);
};
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Commit-gnuradio] r9452 - gnuradio/branches/features/gr-usrp2/gr-usrp2/src,
jcorgan <=