## Re: [Pmw-general] Pmw.Blt problem

 Re: [Pmw-general] Pmw.Blt problem From: David McNab - 2003-07-11 01:09:40 ```BLT is a bit of a chronic problem in the PMW world. Apparently some stubborn and obscure bugs in BLT that never get fixed. If you don't manage to nail the problem, the last-resort solution would be to build a standalone PMW without BLT. All BLT problems in PMW are known to go away when BLT is completely removed from the 'mix'. Cheers David On Fri, 2003-07-11 at 07:52, Jason Wennerberg wrote: > Hi, > > I'm trying to get a Tk window to pop up in a command line application to > display a graph of x vs y. This is the function I'm using: > > def degauss_blt(object,Tau,Omega,Imax,sleepy_time): > master = Tk() #create an instance of Tk > Pmw.initialise(master) > vector_x = Pmw.Blt.Vector() #these vectors hold x an y data > vector_y = Pmw.Blt.Vector() #vector is a member of Pmw.Blt > g = Pmw.Blt.Graph(master) #Create a graph widget > g.pack(expand=1,fill='both') #pack the graph widget > #make a line between the points in the vector > g.line_create('I vs > t',xdata=vector_x,ydata=vector_y,color='red',dashes=0,linewidth=2,symbol='') > g.configure(title='I vs t...Degausing') #set the title > t=0 #Start at t=0 > go = 1 > Iminus1 = 0 > period = (2*3.14159)/Omega #period based on input frequency > if de.bug: print "period = ", period > while go == 1: > I = Imax*exp(-t/Tau)*cos(Omega*t) #This is the function we use to get I vs t > if de.bug: print "I = ", I > immediate_write(object.address,2,I) #Write the value of I to the device > print "Setting %s to %f Amps" %(object.address,I) > sleep(sleepy_time) #wait > if (abs(I - Iminus1) < .1): go = 0 #check for epsilon > Iminus1=I > vector_x.append(t) #add data points to the vectors > vector_y.append(I) > master.update_idletasks() #update the graph > t= t + (period/2) #Next point is half a period later > ##end of while loop > I = 0.0 > immediate_write(object.address,2,I) #finally set to zero > print "Setting %s to %f Amps" %(object.address,I) > master.mainloop() > del master > del vector_x > del vector_y > > Sorry its not properly indented > > When I run this the first time it works just fine. When I call the function > the second time I get this error: > > Traceback (most recent call last): > File "./a0_beam_control.py", line 104, in ? > degauss_blt(devices.list[object],atof(Tau),atof(Omega),atof(Imax),atof(sleepy) > ) > File "./a0controllib.py", line 179, in degauss_blt > vector_x = Pmw.Blt.Vector() #these vectors hold x an y data > File "/usr/lib/python2.2/site-packages/Pmw/Pmw_1_1/lib/PmwBlt.py", line 99, in > __init__ > self.tk.call(_vectorCommand, 'create', self._name) > TclError: invalid command name "::blt::vector" > Exception TclError: 'invalid command name "::blt::vector"' in Vector.__del__ of []> ignored > > Any ideas on how to fix this? I've looked all over the web and can't find a > solution. Any help you could provide would be very much appreciated. > > Thank you in advance > Jason Wennerberg > Fermilab Nicadd Photoinjector lab > jasonw@... > > > > ------------------------------------------------------- > This SF.Net email sponsored by: Parasoft > Error proof Web apps, automate testing & more. > Download & eval WebKing and get a free book. > http://www.parasoft.com/bulletproofapps1 > _______________________________________________ > Pmw-general mailing list > Pmw-general@... > https://lists.sourceforge.net/lists/listinfo/pmw-general -- Kind regards David -- leave this line intact so your email gets through my junk mail filter ```

 [Pmw-general] Pmw.Blt problem From: Jason Wennerberg - 2003-07-10 19:54:24 ```Hi, I'm trying to get a Tk window to pop up in a command line application to display a graph of x vs y. This is the function I'm using: def degauss_blt(object,Tau,Omega,Imax,sleepy_time): master = Tk() #create an instance of Tk Pmw.initialise(master) vector_x = Pmw.Blt.Vector() #these vectors hold x an y data vector_y = Pmw.Blt.Vector() #vector is a member of Pmw.Blt g = Pmw.Blt.Graph(master) #Create a graph widget g.pack(expand=1,fill='both') #pack the graph widget #make a line between the points in the vector g.line_create('I vs t',xdata=vector_x,ydata=vector_y,color='red',dashes=0,linewidth=2,symbol='') g.configure(title='I vs t...Degausing') #set the title t=0 #Start at t=0 go = 1 Iminus1 = 0 period = (2*3.14159)/Omega #period based on input frequency if de.bug: print "period = ", period while go == 1: I = Imax*exp(-t/Tau)*cos(Omega*t) #This is the function we use to get I vs t if de.bug: print "I = ", I immediate_write(object.address,2,I) #Write the value of I to the device print "Setting %s to %f Amps" %(object.address,I) sleep(sleepy_time) #wait if (abs(I - Iminus1) < .1): go = 0 #check for epsilon Iminus1=I vector_x.append(t) #add data points to the vectors vector_y.append(I) master.update_idletasks() #update the graph t= t + (period/2) #Next point is half a period later ##end of while loop I = 0.0 immediate_write(object.address,2,I) #finally set to zero print "Setting %s to %f Amps" %(object.address,I) master.mainloop() del master del vector_x del vector_y Sorry its not properly indented When I run this the first time it works just fine. When I call the function the second time I get this error: Traceback (most recent call last): File "./a0_beam_control.py", line 104, in ? degauss_blt(devices.list[object],atof(Tau),atof(Omega),atof(Imax),atof(sleepy) ) File "./a0controllib.py", line 179, in degauss_blt vector_x = Pmw.Blt.Vector() #these vectors hold x an y data File "/usr/lib/python2.2/site-packages/Pmw/Pmw_1_1/lib/PmwBlt.py", line 99, in __init__ self.tk.call(_vectorCommand, 'create', self._name) TclError: invalid command name "::blt::vector" Exception TclError: 'invalid command name "::blt::vector"' in ignored Any ideas on how to fix this? I've looked all over the web and can't find a solution. Any help you could provide would be very much appreciated. Thank you in advance Jason Wennerberg Fermilab Nicadd Photoinjector lab jasonw@... ```
 Re: [Pmw-general] Pmw.Blt problem From: David McNab - 2003-07-11 01:09:40 ```BLT is a bit of a chronic problem in the PMW world. Apparently some stubborn and obscure bugs in BLT that never get fixed. If you don't manage to nail the problem, the last-resort solution would be to build a standalone PMW without BLT. All BLT problems in PMW are known to go away when BLT is completely removed from the 'mix'. Cheers David On Fri, 2003-07-11 at 07:52, Jason Wennerberg wrote: > Hi, > > I'm trying to get a Tk window to pop up in a command line application to > display a graph of x vs y. This is the function I'm using: > > def degauss_blt(object,Tau,Omega,Imax,sleepy_time): > master = Tk() #create an instance of Tk > Pmw.initialise(master) > vector_x = Pmw.Blt.Vector() #these vectors hold x an y data > vector_y = Pmw.Blt.Vector() #vector is a member of Pmw.Blt > g = Pmw.Blt.Graph(master) #Create a graph widget > g.pack(expand=1,fill='both') #pack the graph widget > #make a line between the points in the vector > g.line_create('I vs > t',xdata=vector_x,ydata=vector_y,color='red',dashes=0,linewidth=2,symbol='') > g.configure(title='I vs t...Degausing') #set the title > t=0 #Start at t=0 > go = 1 > Iminus1 = 0 > period = (2*3.14159)/Omega #period based on input frequency > if de.bug: print "period = ", period > while go == 1: > I = Imax*exp(-t/Tau)*cos(Omega*t) #This is the function we use to get I vs t > if de.bug: print "I = ", I > immediate_write(object.address,2,I) #Write the value of I to the device > print "Setting %s to %f Amps" %(object.address,I) > sleep(sleepy_time) #wait > if (abs(I - Iminus1) < .1): go = 0 #check for epsilon > Iminus1=I > vector_x.append(t) #add data points to the vectors > vector_y.append(I) > master.update_idletasks() #update the graph > t= t + (period/2) #Next point is half a period later > ##end of while loop > I = 0.0 > immediate_write(object.address,2,I) #finally set to zero > print "Setting %s to %f Amps" %(object.address,I) > master.mainloop() > del master > del vector_x > del vector_y > > Sorry its not properly indented > > When I run this the first time it works just fine. When I call the function > the second time I get this error: > > Traceback (most recent call last): > File "./a0_beam_control.py", line 104, in ? > degauss_blt(devices.list[object],atof(Tau),atof(Omega),atof(Imax),atof(sleepy) > ) > File "./a0controllib.py", line 179, in degauss_blt > vector_x = Pmw.Blt.Vector() #these vectors hold x an y data > File "/usr/lib/python2.2/site-packages/Pmw/Pmw_1_1/lib/PmwBlt.py", line 99, in > __init__ > self.tk.call(_vectorCommand, 'create', self._name) > TclError: invalid command name "::blt::vector" > Exception TclError: 'invalid command name "::blt::vector"' in Vector.__del__ of []> ignored > > Any ideas on how to fix this? I've looked all over the web and can't find a > solution. Any help you could provide would be very much appreciated. > > Thank you in advance > Jason Wennerberg > Fermilab Nicadd Photoinjector lab > jasonw@... > > > > ------------------------------------------------------- > This SF.Net email sponsored by: Parasoft > Error proof Web apps, automate testing & more. > Download & eval WebKing and get a free book. > http://www.parasoft.com/bulletproofapps1 > _______________________________________________ > Pmw-general mailing list > Pmw-general@... > https://lists.sourceforge.net/lists/listinfo/pmw-general -- Kind regards David -- leave this line intact so your email gets through my junk mail filter ```