From 1b1b5a32bc0d764bddf65e4b0067ce005c8b68b9 Mon Sep 17 00:00:00 2001 From: Roman Mankowsky Date: Sun, 7 Jun 2020 13:36:52 +0200 Subject: [PATCH] fixed hexapod PI to not move simultaneously in virtual stages --- eco/endstations/hexapod.py | 3 +++ eco/xoptics/offsetMirrors.py | 20 +++++++++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/eco/endstations/hexapod.py b/eco/endstations/hexapod.py index a0b27af..4402a92 100644 --- a/eco/endstations/hexapod.py +++ b/eco/endstations/hexapod.py @@ -43,6 +43,7 @@ class HexapodPI: lambda x:self._calc_xyzraw(x,self.y.get_current_value(),self.z.get_current_value()), reset_current_value_to=False, append_aliases=False, + change_simultaneously=False, name='x', ) self.y = AdjustableVirtual( @@ -50,6 +51,7 @@ class HexapodPI: lambda xraw,yraw,zraw: self._calc_xyz(xraw,yraw,zraw)[1], lambda y:self._calc_xyzraw(self.x.get_current_value(),y,self.z.get_current_value()), reset_current_value_to=False, + change_simultaneously=False, append_aliases=False, name='y', ) @@ -59,6 +61,7 @@ class HexapodPI: lambda z: self._calc_xyzraw(self.x.get_current_value(),self.y.get_current_value(),z), reset_current_value_to=False, append_aliases=False, + change_simultaneously=False, name='z', ) @property diff --git a/eco/xoptics/offsetMirrors.py b/eco/xoptics/offsetMirrors.py index 35316dd..4d63a67 100755 --- a/eco/xoptics/offsetMirrors.py +++ b/eco/xoptics/offsetMirrors.py @@ -2,9 +2,11 @@ import sys sys.path.append("..") from ..devices_general.motors import MotorRecord +from ..devices_general.adjustable import PvRecord from epics import PV -from ..aliases import Alias +from ..aliases import Alias,append_object_to_object +import datetime def addMotorRecordToSelf(self, name=None, Id=None): @@ -25,9 +27,25 @@ class OffsetMirror: addMotorRecordToSelf(self, Id=Id + ":W_Y", name="y") addMotorRecordToSelf(self, Id=Id + ":W_RX", name="rx") addMotorRecordToSelf(self, Id=Id + ":W_RZ", name="rz") + append_object_to_object(self,PvRecord,Id+":CURV_SP", pvreadbackname=Id+":CURV", accuracy=None, name="curvature", elog=None ) + append_object_to_object(self,PvRecord,Id+":ASYMMETRY_SP", pvreadbackname=Id+":ASYMMETRY", accuracy=None, name="asymmetry", elog=None) + def out(self): pass def move_in(self): pass + + def get_status(self): + s = f'Offset mirror {self.alias.get_full_name()} status ({datetime.datetime.now().strftime("%Y/%m/%d %H:%M:%S")})\n' + for var in ['x','y','rx', 'rz', 'curvature', 'asymmetry']: + s+=(' '*4+var.ljust(16)+f'{self.__dict__[var].get_current_value():g}\n') + return s + + def __str__(self): + return self.get_status() + + def __repr__(self): + return self.__str__() +