mitendrin
This commit is contained in:
parent
5d073d5ad5
commit
d813dfe958
@ -45,6 +45,9 @@ import time
|
|||||||
# byte[11]: Continuous flag: 0 equals one acquisition, 1 equals continuous mode
|
# byte[11]: Continuous flag: 0 equals one acquisition, 1 equals continuous mode
|
||||||
# byte[12]: The number of integrations to average
|
# byte[12]: The number of integrations to average
|
||||||
def rxtx(panel, SerQueue, progress_var):
|
def rxtx(panel, SerQueue, progress_var):
|
||||||
|
|
||||||
|
config.still_working = True
|
||||||
|
print('start rxtx',config.still_working)
|
||||||
if (config.AVGn[0] == 0):
|
if (config.AVGn[0] == 0):
|
||||||
threadser = threading.Thread(target=rxtxoncethread, args=(panel, SerQueue, progress_var), daemon=True)
|
threadser = threading.Thread(target=rxtxoncethread, args=(panel, SerQueue, progress_var), daemon=True)
|
||||||
elif (config.AVGn[0] == 1):
|
elif (config.AVGn[0] == 1):
|
||||||
@ -108,6 +111,8 @@ def rxtxoncethread(panel, SerQueue, progress_var):
|
|||||||
config.rxData16[rxi] = (config.rxData8[2*rxi+1] << 8) + config.rxData8[2*rxi]
|
config.rxData16[rxi] = (config.rxData8[2*rxi+1] << 8) + config.rxData8[2*rxi]
|
||||||
|
|
||||||
#plot the new data
|
#plot the new data
|
||||||
|
config.still_working=False
|
||||||
|
print('before bupdate.invoke',config.still_working)
|
||||||
panel.bupdate.invoke()
|
panel.bupdate.invoke()
|
||||||
#hold values for saving data to file as the SHperiod and ICGperiod may be updated after acquisition
|
#hold values for saving data to file as the SHperiod and ICGperiod may be updated after acquisition
|
||||||
config.SHsent = config.SHperiod
|
config.SHsent = config.SHperiod
|
||||||
|
|||||||
52
JFSphoto.py
52
JFSphoto.py
@ -609,6 +609,8 @@ class Jfsphoto (object):
|
|||||||
|
|
||||||
def do_methods(self,panel):
|
def do_methods(self,panel):
|
||||||
|
|
||||||
|
self.nofin = True
|
||||||
|
|
||||||
def get_duration():
|
def get_duration():
|
||||||
if panel.tint.get().split()[4]=='ms':
|
if panel.tint.get().split()[4]=='ms':
|
||||||
f = float(panel.tint.get().split()[3])
|
f = float(panel.tint.get().split()[3])
|
||||||
@ -629,17 +631,21 @@ class Jfsphoto (object):
|
|||||||
'size': 8,
|
'size': 8,
|
||||||
}
|
}
|
||||||
|
|
||||||
def waitfor(x,name,val,p):
|
|
||||||
|
|
||||||
|
def waitfor():
|
||||||
|
print('wait',config.still_working)
|
||||||
|
self.nofin = config.still_working
|
||||||
#panel.bcollect.invoke()
|
#panel.bcollect.invoke()
|
||||||
print('Working')
|
# print('Working')
|
||||||
self.df['m1'] = config.rxData16
|
# self.df['m1'] = config.rxData16
|
||||||
d = self.df.iloc[p]['darkline']
|
# d = self.df.iloc[p]['darkline']
|
||||||
b = self.df.iloc[p]['baseline']
|
# b = self.df.iloc[p]['baseline']
|
||||||
w = self.df.iloc[p]["m1"]
|
# w = self.df.iloc[p]["m1"]
|
||||||
val[3]= np.log10(b/(d-w))
|
# val[3]= np.log10(b/(d-w))
|
||||||
val[4]= panel.SHvalue.get()
|
# val[4]= panel.SHvalue.get()
|
||||||
val[5]= panel.ICGvalue.get()
|
# val[5]= panel.ICGvalue.get()
|
||||||
tree.item(x, text=name,values=val)
|
# tree.item(x, text=name,values=val)
|
||||||
|
|
||||||
|
|
||||||
def cb1(event):
|
def cb1(event):
|
||||||
@ -648,6 +654,7 @@ class Jfsphoto (object):
|
|||||||
print(f' time {panel.tint.get()} {get_duration()} ms ')
|
print(f' time {panel.tint.get()} {get_duration()} ms ')
|
||||||
|
|
||||||
def cb(event):
|
def cb(event):
|
||||||
|
|
||||||
#if self.check_requirement() == True:
|
#if self.check_requirement() == True:
|
||||||
# get selected and save values
|
# get selected and save values
|
||||||
name = tree.selection()[0]
|
name = tree.selection()[0]
|
||||||
@ -663,18 +670,23 @@ class Jfsphoto (object):
|
|||||||
if tk.messagebox.askokcancel(title='Messurement', message=s):
|
if tk.messagebox.askokcancel(title='Messurement', message=s):
|
||||||
panel.bcollect.invoke()
|
panel.bcollect.invoke()
|
||||||
## 3000 shoud be calculated
|
## 3000 shoud be calculated
|
||||||
panel.after(3000,waitfor(x,name,val,p))
|
#panel.after(3000,waitfor(x,name,val,p))
|
||||||
#print(get_duration())
|
#print(get_duration())
|
||||||
#time.sleep(3)
|
#time.sleep(3)
|
||||||
# self.df['m1'] = config.rxData16
|
#while config.still_working==True :
|
||||||
# d = self.df.iloc[p]['darkline']
|
while self.nofin == True:
|
||||||
# b = self.df.iloc[p]['baseline']
|
tree.after(1000,waitfor)
|
||||||
# w = self.df.iloc[p]["m1"]
|
|
||||||
# #print(d,b,w,d-w, np.log10(b/(d-w)))
|
print('get rxData16')
|
||||||
# val[3]= np.log10(b/(d-w))
|
self.df['m1'] = config.rxData16
|
||||||
# val[4]= panel.SHvalue.get()
|
d = self.df.iloc[p]['darkline']
|
||||||
# val[5]= panel.ICGvalue.get()
|
b = self.df.iloc[p]['baseline']
|
||||||
# tree.item(x, text=name,values=val)
|
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):
|
def cb2(event):
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user