diff --git a/100idPyApp/Db/pyDevCRLsingle.db b/100idPyApp/Db/pyDevCRLsingle.db index 6a37ec30422e4a9f1446e15bf0c740d67262b80b..2be2418a4895044a84320e86faa14d382a9b1eb9 100644 --- a/100idPyApp/Db/pyDevCRLsingle.db +++ b/100idPyApp/Db/pyDevCRLsingle.db @@ -4,6 +4,7 @@ record(ao, "$(P)CRL$(N):energy"){ field(OMSL, "closed_loop") field(DTYP, "pydev") field(OUT, "@$(OBJ).updateE('VAL')") + field(FLNK, "$(P)CRL$(N):recalc_table.PROC CA") } record(ai, "$(P)CRL$(N):energy_RBV"){ @@ -110,8 +111,8 @@ record(transform, "$(P)CRL$(N):lens_decode"){ field(CLCI, "(A >> 7) % 2") field(CLCJ, "(A >> 8) % 2") field(CLCK, "(A >> 9) % 2") - field(CLCL, "(A >> 10) % 2") - field(CLCM, "(A >> 11) % 2") +# field(CLCL, "(A >> 10) % 2") +# field(CLCM, "(A >> 11) % 2") } record(calcout, "$(P)CRL$(N):lens_encode"){ diff --git a/100idPyApp/python/pyTransfocator_single.py b/100idPyApp/python/pyTransfocator_single.py index ecf0388df0ee03345899afb2262d8dec251bdf66..2faa46e6799a263f8c726c872cf56f120126e2e8 100644 --- a/100idPyApp/python/pyTransfocator_single.py +++ b/100idPyApp/python/pyTransfocator_single.py @@ -171,17 +171,17 @@ class singleTF(): ''' pass - def setupLookupTable(self, subs_file, n_lenses, energy = 8.0): + def setupLookupTable(self, subs_file, n_lenses): ''' - lookup table created after IOC startup (after transfocator materials and - thicknesses are set + lookup table created after IOC startup + energy and slit size are updated before this is called ''' print(80*'#') print('Setting up lens control...') self.num_stacks = n_lenses - self.energy = energy +# self.energy = energy #read in substitutions file try: @@ -270,6 +270,8 @@ class singleTF(): self.crl, self.slit1_H, self.slit1_V, self.lens_thickerr, flag_HE = self.thickerr_flag) self.cull_lookup_table() + self.updateEnergyRBV() + self.updateSlitSizeRBV() def cull_lookup_table(self): ''' @@ -393,7 +395,7 @@ class singleTF(): self.setSlitSize(self, size, slit) # Testing calling the lookup table reconstruction in EPICS instead of python - # self.construct_lookup_table() + #! self.construct_lookup_table() def setEnergy(self, energy): ''' @@ -411,7 +413,9 @@ class singleTF(): # Energy variable sent from IOC as a string self.setEnergy(energy) - self.construct_lookup_table() + # Testing calling the lookup table reconstruction in EPICS instead of python + #! self.construct_lookup_table() + # Do I need to find what the current config would produce as far as focal size and location? # self.focalSizeRBV = diff --git a/100idPyFilter_startup_env b/iocBoot/ioc100idPy/100idPyFilter_startup_env similarity index 100% rename from 100idPyFilter_startup_env rename to iocBoot/ioc100idPy/100idPyFilter_startup_env diff --git a/iocBoot/ioc100idPy/softioc/100idPy.pl b/iocBoot/ioc100idPy/softioc/100idPy.pl index a300761f6a45eff787f1b5483b691fd26191716f..57ad657733fc93daad83bdc9299a25fd03eb6e25 100644 --- a/iocBoot/ioc100idPy/softioc/100idPy.pl +++ b/iocBoot/ioc100idPy/softioc/100idPy.pl @@ -86,7 +86,7 @@ BEGIN ########################## #If PyDevice is to be used, source script needs to be set here - $ENV{PYDEV_STARTUP}="/net/s100dserv/xorApps/epics/synApps_6_3/ioc/100idPy/100idPyFilter_startup_env"; + $ENV{PYDEV_STARTUP}="$ENV{IOC_STARTUP_DIR}/100idPyFilter_startup_env"; $ENV{PYDEV_IOC_CMD}="source $ENV{PYDEV_STARTUP}; $ENV{IOC_CMD}"; } diff --git a/100idPyCRL_startup_env b/iocBoot/ioc100idPyCRL/100idPyCRL_startup_env similarity index 100% rename from 100idPyCRL_startup_env rename to iocBoot/ioc100idPyCRL/100idPyCRL_startup_env diff --git a/iocBoot/ioc100idPyCRL/cmds/pydeviceCRL.cmd b/iocBoot/ioc100idPyCRL/cmds/pydeviceCRL.cmd index 5b7f83782571230482e377f71a67b948af1d5976..93554f4346bd44e1fd076909b6cf08d0c6579695 100644 --- a/iocBoot/ioc100idPyCRL/cmds/pydeviceCRL.cmd +++ b/iocBoot/ioc100idPyCRL/cmds/pydeviceCRL.cmd @@ -32,4 +32,4 @@ dbLoadRecords(""${TOP}/db/pyDevCRLsingle.db","P=$(PREFIX), N=1, OBJ=CRL1, KEV=$( doAfterIocInit() # PROC energy read and update CRL1 object doAfterIocInit() # PROC slit size read and update CRL1 object # TODO get STACKS from TOML file? -doAfterIocInit("pydev('CRL1.setupLookupTable(stack_subFile, $(_STACKS), energy = $(_ENERGY))')") #TODO get energy from beamline... +doAfterIocInit("pydev('CRL1.setupLookupTable(stack_subFile, $(_STACKS)')") #TODO get energy from beamline... diff --git a/iocBoot/ioc100idPyCRL/softioc/100idPyCRL.pl b/iocBoot/ioc100idPyCRL/softioc/100idPyCRL.pl index e4f95aad04936cc975e6e6bfb0195ee2b6d79f6f..0d5047142ebb60f8b91f6bffa51afb516fb381bd 100644 --- a/iocBoot/ioc100idPyCRL/softioc/100idPyCRL.pl +++ b/iocBoot/ioc100idPyCRL/softioc/100idPyCRL.pl @@ -87,7 +87,7 @@ BEGIN ########################## #If PyDevice is to be used, source script needs to be set here - $ENV{PYDEV_STARTUP}="/net/s100dserv/xorApps/epics/synApps_6_3/ioc/100idPy/100idPyCRL_startup_env"; + $ENV{PYDEV_STARTUP}="$ENV{IOC_STARTUP_DIR}/100idPyCRL_startup_env"; $ENV{PYDEV_IOC_CMD}="source $ENV{PYDEV_STARTUP}; $ENV{IOC_CMD}"; } diff --git a/iocBoot/ioc100idPyFilter/100idPyFilter_startup_env b/iocBoot/ioc100idPyFilter/100idPyFilter_startup_env new file mode 100644 index 0000000000000000000000000000000000000000..897131869195b03b84b15c082283811723cacc62 --- /dev/null +++ b/iocBoot/ioc100idPyFilter/100idPyFilter_startup_env @@ -0,0 +1,6 @@ +# Activate python environment containing modules used by IOC +eval "$(conda shell.bash hook)" +conda activate /net/s100dserv/xorApps/epics/synApps_6_3/support/PyDevice-env/filters + +# Put python library in path +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/net/s100dserv/xorApps/epics/synApps_6_3/support/PyDevice-env/filters/lib/ diff --git a/iocBoot/ioc100idPyFilter/softioc/100idPyFilter.pl b/iocBoot/ioc100idPyFilter/softioc/100idPyFilter.pl index b6da90875564f6dafec540645758d906fc4b6c9a..625a12fdcc01d08d7a4bf9ae52c52ff7eb7aae21 100755 --- a/iocBoot/ioc100idPyFilter/softioc/100idPyFilter.pl +++ b/iocBoot/ioc100idPyFilter/softioc/100idPyFilter.pl @@ -84,7 +84,7 @@ BEGIN ########################## #If PyDevice is to be used, source script needs to be set here - $ENV{PYDEV_STARTUP}="/net/s100dserv/xorApps/epics/synApps_6_3/ioc/100idPy/100idPyFilter_startup_env"; + $ENV{PYDEV_STARTUP}="$ENV{IOC_STARTUP_DIR}/100idPyFilter_startup_env"; $ENV{PYDEV_IOC_CMD}="source $ENV{PYDEV_STARTUP}; $ENV{IOC_CMD}"; } diff --git a/100idPySBL_startup_env b/iocBoot/ioc100idPySBL/100idPySBL_startup_env similarity index 100% rename from 100idPySBL_startup_env rename to iocBoot/ioc100idPySBL/100idPySBL_startup_env diff --git a/iocBoot/ioc100idPySBL/softioc/100idPySBL.pl b/iocBoot/ioc100idPySBL/softioc/100idPySBL.pl index 7a1e4a3f883d109e030f77baeec895477487a9d9..93090de156cb11c28782d71885628f06526bd37c 100755 --- a/iocBoot/ioc100idPySBL/softioc/100idPySBL.pl +++ b/iocBoot/ioc100idPySBL/softioc/100idPySBL.pl @@ -86,7 +86,7 @@ BEGIN ########################## #If PyDevice is to be used, source script needs to be set here - $ENV{PYDEV_STARTUP}="/net/s100dserv/xorApps/epics/synApps_6_3/ioc/100idPy/100idPySBL_startup_env"; + $ENV{PYDEV_STARTUP}="$ENV{IOC_STARTUP_DIR}/100idPySBL_startup_env"; $ENV{PYDEV_IOC_CMD}="source $ENV{PYDEV_STARTUP}; $ENV{IOC_CMD}"; }