try to solve bcollect.invoke problem

This commit is contained in:
jens 2020-12-25 15:30:25 +01:00
parent 6d598d9297
commit 5d073d5ad5

View File

@ -406,12 +406,13 @@ class Jfsphoto (object):
def toggle():
if self.kbtn.config('relief')[-1] == 'sunken':
self.kbtn.config(relief='raised')
self.do_2dprint()
#self.do_2dprint()
self.proji3d=False
else:
self.kbtn.config(relief='sunken')
self.do_3dprint()
#self.do_3dprint()
self.proji3d=True
self.look()
win = tk.Toplevel()
self.center = tk.Frame(win, bg='gray2', width=800, height=400, padx=3, pady=3)
@ -459,15 +460,15 @@ class Jfsphoto (object):
win.grab_set()
win.wait_window()
def do_2dprint(self):
self.ax1 = self.fig.add_subplot(111)
self.look()
# def do_2dprint(self):
# self.ax1 = self.fig.add_subplot(111)
# self.look()
def do_3dprint(self):
self.ax1 = self.fig.gca(projection='3d')
for xx in self.col_list:
self.df.plot(y = 'nmscale',x = xx, zs= int(xx), linewidth=0.6,ax=self.ax1)
self.canvas.draw()
# def do_3dprint(self):
# self.ax1 = self.fig.gca(projection='3d')
# for xx in self.col_list:
# self.df.plot(y = 'nmscale',x = xx, zs= int(xx), linewidth=0.6,ax=self.ax1)
# self.canvas.draw()
def show_selected(self):
self.col_list = [self.listbox.get(i) for i in self.listbox.curselection()]
@ -628,8 +629,18 @@ class Jfsphoto (object):
'size': 8,
}
def waitfor():
print('Waiting')
def waitfor(x,name,val,p):
#panel.bcollect.invoke()
print('Working')
self.df['m1'] = config.rxData16
d = self.df.iloc[p]['darkline']
b = self.df.iloc[p]['baseline']
w = self.df.iloc[p]["m1"]
val[3]= np.log10(b/(d-w))
val[4]= panel.SHvalue.get()
val[5]= panel.ICGvalue.get()
tree.item(x, text=name,values=val)
def cb1(event):
print(panel.SHvalue.get(), panel.ICGvalue.get())
@ -652,18 +663,18 @@ class Jfsphoto (object):
if tk.messagebox.askokcancel(title='Messurement', message=s):
panel.bcollect.invoke()
## 3000 shoud be calculated
panel.after(3000,waitfor)
print(get_duration())
panel.after(3000,waitfor(x,name,val,p))
#print(get_duration())
#time.sleep(3)
self.df['m1'] = config.rxData16
d = self.df.iloc[p]['darkline']
b = self.df.iloc[p]['baseline']
w = self.df.iloc[p]["m1"]
#print(d,b,w,d-w, np.log10(b/(d-w)))
val[3]= np.log10(b/(d-w))
val[4]= panel.SHvalue.get()
val[5]= panel.ICGvalue.get()
tree.item(x, text=name,values=val)
# self.df['m1'] = config.rxData16
# d = self.df.iloc[p]['darkline']
# b = self.df.iloc[p]['baseline']
# w = self.df.iloc[p]["m1"]
# #print(d,b,w,d-w, np.log10(b/(d-w)))
# val[3]= np.log10(b/(d-w))
# val[4]= panel.SHvalue.get()
# val[5]= panel.ICGvalue.get()
# tree.item(x, text=name,values=val)
def cb2(event):