commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] r9482 - gnuradio/trunk/gr-wxgui/src/python/plotter


From: jblum
Subject: [Commit-gnuradio] r9482 - gnuradio/trunk/gr-wxgui/src/python/plotter
Date: Tue, 2 Sep 2008 01:24:20 -0600 (MDT)

Author: jblum
Date: 2008-09-02 01:24:19 -0600 (Tue, 02 Sep 2008)
New Revision: 9482

Modified:
   gnuradio/trunk/gr-wxgui/src/python/plotter/plotter_base.py
   gnuradio/trunk/gr-wxgui/src/python/plotter/waterfall_plotter.py
Log:
replaced semaphore with primitive lock, adjusted drawing bounds

Modified: gnuradio/trunk/gr-wxgui/src/python/plotter/plotter_base.py
===================================================================
--- gnuradio/trunk/gr-wxgui/src/python/plotter/plotter_base.py  2008-09-02 
02:36:46 UTC (rev 9481)
+++ gnuradio/trunk/gr-wxgui/src/python/plotter/plotter_base.py  2008-09-02 
07:24:19 UTC (rev 9482)
@@ -54,7 +54,7 @@
                Bind the paint and size events.
                @param parent the parent widgit
                """
-               self._semaphore = threading.Semaphore(1)
+               self._global_lock = threading.Lock()
                attribList = (wx.glcanvas.WX_GL_DOUBLEBUFFER, 
wx.glcanvas.WX_GL_RGBA)
                wx.glcanvas.GLCanvas.__init__(self, parent, 
attribList=attribList)
                self.changed(False)
@@ -64,8 +64,8 @@
                self.Bind(wx.EVT_PAINT, self._on_paint)
                self.Bind(wx.EVT_SIZE, self._on_size)
 
-       def lock(self): self._semaphore.acquire(True)
-       def unlock(self): self._semaphore.release()
+       def lock(self): self._global_lock.acquire()
+       def unlock(self): self._global_lock.release()
 
        def _on_size(self, event):
                """!
@@ -244,12 +244,13 @@
                # Draw Border
                ##################################################
                glColor3f(*GRID_LINE_COLOR_SPEC)
-               glBegin(GL_LINE_LOOP)
-               glVertex3f(self.padding_left, self.padding_top, 0)
-               glVertex3f(self.width - self.padding_right, self.padding_top, 0)
-               glVertex3f(self.width - self.padding_right, self.height - 
self.padding_bottom, 0)
-               glVertex3f(self.padding_left, self.height - 
self.padding_bottom, 0)
-               glEnd()
+               self._draw_rect(
+                       self.padding_left,
+                       self.padding_top,
+                       self.width - self.padding_right - self.padding_left,
+                       self.height - self.padding_top - self.padding_bottom,
+                       fill=False,
+               )
                ##################################################
                # Draw Grid X
                ##################################################

Modified: gnuradio/trunk/gr-wxgui/src/python/plotter/waterfall_plotter.py
===================================================================
--- gnuradio/trunk/gr-wxgui/src/python/plotter/waterfall_plotter.py     
2008-09-02 02:36:46 UTC (rev 9481)
+++ gnuradio/trunk/gr-wxgui/src/python/plotter/waterfall_plotter.py     
2008-09-02 07:24:19 UTC (rev 9482)
@@ -152,10 +152,10 @@
                glEnable(GL_TEXTURE_2D)
                glPushMatrix()
                #matrix scaling
-               glTranslatef(self.padding_left+1, self.padding_top, 0)
+               glTranslatef(self.padding_left, self.padding_top, 0)
                glScalef(
-                       
float(self.width-self.padding_left-self.padding_right-1),
-                       
float(self.height-self.padding_top-self.padding_bottom-1),
+                       float(self.width-self.padding_left-self.padding_right),
+                       float(self.height-self.padding_top-self.padding_bottom),
                        1.0,
                )
                #draw texture with wrapping





reply via email to

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