Skip to content
Snippets Groups Projects
pydeviceCRL.cmd 1.72 KiB
Newer Older
mwyman's avatar
mwyman committed
################################################################################
# PyDevice Support for Transfocator
################################################################################

mwyman's avatar
mwyman committed
# Setting some variables beamline-dependent PVs
epicsEnvSet('_SLITH',"")	# Horizontal size of slit PV before CRL
epicsEnvSet('_SLITV',"")	# Vertical size of slit PV before CRL
epicsEnvSet("BLE","")	# Beam energy PV at CRL
mwyman's avatar
mwyman committed

mwyman's avatar
mwyman committed
# Next two lines set up some testing tools for energy -- can be commented out 
epicsEnvSet("MONOE","testMonoE")
dbLoadRecords("${TOP}/db/energyTestTools.db","P=$(PREFIX), MONOE=$(MONOE), IDENERGY=testIDE")

mwyman's avatar
mwyman committed
# CRL DBs and defining substitution file to get stack properties
mwyman's avatar
mwyman committed
dbLoadTemplate("substitutions/pyDeviceTfor.substitutions","P=$(PREFIX)")
mwyman's avatar
mwyman committed
pydev("stack_subFile = 'substitutions/pyDeviceTfor.substitutions'")
mwyman's avatar
mwyman committed
# Import Transfocator class
mwyman's avatar
mwyman committed
pydev("from pyTransfocator_single import singleTF")

mwyman's avatar
mwyman committed
# Create Transfocator object
pydev("CRL1 = singleTF(crl_setup = 'crl_setup.toml')")
mwyman's avatar
mwyman committed

mwyman's avatar
mwyman committed
# DB for Transfocator system
dbLoadRecords(""${TOP}/db/pyDevCRLsingle.db","P=$(PREFIX), N=1, OBJ=CRL1, KEV=$(BLE), SLITH = $(_SLITH), SLITV = $(_SLITV)")
mwyman's avatar
mwyman committed

# After iocInit, need to setup focal size lookup table
mwyman's avatar
mwyman committed
# 	stack_subFile - string holding name/rel. location of substitutions file loaded
mwyman's avatar
mwyman committed
#                     loaded in  dbLoadTemplate
mwyman's avatar
mwyman committed
#   $(_STACKS)  - number of stacks of lenses
# 	energy		- beam energy in keV used for the initial lookup table setup -- can be updated
mwyman's avatar
mwyman committed
#          after startup
mwyman's avatar
mwyman committed
doAfterIocInit() # PROC energy read and update CRL1 object
doAfterIocInit() # PROC slit size read and update CRL1 object
mwyman's avatar
mwyman committed
# TODO get STACKS from TOML file?
doAfterIocInit("pydev('CRL1.setupLookupTable(stack_subFile, $(_STACKS)')") #TODO get energy from beamline...