fixes after first load in bec

This commit is contained in:
Holler Mirko
2024-11-05 15:06:35 +01:00
committed by wakonig_k
parent f0df487131
commit 347c63d500
4 changed files with 41 additions and 28 deletions
@@ -13,7 +13,7 @@ from typeguard import typechecked
from csaxs_bec.bec_ipython_client.plugins.cSAXS import cSAXSBeamlineChecks
from csaxs_bec.bec_ipython_client.plugins.omny.omny_optics_mixin import OMNYOpticsMixin
from csaxs_bec.bec_ipython_client.plugins.omny.omny_alignment import OMNYAlignmentMixin
from csaxs_bec.bec_ipython_client.plugins.omny.omny_alignment_mixin import OMNYAlignmentMixin
from csaxs_bec.bec_ipython_client.plugins.omny.omny_sample_transfer_mixin import OMNYSampleTransferMixin
#from csaxs_bec.bec_ipython_client.plugins.flomni.x_ray_eye_align import XrayEyeAlign
@@ -1384,5 +1384,5 @@ if __name__ == "__main__":
builtins.__dict__["dev"] = dev
builtins.__dict__["bec"] = bec
builtins.__dict__["umv"] = umv
flomni = Flomni(bec)
flomni.start_x_ray_eye_alignment()
omny = OMNY(bec)
omny.start_x_ray_eye_alignment()
@@ -1,10 +1,13 @@
import time
import numpy as np
import os
from rich import box
from rich.console import Console
from rich.table import Table
from typeguard import typechecked
class OMNYAlignmentError(Exception):
pass
@@ -75,7 +75,7 @@ class OMNYOpticsMixin:
omny_oeye_currentx = dev.oeyex.get().readback
omny_oeye_currenty = dev.oeyey.get().readback
if np.fabs(omny_oeye_currentx - omny_oeye_xray_inx)<0.1 and np.fabs(omny_oeye_currenty - omny_oeye_xray_iny)<0.1)
if np.fabs(omny_oeye_currentx - omny_oeye_xray_inx)<0.1 and np.fabs(omny_oeye_currenty - omny_oeye_xray_iny)<0.1:
return True
else:
return False
@@ -1,13 +1,23 @@
import time
import builtins
import numpy as np
from rich import box
from rich.console import Console
from rich.table import Table
from typeguard import typechecked
from csaxs_bec.bec_ipython_client.plugins.cSAXS import epics_get, epics_put, fshopen, fshclose
if builtins.__dict__.get("bec") is not None:
bec = builtins.__dict__.get("bec")
dev = builtins.__dict__.get("dev")
umv = builtins.__dict__.get("umv")
umvr = builtins.__dict__.get("umvr")
class OMNYTransferError(Exception):
pass
@@ -204,7 +214,7 @@ class OMNYSampleTransferMixin:
if not self._otransfer_is_shuttle_closed():
raise OMNYTransferError("Open lid function called, but lid is not closed, i.e. in an undefined state")
self._otransfer_gripper_to_park_z():
self._otransfer_gripper_to_park_z()
#ensure safety threads are running
dev.oshuttleopen.controller.socket_put_confirmed("XQ#SAFETY")
@@ -350,28 +360,28 @@ class OMNYSampleTransferMixin:
#coming from an OSA or FZP transfer. Ensure shield open
if dev.otransz.get().readback < -350:
#if xray eye is in, move it out
if dev.oeyez.get().readback<-5:
self.oeye_cam_in()
#if xray eye is in, move it out
if dev.oeyez.get().readback<-5:
self.oeye_cam_in()
#is executed in shield_st_open - _otransfer_gripper_up
self._oshield_ST_open()
umv(dev.otransz, 0)
#the oosa has in principle to be out because of shield open above
#if that is the case, then we do simultaneous shield and trans movement
if(A[oosaz]<0.1):
umv(dev.otransx, -350, dev.oshield, 15.5)
#if the gripper is empty, then we can already move the xeye to the xray position
#simultaneous motion to reduce time. otherwise later manual eye in
if not dev.omny_samples.is_sample_in_gripper():
#todo the oeyey mv may not be accessible
_omny_oeye_xray_inx = self._get_user_param_safe(dev.oeyex, "xray_in")
_omny_oeye_xray_iny = self._get_user_param_safe(dev.oeyey, "xray_in")
self._oeyey_mv(_omny_oeye_xray_iny)
umv(dev.otransx, -100, dev.oeyex, _omny_oeye_xray_inx, dev.oeyez, -2)
#is executed in shield_st_open - _otransfer_gripper_up
self._oshield_ST_open()
umv(dev.otransz, 0)
#the oosa has in principle to be out because of shield open above
#if that is the case, then we do simultaneous shield and trans movement
oosaz_current = dev.oosaz.get().readback
if oosaz_current<0.1:
umv(dev.otransx, -350, dev.oshield, 15.5)
#if the gripper is empty, then we can already move the xeye to the xray position
#simultaneous motion to reduce time. otherwise later manual eye in
if not dev.omny_samples.is_sample_in_gripper():
#todo the oeyey mv may not be accessible
_omny_oeye_xray_inx = self._get_user_param_safe(dev.oeyex, "xray_in")
_omny_oeye_xray_iny = self._get_user_param_safe(dev.oeyey, "xray_in")
self._oeyey_mv(_omny_oeye_xray_iny)
umv(dev.otransx, -100, dev.oeyex, _omny_oeye_xray_inx, dev.oeyez, -2)
else:
umv(dev.otransx, -100)
else:
self._oshield_ST_close()
umv(dev.otransx, -100)
@@ -594,13 +604,13 @@ class OMNYSampleTransferMixin:
#FZP
if(pin_position==100):
if pin_position==100:
self._otransfer_gripper_to_park_z()
self._otransfer_stage_to_FZP()
_otransy_approach_height=-7
#OSA
if(pin_position==101)
if pin_position==101:
raise OMNYTransferError("OSA Transfer disabled. Needs commissioning.")
# self._otransfer_gripper_to_park_z
# self._otransfer_stage_to_OSA
@@ -639,7 +649,7 @@ class OMNYSampleTransferMixin:
def otransfer_put_sample(self, pin_position:int):
self._otransfer_check_sensor_connected()
if not self._otransfer_check_free_slot_available_at_position(pin_position,0)
if not self._otransfer_check_free_slot_available_at_position(pin_position,0):
raise OMNYTransferError(f"position {position} is not free")
# global _ogalil_encoder_steps_per_mm
@@ -727,7 +737,7 @@ class OMNYSampleTransferMixin:
# exit;
#}
# rt_feedback_disable
else
else:
self._omnycam_parking()