commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] r4082 - in gnuradio/branches/developers/jcorgan/sfg/gn


From: jcorgan
Subject: [Commit-gnuradio] r4082 - in gnuradio/branches/developers/jcorgan/sfg/gnuradio-core/src: lib/runtime python/gnuradio/gr
Date: Thu, 14 Dec 2006 09:11:38 -0700 (MST)

Author: jcorgan
Date: 2006-12-14 09:11:38 -0700 (Thu, 14 Dec 2006)
New Revision: 4082

Modified:
   
gnuradio/branches/developers/jcorgan/sfg/gnuradio-core/src/lib/runtime/gr_runtime.i
   
gnuradio/branches/developers/jcorgan/sfg/gnuradio-core/src/lib/runtime/gr_runtime_impl.cc
   
gnuradio/branches/developers/jcorgan/sfg/gnuradio-core/src/python/gnuradio/gr/hier_block2.py
   
gnuradio/branches/developers/jcorgan/sfg/gnuradio-core/src/python/gnuradio/gr/qa_runtime.py
Log:
Fix parameter passing type bug in gr.runtime

Modified: 
gnuradio/branches/developers/jcorgan/sfg/gnuradio-core/src/lib/runtime/gr_runtime.i
===================================================================
--- 
gnuradio/branches/developers/jcorgan/sfg/gnuradio-core/src/lib/runtime/gr_runtime.i
 2006-12-14 05:31:50 UTC (rev 4081)
+++ 
gnuradio/branches/developers/jcorgan/sfg/gnuradio-core/src/lib/runtime/gr_runtime.i
 2006-12-14 16:11:38 UTC (rev 4082)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004 Free Software Foundation, Inc.
+ * Copyright 2004,2006 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -24,7 +24,6 @@
 typedef boost::shared_ptr<gr_runtime> gr_runtime_sptr;
 %template(gr_runtime_sptr) boost::shared_ptr<gr_runtime>;
 
-%rename(runtime) gr_make_runtime;
 gr_runtime_sptr gr_make_runtime(gr_hier_block2_sptr top_block);
 
 class gr_runtime
@@ -33,10 +32,8 @@
     gr_runtime(gr_hier_block2_sptr top_block);
 
 public:
-    void start()
-        throw (std::runtime_error);
-    void stop();
-    void wait();
-    void run()
-        throw (std::runtime_error);
+    void run() throw (std::runtime_error);
+    void start() throw (std::runtime_error);
+    void stop() throw (std::runtime_error);
+    void wait() throw (std::runtime_error);
 };

Modified: 
gnuradio/branches/developers/jcorgan/sfg/gnuradio-core/src/lib/runtime/gr_runtime_impl.cc
===================================================================
--- 
gnuradio/branches/developers/jcorgan/sfg/gnuradio-core/src/lib/runtime/gr_runtime_impl.cc
   2006-12-14 05:31:50 UTC (rev 4081)
+++ 
gnuradio/branches/developers/jcorgan/sfg/gnuradio-core/src/lib/runtime/gr_runtime_impl.cc
   2006-12-14 16:11:38 UTC (rev 4082)
@@ -76,7 +76,7 @@
 gr_runtime_impl::stop()
 {
     if (!d_running)
-        return;
+        throw std::runtime_error("not running");
 
     for (gr_scheduler_thread_viter_t p = d_threads.begin(); 
          p != d_threads.end(); p++)

Modified: 
gnuradio/branches/developers/jcorgan/sfg/gnuradio-core/src/python/gnuradio/gr/hier_block2.py
===================================================================
--- 
gnuradio/branches/developers/jcorgan/sfg/gnuradio-core/src/python/gnuradio/gr/hier_block2.py
        2006-12-14 05:31:50 UTC (rev 4081)
+++ 
gnuradio/branches/developers/jcorgan/sfg/gnuradio-core/src/python/gnuradio/gr/hier_block2.py
        2006-12-14 16:11:38 UTC (rev 4082)
@@ -19,7 +19,7 @@
 # Boston, MA 02110-1301, USA.
 # 
 
-from gnuradio_swig_python import hier_block2_swig
+from gnuradio_swig_python import hier_block2_swig, gr_make_runtime 
 
 #
 # This hack forces a 'has-a' relationship to look like an 'is-a' one.
@@ -38,3 +38,13 @@
 
     def define_component(self, name, comp):
        return self._hb.define_component(name, comp.basic_block())
+
+class runtime(object):
+    def __init__(self, top_block):
+        if (isinstance(top_block, hier_block2)):
+            self._r = gr_make_runtime(top_block._hb)            
+        else:
+            self._r = gr_make_runtime(top_block)
+
+    def run(self):
+        self._r.run()

Modified: 
gnuradio/branches/developers/jcorgan/sfg/gnuradio-core/src/python/gnuradio/gr/qa_runtime.py
===================================================================
--- 
gnuradio/branches/developers/jcorgan/sfg/gnuradio-core/src/python/gnuradio/gr/qa_runtime.py
 2006-12-14 05:31:50 UTC (rev 4081)
+++ 
gnuradio/branches/developers/jcorgan/sfg/gnuradio-core/src/python/gnuradio/gr/qa_runtime.py
 2006-12-14 16:11:38 UTC (rev 4082)
@@ -10,7 +10,6 @@
     def tearDown(self):
        pass
 
-    """
     def test_001_run(self):
        hblock = gr.hier_block2("test_block", 
                                gr.io_signature(0,0,0), 
@@ -25,7 +24,6 @@
        runtime = gr.runtime(hblock)
        runtime.run()
        self.assertRaises(RuntimeError, lambda: runtime.run())
-    """
         
 if __name__ == "__main__":
     gr_unittest.main()





reply via email to

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