SH ICG now saved as well

This commit is contained in:
jfsScience 2020-12-23 12:06:08 +01:00
parent dca1d386ed
commit eaa336ab6f
2 changed files with 37 additions and 14 deletions

View File

@ -31,6 +31,8 @@ class Messurement(object):
self.name = name +' '+str(split[0])
self.conc = float(split[1])
self.absorbanz = float(split[2])
self.SH = int(split[3])
self.ICG = int(split[4])
class Methods(object) :
@ -59,7 +61,7 @@ class Methods(object) :
def save(self):
s = self.id+','+self.nm+','+self.units+','+self.absorbanz+','+self.step+','+self.final
for p in self.messures:
s = s+'|'+str(p.id)+','+str(p.conc)+','+str(p.absorbanz)
s = s+'|'+str(p.id)+','+str(p.conc)+','+str(p.absorbanz)+','+str(p.SH)+','+str(p.ICG)
return s
def update(self,data):
@ -586,6 +588,19 @@ class Jfsphoto (object):
def do_methods(self,panel):
def get_duration():
if panel.tint.get().split()[4]=='ms':
f = float(panel.tint.get().split()[3])
elif panel.tint.get().split()[4] == 's':
f = float(panel.tint.get().split()[3])*1000
elif panel.tint.get().split()[4] == 'min':
f = float(panel.tint.get().split()[3]) * 60000
x = int(panel.AVGscale.get())*f
if x < 1000:
x = 1000
return x
font = {'family': 'serif',
'color': 'darkred',
'weight': 'normal',
@ -595,8 +610,13 @@ class Jfsphoto (object):
def waitfor():
pass
def cb1(event):
print(panel.SHvalue.get(), panel.ICGvalue.get())
print(f' time {panel.tint.get()} {get_duration()} ms ')
def cb(event):
if self.check_requirement() == True:
#if self.check_requirement() == True:
# get selected and save values
name = tree.selection()[0]
val= tree.item(name)["values"]
@ -609,15 +629,17 @@ class Jfsphoto (object):
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()
#panel.bcollect.invoke()
## 3000 shoud be calculated
panel.after(3000,waitfor)
panel.after(get_duration(),waitfor)
self.df['m1'] = config.rxData16
d = self.df.iloc[p]['darkline']
b = self.df.iloc[p]['baseline']
w = self.df.iloc[p]["m1"]
#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[3]= np.log10(b/(d-w))
val[4]= panel.SHvalue.get()
val[5]= panel.ICGvalue.get()
tree.item(x, text=name,values=val)
@ -662,8 +684,8 @@ class Jfsphoto (object):
tree.heading("nm",text='[nm]',anchor=tk.W)
tree.heading("konz",text='conc',anchor=tk.W)
tree.heading("absorbanz",text="Absorbanz",anchor=tk.W)
tree.heading("interval",text='intervall',anchor=tk.W)
tree.heading("last",text='last conc',anchor=tk.W)
tree.heading("interval",text='interval/SH',anchor=tk.W)
tree.heading("last",text='last conc/ICG',anchor=tk.W)
einheiten = ['Mol','mmol','mymol']
@ -681,7 +703,7 @@ class Jfsphoto (object):
for a in self.methods:
tree.insert("",'end',a.name,text=a.name,values=(a.id,a.nm,a.units,a.absorbanz,a.step,a.final),tags=('cb2'))
for b in a.messures:
tree.insert(a.name,'end',b.name,text=b.name,values=(b.id,'',b.conc,b.absorbanz),tags=('cb'))
tree.insert(a.name,'end',b.name,text=b.name,values=(b.id,'',b.conc,b.absorbanz,b.SH,b.ICG),tags=('cb'))
def save_tree():
for child in tree.get_children():
@ -700,7 +722,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),tags=('cb'))
tree.insert(e1.get(),'end',na,text= na ,values=(i,'',stp * (i),0.0,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)

View File

@ -4,6 +4,7 @@ nm_right = 811.0
nm_step = 0.13279
[methods]
crystal = 1,576,mymol,0.0,5,15|1,3.0,0.22895393029132272|2,6.0,0.48872693662130523|3,9.0,0.7151233139883822|4,12.0,0.8900731939852544|5,15.0,1.1073861897687294
crystalx = 0,576,mymol,0.0,5,15|1,3.0,0.23572229297382125|2,6.0,0.49418983232280744|3,9.0,0.6972117246796802|4,12.0,0.8832872046419623|5,15.0,1.0800630625574945
crystal = 1,576,mymol,0.0,5,15|1,3.0,0.22895393029132272,80,10000|2,6.0,0.4887269366213052,80,10000|3,9.0,0.7151233139883822,80,10000|4,12.0,0.8900731939852544,80,10000|5,15.0,1.1073861897687294,80,10000
crystalx = 0,576,mymol,0.0,5,15|1,3.0,0.23572229297382125,80,10000|2,6.0,0.49418983232280744,80,10000|3,9.0,0.6972117246796802,80,10000|4,12.0,0.8832872046419623,80,1000|5,15.0,1.0800630625574945,80,10000
test = 0,405,mmol,0.0,5,30|1,6.0,0.0,200,100000|2,12.0,0.0,200,100000|3,18.0,0.0,0,0|4,24.0,0.0,0,0|5,30.0,0.0,0,0