Methods 90% problems with aktual messurement and darkline

This commit is contained in:
jens 2020-12-20 17:20:18 +01:00
parent 71b6e24aeb
commit 7eaf5c1a3f

View File

@ -564,18 +564,48 @@ class Jfsphoto (object):
self.ax1.plot(t, s, linewidth=0.6)
self.canvas.draw()
def check_requirement(self):
ok = True
if self.nm_checked.get() == 0:
ok = False
tk.messagebox.showerror('[nm]','You need to check calibration [nm]\n or first calibrate the instrument')
else:
s=''
s1=''
if (self.darkline_checked.get()==0):
s = ' Please take a darkline messurement first \n'
if (self.baseline_checked.get()==0):
s1 = ' Please take a baseline messurement first \n'
if (len(s1)>0 or len(s)>0):
ok = False
tk.messagebox.showerror('ToDos',s+s1)
return ok
def do_methods(self,panel):
def cb(event):
x = tree.selection()[0].split(' ')
nm = tree.item(x[0])["values"][1]
## nm -> point
p = (nm - self.nm_left)*(1/self.nm_step)
print(f'nm {nm} point {p}')
#panel.bcollect.invoke()
#self.df['m1']=config.rxData16
if self.check_requirement() == True:
# get selected and save values
name = tree.selection()[0]
val= tree.item(name)["values"]
# get parent for nm
x = name.split(' ')
nm = tree.item(x[0])["values"][1]
## nm -> point
p = int((nm - self.nm_left)*(1/self.nm_step))
#print(f'nm {nm} point {p}')
s1 = str(val[2])+' '+tree.item(x[0])["values"][2]
s = 'Is a Cuvet for '+x[0]+' in concentration\n of '+s1+' in the photometer ? '
if tk.messagebox.askokcancel(title='Messurement', message=s):
panel.bcollect.invoke()
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))
tree.item(x, text=name,values=val)
@ -640,7 +670,7 @@ class Jfsphoto (object):
stp = e6.get()/e5.get()
for i in range(1,e5.get()+1):
na = e1.get()+' '+str(i)
tree.insert(e1.get(),'end',na,text= na ,values=(i,'',stp * (i),0.0))
tree.insert(e1.get(),'end',na,text= na ,values=(i,'',stp * (i),0.0),tags=('cb'))
s= ",".join(str(x) for x in tree.item(e1.get())["values"])
for items in tree.get_children(e1.get()):
ss = ",".join(str(x) for x in tree.item(items)["values"] if len(str(x))>0)