This commit is contained in:
gac-x04sa
2018-10-18 18:43:55 +02:00
parent 87a4670c03
commit bca1f6987e
2 changed files with 31 additions and 14 deletions

View File

@@ -18,8 +18,13 @@ class MyInterlock1 (Interlock):
def open_shutter():
"""
"""
shutter.write("On")
time.sleep(0.1)
def close_shutter():
"""
"""
shutter.write("Off")

View File

@@ -1,3 +1,5 @@
COUNT_ID = 0
def count (count_time):
waitmove
count_em (count_time) # triggers the counting process
@@ -14,7 +16,6 @@ def count (count_time):
def count_em (count_time):
# ========
while (mythen.is_acquiring()):
mythen.stop()
time.sleep(0.25)
@@ -33,6 +34,21 @@ def count_em (count_time):
def user_precount():
open_shutter()
autoCalcExposure()
global PIX_IS_ON
if ((PIX_IS_ON) && (pixconnected())):
pixsetexpose(count_time)
pixgetfilefmt()
pixsnap()
def user_postcount():
pass
# define new count_end, chk_counts, and chk_xray macros:
def count_end 'user_count_end'
def chk_counts 'user_chk_counts'
@@ -118,25 +134,21 @@ def waitcount(count_time):
# get_counts - lowest level counter reading macro.
#-
def get_counts():
# ==========
def get_counts(count_time):
global COUNT_ID
S[0] = mythen.get_acquire_time(readback=False)
S[1] = mythen.get_total_counts()
# S[2] is detector counts from image.mac
S[3] = S[2] / COUNT_TIME / epics_get("X04SA-ES2-FI:TRANSM")
S[5] = epics_get ("X04SA-ES2-FI:TRANSM")
# S[2] is detector counts from image.mac ###TOFO
S[3] = S[2] / count_time / transm.getValue()
S[5] = transm.getValue()
COUNT_ID++ # increment the exposure ID
COUNT_ID = COUNT_ID+1 # increment the exposure ID
# set threshold counts in case auto-level support is available
if ((whatis("AUTO_THRESH1") & 0x08000000) == 0) {
if "AUTO_THRESH1" in globals():
AUTO_THRESH1_COUNT = (S[2]>=AUTO_THRESH1)?S[2]:0
AUTO_THRESH2_COUNT = (S[2]>=AUTO_THRESH2)?S[2]:0
AUTO_THRESH3_COUNT = (S[2]>=AUTO_THRESH3)?S[2]:0
AUTO_THRESH4_COUNT = (S[2]>=AUTO_THRESH4)?S[2]:0
}
AUTO_THRESH4_COUNT = (S[2]>=AUTO_THRESH4)?S[2]:0
user_getcounts
}'