Closedown

This commit is contained in:
gac-x04sa
2019-03-07 16:55:39 +01:00
parent 91e2ab20b1
commit db77926df8
4 changed files with 22 additions and 345 deletions
+11 -9
View File
@@ -269,20 +269,19 @@ def auto_adjust():
###################################################################################################
#Callbacks
###################################################################################################
def auto_before_scan():
global AUTO_LEVEL
if (AUTO_LEVEL > 0):
transm.write(1e-10) # if automatic filter setting is active start scan with very lowfilter transmission
def auto_before_sample():
def auto_before_sample(position, scan):
global AUTO_LEVEL, RETRY_COUNT
RETRY_COUNT = 0
if scan.recordIndex==1:
if (AUTO_LEVEL > 0):
transm.write(1e-10) # if automatic filter setting is active start scan with very lowfilter transmission
RETRY_COUNT = 0
if(AUTO_LEVEL > 1):
auto_calc_exposure() # if automatic exposure setting is activated calculate exposure time
def auto_after_sample(rec, scan):
"Return True if level was ok (not invalidating the record)"
global AUTO_LEVEL, AUTO_RETRY_MAX, RETRY_COUNT
resample = False
if (AUTO_LEVEL > 0):
@@ -291,8 +290,11 @@ def auto_after_sample(rec, scan):
if (RETRY_COUNT < AUTO_RETRY_MAX):
resample = True
else:
print " >>Couldn\'t optimize filter and exposure settings. <<"
print " >>Couldn\'t optimize filter and exposure settings. <<"
if resample:
rec.invalidate()
return False
else:
RETRY_COUNT = 0
return True