commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] r9271 - in gnuradio/branches/developers/jblum/glwxgui/


From: jcorgan
Subject: [Commit-gnuradio] r9271 - in gnuradio/branches/developers/jblum/glwxgui/gr-wxgui: . src/python
Date: Wed, 13 Aug 2008 19:49:30 -0600 (MDT)

Author: jcorgan
Date: 2008-08-13 19:49:30 -0600 (Wed, 13 Aug 2008)
New Revision: 9271

Modified:
   gnuradio/branches/developers/jblum/glwxgui/gr-wxgui/gr-wxgui.conf
   gnuradio/branches/developers/jblum/glwxgui/gr-wxgui/src/python/fftsink2.py
   gnuradio/branches/developers/jblum/glwxgui/gr-wxgui/src/python/scopesink2.py
   
gnuradio/branches/developers/jblum/glwxgui/gr-wxgui/src/python/waterfallsink2.py
Log:
Implement configurable sink usage

Modified: gnuradio/branches/developers/jblum/glwxgui/gr-wxgui/gr-wxgui.conf
===================================================================
--- gnuradio/branches/developers/jblum/glwxgui/gr-wxgui/gr-wxgui.conf   
2008-08-14 01:27:15 UTC (rev 9270)
+++ gnuradio/branches/developers/jblum/glwxgui/gr-wxgui/gr-wxgui.conf   
2008-08-14 01:49:30 UTC (rev 9271)
@@ -3,5 +3,6 @@
 # ~/.gnuradio/config.conf
 
 [wxgui]
+style = auto      # 'gl', 'nongl', or 'auto'
 fft_rate = 15    # fftsink and waterfallsink
 frame_decim = 1   # scopesink

Modified: 
gnuradio/branches/developers/jblum/glwxgui/gr-wxgui/src/python/fftsink2.py
===================================================================
--- gnuradio/branches/developers/jblum/glwxgui/gr-wxgui/src/python/fftsink2.py  
2008-08-14 01:27:15 UTC (rev 9270)
+++ gnuradio/branches/developers/jblum/glwxgui/gr-wxgui/src/python/fftsink2.py  
2008-08-14 01:49:30 UTC (rev 9271)
@@ -21,11 +21,25 @@
 
 from gnuradio import gr
 
-try:
-       assert gr.prefs() #TODO
-       import wx
+p = gr.prefs()
+style = p.get_string('wxgui', 'style', 'auto')
+
+# In 3.2 we'll change 'auto' to mean 'gl'
+if style == 'auto':
+    style = 'nongl'
+
+if style == 'nongl':
+    from fftsink2_old import fft_sink_f, fft_sink_c
+elif style == 'gl':
+    try:
+        import wx
        wx.glcanvas.GLCanvas
+    except (ImportError, AttributeError, AssertionError):
+        raise RuntimeError("wxPython doesn't support glcanvas")
+        
+    try:        
        from OpenGL.GL import *
-       from fftsink_gl import fft_sink_f, fft_sink_c
-except (ImportError, AttributeError, AssertionError):
-       from fftsink2_old import fft_sink_f, fft_sink_c
+    except (ImportError, AttributeError, AssertionError):
+        raise RuntimeError("Unable to import OpenGL. Are Python wrappers for 
OpenGL installed?")
+        
+    from fftsink_gl import fft_sink_f, fft_sink_c

Modified: 
gnuradio/branches/developers/jblum/glwxgui/gr-wxgui/src/python/scopesink2.py
===================================================================
--- 
gnuradio/branches/developers/jblum/glwxgui/gr-wxgui/src/python/scopesink2.py    
    2008-08-14 01:27:15 UTC (rev 9270)
+++ 
gnuradio/branches/developers/jblum/glwxgui/gr-wxgui/src/python/scopesink2.py    
    2008-08-14 01:49:30 UTC (rev 9271)
@@ -21,11 +21,25 @@
 
 from gnuradio import gr
 
-try:
-       assert gr.prefs() #TODO
-       import wx
+p = gr.prefs()
+style = p.get_string('wxgui', 'style', 'auto')
+
+# In 3.2 we'll change 'auto' to mean 'gl'
+if style == 'auto':
+    style = 'nongl'
+
+if style == 'nongl':
+    from scopesink2_old import scope_sink_f, scope_sink_c
+elif style == 'gl':
+    try:
+        import wx
        wx.glcanvas.GLCanvas
+    except (ImportError, AttributeError, AssertionError):
+        raise RuntimeError("wxPython doesn't support glcanvas")
+        
+    try:        
        from OpenGL.GL import *
-       from scopesink_gl import scope_sink_f, scope_sink_c
-except (ImportError, AttributeError, AssertionError):
-       from scopesink2_old import scope_sink_f, scope_sink_c
+    except (ImportError, AttributeError, AssertionError):
+        raise RuntimeError("Unable to import OpenGL. Are Python wrappers for 
OpenGL installed?")
+        
+    from scopesink_gl import scope_sink_f, scope_sink_c

Modified: 
gnuradio/branches/developers/jblum/glwxgui/gr-wxgui/src/python/waterfallsink2.py
===================================================================
--- 
gnuradio/branches/developers/jblum/glwxgui/gr-wxgui/src/python/waterfallsink2.py
    2008-08-14 01:27:15 UTC (rev 9270)
+++ 
gnuradio/branches/developers/jblum/glwxgui/gr-wxgui/src/python/waterfallsink2.py
    2008-08-14 01:49:30 UTC (rev 9271)
@@ -21,11 +21,25 @@
 
 from gnuradio import gr
 
-try:
-       assert gr.prefs() #TODO
-       import wx
+p = gr.prefs()
+style = p.get_string('wxgui', 'style', 'auto')
+
+# In 3.2 we'll change 'auto' to mean 'gl'
+if style == 'auto':
+    style = 'nongl'
+
+if style == 'nongl':
+    from waterfallsink2_old import waterfall_sink_f, waterfall_sink_c
+elif style == 'gl':
+    try:
+        import wx
        wx.glcanvas.GLCanvas
+    except (ImportError, AttributeError, AssertionError):
+        raise RuntimeError("wxPython doesn't support glcanvas")
+        
+    try:        
        from OpenGL.GL import *
-       from waterfallsink_gl import waterfall_sink_f, waterfall_sink_c
-except (ImportError, AttributeError, AssertionError):
-       from waterfallsink2_old import waterfall_sink_f, waterfall_sink_c
+    except (ImportError, AttributeError, AssertionError):
+        raise RuntimeError("Unable to import OpenGL. Are Python wrappers for 
OpenGL installed?")
+        
+    from waterfallsink_gl import waterfall_sink_f, waterfall_sink_c





reply via email to

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