commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] r7160 - gnuradio/branches/developers/jcorgan/t127/usrp


From: jcorgan
Subject: [Commit-gnuradio] r7160 - gnuradio/branches/developers/jcorgan/t127/usrpdb/src
Date: Thu, 13 Dec 2007 18:37:30 -0700 (MST)

Author: jcorgan
Date: 2007-12-13 18:37:30 -0700 (Thu, 13 Dec 2007)
New Revision: 7160

Added:
   gnuradio/branches/developers/jcorgan/t127/usrpdb/src/usrpdb_hwa.i
Modified:
   gnuradio/branches/developers/jcorgan/t127/usrpdb/src/Makefile.am
   gnuradio/branches/developers/jcorgan/t127/usrpdb/src/qa_basic_tx.py
   gnuradio/branches/developers/jcorgan/t127/usrpdb/src/qa_usrpdb.py
   gnuradio/branches/developers/jcorgan/t127/usrpdb/src/usrpdb_hwa_qa.cc
   gnuradio/branches/developers/jcorgan/t127/usrpdb/src/usrpdb_hwa_qa.h
   gnuradio/branches/developers/jcorgan/t127/usrpdb/src/usrpdb_hwa_qa.i
Log:
Fixed swig and inheritance issues.

Modified: gnuradio/branches/developers/jcorgan/t127/usrpdb/src/Makefile.am
===================================================================
--- gnuradio/branches/developers/jcorgan/t127/usrpdb/src/Makefile.am    
2007-12-14 00:46:59 UTC (rev 7159)
+++ gnuradio/branches/developers/jcorgan/t127/usrpdb/src/Makefile.am    
2007-12-14 01:37:30 UTC (rev 7160)
@@ -32,9 +32,10 @@
 TESTS = run_tests
 
 LOCAL_IFILES =                                 \
-       $(top_srcdir)/usrpdb/src/usrpdb.i \
-       $(top_srcdir)/usrpdb/src/usrpdb_basic_tx.i \
-       $(top_srcdir)/usrpdb/src/usrpdb_hwa_qa.i
+       usrpdb.i                        \
+       usrpdb_basic_tx.i               \
+       usrpdb_hwa.i                    \
+       usrpdb_hwa_qa.i
 
 REMOTE_IFILES =                                \
        $(top_srcdir)/gnuradio-core/src/lib/swig/shared_ptr.i

Modified: gnuradio/branches/developers/jcorgan/t127/usrpdb/src/qa_basic_tx.py
===================================================================
--- gnuradio/branches/developers/jcorgan/t127/usrpdb/src/qa_basic_tx.py 
2007-12-14 00:46:59 UTC (rev 7159)
+++ gnuradio/branches/developers/jcorgan/t127/usrpdb/src/qa_basic_tx.py 
2007-12-14 01:37:30 UTC (rev 7160)
@@ -33,7 +33,7 @@
        self.db = None
        self.hwa = None
 
-    def test_000_gain(self):
+    def test_000_set_gain(self):
        self.db.set_gain(-10.0) 
        self.assertEqual(self.hwa.dac_pga_gain(), -10.0)
     

Modified: gnuradio/branches/developers/jcorgan/t127/usrpdb/src/qa_usrpdb.py
===================================================================
--- gnuradio/branches/developers/jcorgan/t127/usrpdb/src/qa_usrpdb.py   
2007-12-14 00:46:59 UTC (rev 7159)
+++ gnuradio/branches/developers/jcorgan/t127/usrpdb/src/qa_usrpdb.py   
2007-12-14 01:37:30 UTC (rev 7160)
@@ -31,8 +31,7 @@
     def tearDown(self):
        self.hwa = None
 
-    def test_000_foo(self):
-       self.assertEqual(self.hwa.foo(), 42)
+    def test_000_nop(self):
         pass
     
 if __name__ == '__main__':

Added: gnuradio/branches/developers/jcorgan/t127/usrpdb/src/usrpdb_hwa.i
===================================================================
--- gnuradio/branches/developers/jcorgan/t127/usrpdb/src/usrpdb_hwa.i           
                (rev 0)
+++ gnuradio/branches/developers/jcorgan/t127/usrpdb/src/usrpdb_hwa.i   
2007-12-14 01:37:30 UTC (rev 7160)
@@ -0,0 +1,42 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2007 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 <usrpdb_hwa.h>
+%}
+
+class usrpdb_hwa;
+typedef boost::shared_ptr<usrpdb_hwa> usrpdb_hwa_sptr;
+%template(usrpdb_hwa_sptr) boost::shared_ptr<usrpdb_hwa>;
+
+class usrpdb_hwa 
+{
+public:
+  usrpdb_hwa();
+
+  virtual float dac_pga_gain() = 0;
+  virtual float dac_pga_min() = 0;
+  virtual float dac_pga_max() = 0;
+  virtual float dac_pga_db_per_step() = 0;
+  virtual void set_dac_pga(float gain) = 0;
+  virtual ~usrpdb_hwa() = 0;
+};

Modified: gnuradio/branches/developers/jcorgan/t127/usrpdb/src/usrpdb_hwa_qa.cc
===================================================================
--- gnuradio/branches/developers/jcorgan/t127/usrpdb/src/usrpdb_hwa_qa.cc       
2007-12-14 00:46:59 UTC (rev 7159)
+++ gnuradio/branches/developers/jcorgan/t127/usrpdb/src/usrpdb_hwa_qa.cc       
2007-12-14 01:37:30 UTC (rev 7160)
@@ -25,11 +25,14 @@
 #endif
 
 #include <usrpdb_hwa_qa.h>
+#include <iostream>
 
-usrpdb_hwa_qa_sptr 
+#define USRPDB_HWA_QA_DEBUG 1
+
+usrpdb_hwa_sptr 
 usrpdb_make_qa_hwa()
 {
-  return usrpdb_hwa_qa_sptr(new usrpdb_hwa_qa());
+  return usrpdb_hwa_sptr(new usrpdb_hwa_qa());
 }
 
 usrpdb_hwa_qa::usrpdb_hwa_qa()
@@ -67,6 +70,8 @@
 void
 usrpdb_hwa_qa::set_dac_pga(float gain)
 {
+  if (USRPDB_HWA_QA_DEBUG)
+    std::cout << "usrpdb_hwa_qa: setting DAC PGA gain to " << gain << 
std::endl;
   d_dac_pga_gain = gain;
 }
 

Modified: gnuradio/branches/developers/jcorgan/t127/usrpdb/src/usrpdb_hwa_qa.h
===================================================================
--- gnuradio/branches/developers/jcorgan/t127/usrpdb/src/usrpdb_hwa_qa.h        
2007-12-14 00:46:59 UTC (rev 7159)
+++ gnuradio/branches/developers/jcorgan/t127/usrpdb/src/usrpdb_hwa_qa.h        
2007-12-14 01:37:30 UTC (rev 7160)
@@ -26,23 +26,19 @@
 #include <usrpdb_hwa.h>
 #include <boost/shared_ptr.hpp>
 
-class usrpdb_hwa_qa;
-typedef boost::shared_ptr<usrpdb_hwa_qa> usrpdb_hwa_qa_sptr;
+usrpdb_hwa_sptr usrpdb_make_qa_hwa();
 
-usrpdb_hwa_qa_sptr usrpdb_make_qa_hwa();
-
-class usrpdb_hwa_qa : usrpdb_hwa
+class usrpdb_hwa_qa : public usrpdb_hwa
 {
   usrpdb_hwa_qa();
 
-  friend usrpdb_hwa_qa_sptr usrpdb_make_qa_hwa();
+  friend usrpdb_hwa_sptr usrpdb_make_qa_hwa();
 
   // Mimic dummy hardware
   float d_dac_pga_gain;
   
 public:
 
-  int foo() const { return 42; }
   ~usrpdb_hwa_qa();
 
   float dac_pga_gain();

Modified: gnuradio/branches/developers/jcorgan/t127/usrpdb/src/usrpdb_hwa_qa.i
===================================================================
--- gnuradio/branches/developers/jcorgan/t127/usrpdb/src/usrpdb_hwa_qa.i        
2007-12-14 00:46:59 UTC (rev 7159)
+++ gnuradio/branches/developers/jcorgan/t127/usrpdb/src/usrpdb_hwa_qa.i        
2007-12-14 01:37:30 UTC (rev 7160)
@@ -24,23 +24,18 @@
 #include <usrpdb_hwa_qa.h>
 %}
 
-#include <usrpdb_hwa.h>
+%include <usrpdb_hwa.i>
 
-class usrpdb_hwa_qa;
-typedef boost::shared_ptr<usrpdb_hwa_qa> usrpdb_hwa_qa_sptr;
-%template(usrpdb_hwa_qa_sptr) boost::shared_ptr<usrpdb_hwa_qa>;
 %rename(hwa_qa) usrpdb_make_qa_hwa;
 %ignore hwa_qa;
 
-usrpdb_hwa_qa_sptr usrpdb_make_qa_hwa();
+usrpdb_hwa_sptr usrpdb_make_qa_hwa();
 
 class usrpdb_hwa_qa : public usrpdb_hwa
 {
-protected:
   usrpdb_hwa_qa();
 
 public:
-  int foo() const { return 42; }
   ~usrpdb_hwa_qa();
 
   float dac_pga_gain();





reply via email to

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