Methods 90% problems with aktual messurement and darkline
This commit is contained in:
parent
71b6e24aeb
commit
7eaf5c1a3f
44
JFSphoto.py
44
JFSphoto.py
@ -564,17 +564,47 @@ class Jfsphoto (object):
|
|||||||
self.ax1.plot(t, s, linewidth=0.6)
|
self.ax1.plot(t, s, linewidth=0.6)
|
||||||
self.canvas.draw()
|
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 do_methods(self,panel):
|
||||||
|
|
||||||
def cb(event):
|
def cb(event):
|
||||||
x = tree.selection()[0].split(' ')
|
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 = tree.item(x[0])["values"][1]
|
||||||
## nm -> point
|
## nm -> point
|
||||||
p = (nm - self.nm_left)*(1/self.nm_step)
|
p = int((nm - self.nm_left)*(1/self.nm_step))
|
||||||
print(f'nm {nm} point {p}')
|
#print(f'nm {nm} point {p}')
|
||||||
|
s1 = str(val[2])+' '+tree.item(x[0])["values"][2]
|
||||||
#panel.bcollect.invoke()
|
s = 'Is a Cuvet for '+x[0]+' in concentration\n of '+s1+' in the photometer ? '
|
||||||
#self.df['m1']=config.rxData16
|
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()
|
stp = e6.get()/e5.get()
|
||||||
for i in range(1,e5.get()+1):
|
for i in range(1,e5.get()+1):
|
||||||
na = e1.get()+' '+str(i)
|
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"])
|
s= ",".join(str(x) for x in tree.item(e1.get())["values"])
|
||||||
for items in tree.get_children(e1.get()):
|
for items in tree.get_children(e1.get()):
|
||||||
ss = ",".join(str(x) for x in tree.item(items)["values"] if len(str(x))>0)
|
ss = ",".join(str(x) for x in tree.item(items)["values"] if len(str(x))>0)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user