Closedown
This commit is contained in:
+11
-9
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user