diff --git a/csaxs_bec/bec_ipython_client/plugins/LamNI/lamni_optics_mixin.py b/csaxs_bec/bec_ipython_client/plugins/LamNI/lamni_optics_mixin.py index fb097d43..0cafb36d 100644 --- a/csaxs_bec/bec_ipython_client/plugins/LamNI/lamni_optics_mixin.py +++ b/csaxs_bec/bec_ipython_client/plugins/LamNI/lamni_optics_mixin.py @@ -272,42 +272,39 @@ class LamNIOpticsMixin: umv(dev.lsamrot, 0) #umv(dev.dttrz, 5854, dev.fttrz, 2395) - # DRAFT, disabled until the fttrz positions are known: move the flight tube - # in after the eye is out, like flomni's feye_out(). Needs the userParameters - # fttrz_in / fttrz_out on leyex (see ptycho_lamni.yaml). - # if "fttrz" not in dev: - # if not self.OMNYTools.yesno( - # "Device 'fttrz' does not exist in the current config, so it " - # "can't be moved into position. Continue anyway? WARNING: " - # "this could cause collisions when operating on the real " - # "beamline." - # ): - # print("Aborting leye_out(): fttrz not moved.") - # return - # else: - # fttrz_in = self._get_user_param_safe("leyex", "fttrz_in") - # umv(dev.fttrz, fttrz_in) + # flight tube (fttrz) and detector table (dttrz) move together + if "fttrz" not in dev or "dttrz" not in dev: + if not self.OMNYTools.yesno( + "Device 'fttrz' or 'dttrz' does not exist in the current config, " + "so the flight tube and detector table can't be moved into position. " + "Continue anyway? WARNING: this could cause collisions when " + "operating on the real beamline." + ): + print("Aborting leye_out(): fttrz/dttrz not moved.") + return + else: + fttrz_in = self._get_user_param_safe("leyex", "fttrz_in") + dttrz_in = self._get_user_param_safe("leyex", "dttrz_in") + umv(dev.fttrz, fttrz_in, dev.dttrz, dttrz_in) def leye_in(self): bec.queue.next_dataset_number += 1 umv(dev.lsamrot, 0) - #umv(dev.dttrz, 6419.677, dev.fttrz, 2959.979) - # DRAFT, disabled until the fttrz positions are known: move the flight tube - # out before the eye goes in, like flomni's feye_in(). When enabled, this - # replaces the manual "Did the flight tube move out?" prompt below. - # if "fttrz" not in dev: - # if not self.OMNYTools.yesno( - # "Device 'fttrz' does not exist in the current config, so it " - # "can't be moved out of the way. Continue anyway? WARNING: " - # "this could cause collisions when operating on the real " - # "beamline." - # ): - # print("Aborting leye_in(): fttrz not moved.") - # return - # else: - # fttrz_out = self._get_user_param_safe("leyex", "fttrz_out") - # umv(dev.fttrz, fttrz_out) + # flight tube (fttrz) and detector table (dttrz) move together + if "fttrz" not in dev or "dttrz" not in dev: + if not self.OMNYTools.yesno( + "Device 'fttrz' or 'dttrz' does not exist in the current config, " + "so the flight tube and detector table can't be moved out of the way. " + "Continue anyway? WARNING: this could cause collisions when " + "operating on the real beamline." + ): + print("Aborting leye_in(): fttrz/dttrz not moved.") + return + else: + fttrz_out = self._get_user_param_safe("leyex", "fttrz_out") + dttrz_out = self._get_user_param_safe("leyex", "dttrz_out") + umv(dev.fttrz, fttrz_out, dev.dttrz, dttrz_out) if not self.OMNYTools.yesno("Did the flight tube move out?", "y"): return diff --git a/csaxs_bec/device_configs/ptycho_lamni.yaml b/csaxs_bec/device_configs/ptycho_lamni.yaml index 7f097f2b..ab489b82 100644 --- a/csaxs_bec/device_configs/ptycho_lamni.yaml +++ b/csaxs_bec/device_configs/ptycho_lamni.yaml @@ -20,10 +20,12 @@ leyex: connectionTimeout: 20 userParameter: in: 13.18 - # flight tube positions used by leye_out()/leye_in() (draft, still commented there); - # fill in and uncomment once the fttrz positions are known - # fttrz_in: - # fttrz_out: + # flight tube / detector table positions used by leye_out() (*_in) and + # leye_in() (*_out) + fttrz_in: 1995 + fttrz_out: 2000 + dttrz_in: 13258 + dttrz_out: 13263 deviceTags: - ptycho_lamni leyey: