diff --git a/script/device/Auto.py b/script/device/Auto.py index 01da827..d86353c 100644 --- a/script/device/Auto.py +++ b/script/device/Auto.py @@ -62,6 +62,9 @@ def auto_init(): global AUTO_THRESH1_COUNT, AUTO_THRESH2_COUNT global AUTO_THRESH3_COUNT, AUTO_THRESH4_COUNT + AUTO_LEVEL = 0; AUTO_RETRY_MAX = 20 + AUTO_COUNT_TIME = 0 + AUTO_EXP_LO = 1; AUTO_EXP_HI = 10 # for safety, set the thresh values gigantically high to start with AUTO_THRESH1=1e8; AUTO_THRESH2=1e9; AUTO_THRESH3=1e10; AUTO_THRESH4=1e11 @@ -116,7 +119,7 @@ def auto_show(): show the auto-level settings. inform the user on the currently active auto-level """ - + global AUTO_LEVEL if (AUTO_LEVEL == 0): print("auto-level has been set to %d.\n" % AUTO_LEVEL) print("Automatic filter setting is OFF.\n") @@ -147,6 +150,7 @@ def auto_show_exposure(): """ show the auto-level exposure settings. """ + global AUTO_EXP_LO, AUTO_EXP_HI print("detector exposure times: short = %d s, long = %d s\n" % (AUTO_EXP_LO,AUTO_EXP_HI)) @@ -161,8 +165,8 @@ def auto_calc_exposure(): COUNT_TIME = AUTO_EXP_HI return COUNT_TIME -def autoAdjust(): - # autoAdjust() - automatically adjusts the filter transmission and +def auto_adjust(): + # - automatically adjusts the filter transmission and # exposure time of the currently active detector to obtain # the best possible signal level. # The function returns 1 if transmission or exposure @@ -285,7 +289,7 @@ def auto_adjust_redo(): # Note: This macro makes use of the 'recount' macro which has been added to # site.mac. - global AUTO_LEVEL, AUTO_RETRY_MAX, AUTO_COUNT_TIME + global AUTO_LEVEL, AUTO_RETRY_MAX _success = 1 if (AUTO_LEVEL < 1): return(_success) @@ -294,7 +298,7 @@ def auto_adjust_redo(): while (redo != 0): redo = 0 retryCount = retryCount+1 - if (autoAdjust() != 0): + if (auto_adjust() != 0): if (retryCount < AUTO_RETRY_MAX): redo = 1 else: