discuss-gnuradio
[Top][All Lists]
Advanced

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

[Discuss-gnuradio] wxPython GUI blocking


From: Adriann
Subject: [Discuss-gnuradio] wxPython GUI blocking
Date: Mon, 11 May 2009 04:30:21 -0700 (PDT)

Hy,
I have developed a GUI using wxPython which consists of a parent frame and
another frame in which I want to plot the results of each FFT calculation.
The problem is that sometimes when I run the "OnTune" or "OnStop" function i
get the following error:
"python: ../../src/xcb_lock.c:77: _XGetXCBBuffer: Assertion `((int)
((xcb_req) - (dpy->request)) >= 0)' failed."

Thank you very much! 

Here is some part of the code:
       def OnTune(self,event):
                self.t = Tuner.Tuner(self) //Tuner is a class from another file 
called
Tuner.py
                self.thread = threading.Thread(target=self.__run)
                self.thread.start()
        def __run(self):
                wx.CallAfter(self.AfterRun, "Tuner has started")
                self.t.StartTune()
                self.SetStatusText("Tunning Complete...")
        def AfterRun(self,msg):
                pass
        def OnStop(self, event):
                self.t.StopTune()
#####################################
in class Tuner I have:
##################################### 
def __init__(self, frame):
                wx.Frame.__init__(self, None, -1, "Tunning Stats")
                self.frame = frame
                self.Stop = False

def StartTune (self):
self.fftwindow = wx.Frame(self.frame,-1, "Tunning",
                                                                
style=wx.FRAME_FLOAT_ON_PARENT|wx.CAPTION|wx.CLOSE_BOX,
                                                                pos=(200,170), 
size=(500,500))
                
    # Create FFT Plot
    self.plot = wx.lib.plot.PlotCanvas(fftwindow, style=wx.RAISED_BORDER)    
    #start flow-graph
  while(True):
    tb = TunerFlowGraph(cf, fs, fsize) #TunerFlowGraph is the class where
the FlowGraph is defined
    tb.start()
    time.sleep(2)
# Make another processing not related to displaying 
    tb.stop()
    tb.wait()
    self.fftwindow = wx.Frame(self.frame,-1, "Tunning",
                                                                
style=wx.FRAME_FLOAT_ON_PARENT|wx.CAPTION|wx.CLOSE_BOX,
                                                                pos=(200,170), 
size=(500,500))
                
    # Create FFT Plot
    self.plot = wx.lib.plot.PlotCanvas(fftwindow, style=wx.RAISED_BORDER)
    data = []
    x = [i for i in range(fsize)]
    y = tb.v_sink_fft.out()//output data from fft 
    n = 0
    for xx in x:
        data.append((xx, y[n]))
        n += 1
    data_line = wx.lib.plot.PolyLine(data, colour='blue', width=1)
    gc = wx.lib.plot.PlotGraphics([data_line],  "CoPolar", "time(s)", "dB")
    self.plot.Draw(gc, xAxis=(0, fsize), yAxis=(-150, 0))               

def StopTune(self):
     self.Stop = True

-- 
View this message in context: 
http://www.nabble.com/wxPython-GUI-blocking-tp23481508p23481508.html
Sent from the GnuRadio mailing list archive at Nabble.com.





reply via email to

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