diff options
author | jcorgan | 2009-05-23 16:43:05 +0000 |
---|---|---|
committer | jcorgan | 2009-05-23 16:43:05 +0000 |
commit | 2cd2d8f3ab6971ececbb44ddb2e2a4c7fc3bf1a5 (patch) | |
tree | 9f1a37bbab3e9336f1555bcd7354cb242967dcd4 | |
parent | e774683a3b1c719b44dd4a7667228c4bf6e7d089 (diff) | |
download | gnuradio-2cd2d8f3ab6971ececbb44ddb2e2a4c7fc3bf1a5.tar.gz gnuradio-2cd2d8f3ab6971ececbb44ddb2e2a4c7fc3bf1a5.tar.bz2 gnuradio-2cd2d8f3ab6971ececbb44ddb2e2a4c7fc3bf1a5.zip |
Change wxgui style default now so 'auto' tries for OpenGL sinks and falls back to non-GL sinks.
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@11091 221aa14e-8319-0410-a670-987f0aec2ac5
-rw-r--r-- | gr-wxgui/src/python/fftsink2.py | 25 | ||||
-rw-r--r-- | gr-wxgui/src/python/scopesink2.py | 25 | ||||
-rw-r--r-- | gr-wxgui/src/python/waterfallsink2.py | 25 |
3 files changed, 33 insertions, 42 deletions
diff --git a/gr-wxgui/src/python/fftsink2.py b/gr-wxgui/src/python/fftsink2.py index ecc60834b..3277cd3ff 100644 --- a/gr-wxgui/src/python/fftsink2.py +++ b/gr-wxgui/src/python/fftsink2.py @@ -1,5 +1,5 @@ # -# Copyright 2008 Free Software Foundation, Inc. +# Copyright 2008,2009 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -24,21 +24,18 @@ from gnuradio import gr p = gr.prefs() style = p.get_string('wxgui', 'style', 'auto') -# In 3.2 we'll change 'auto' to mean 'gl' if possible, then fallback -# Currently, anything other than 'gl' means 'nongl' - -if style == 'gl': +if style == 'auto' or style == 'gl': try: import wx.glcanvas - except ImportError: - raise RuntimeError("wxPython doesn't support glcanvas") - - try: from OpenGL.GL import * + from fftsink_gl import fft_sink_f, fft_sink_c except ImportError: - raise RuntimeError("Unable to import OpenGL. Are Python wrappers for OpenGL installed?") - - from fftsink_gl import fft_sink_f, fft_sink_c - -else: + if style == 'gl': + raise RuntimeError("Unable to import OpenGL. Are Python wrappers for OpenGL installed?") + else: + # Fall backto non-gl sinks + from fftsink_nongl import fft_sink_f, fft_sink_c +elif style == 'nongl': from fftsink_nongl import fft_sink_f, fft_sink_c +else: + raise RuntimeError("Unknown wxgui style") diff --git a/gr-wxgui/src/python/scopesink2.py b/gr-wxgui/src/python/scopesink2.py index 87aa4337f..99e268895 100644 --- a/gr-wxgui/src/python/scopesink2.py +++ b/gr-wxgui/src/python/scopesink2.py @@ -1,5 +1,5 @@ # -# Copyright 2008 Free Software Foundation, Inc. +# Copyright 2008,2009 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -24,21 +24,18 @@ from gnuradio import gr p = gr.prefs() style = p.get_string('wxgui', 'style', 'auto') -# In 3.2 we'll change 'auto' to mean 'gl' if possible, then fallback -# Currently, anything other than 'gl' means 'nongl' - -if style == 'gl': +if style == 'auto' or style == 'gl': try: import wx.glcanvas - except ImportError: - raise RuntimeError("wxPython doesn't support glcanvas") - - try: from OpenGL.GL import * + from scopesink_gl import scope_sink_f, scope_sink_c except ImportError: - raise RuntimeError("Unable to import OpenGL. Are Python wrappers for OpenGL installed?") - - from scopesink_gl import scope_sink_f, scope_sink_c - -else: + if style == 'gl': + raise RuntimeError("Unable to import OpenGL. Are Python wrappers for OpenGL installed?") + else: + # Fall backto non-gl sinks + from scopesink_nongl import scope_sink_f, scope_sink_c +elif style == 'nongl': from scopesink_nongl import scope_sink_f, scope_sink_c +else: + raise RuntimeError("Unknown wxgui style") diff --git a/gr-wxgui/src/python/waterfallsink2.py b/gr-wxgui/src/python/waterfallsink2.py index 08e96105d..0b876fc3e 100644 --- a/gr-wxgui/src/python/waterfallsink2.py +++ b/gr-wxgui/src/python/waterfallsink2.py @@ -1,5 +1,5 @@ # -# Copyright 2008 Free Software Foundation, Inc. +# Copyright 2008,2009 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -24,21 +24,18 @@ from gnuradio import gr p = gr.prefs() style = p.get_string('wxgui', 'style', 'auto') -# In 3.2 we'll change 'auto' to mean 'gl' if possible, then fallback -# Currently, anything other than 'gl' means 'nongl' - -if style == 'gl': +if style == 'auto' or style == 'gl': try: import wx.glcanvas - except ImportError: - raise RuntimeError("wxPython doesn't support glcanvas") - - try: from OpenGL.GL import * + from waterfallsink_gl import waterfall_sink_f, waterfall_sink_c except ImportError: - raise RuntimeError("Unable to import OpenGL. Are Python wrappers for OpenGL installed?") - - from waterfallsink_gl import waterfall_sink_f, waterfall_sink_c - -else: + if style == 'gl': + raise RuntimeError("Unable to import OpenGL. Are Python wrappers for OpenGL installed?") + else: + # Fall backto non-gl sinks + from waterfallsink_nongl import waterfall_sink_f, waterfall_sink_c +elif style == 'nongl': from waterfallsink_nongl import waterfall_sink_f, waterfall_sink_c +else: + raise RuntimeError("Unknown wxgui style") |