From 88aa3c91573a866ed19d22e0fa187db27f1e337d Mon Sep 17 00:00:00 2001 From: Sven Augustin Date: Thu, 7 Jul 2022 19:24:47 +0200 Subject: [PATCH] cleaned up Alvra XTG --- slic/devices/endstations/alvra_xtg.py | 28 +++++++++++++++ slic/devices/endstations/unused/alvra_xtg.py | 36 -------------------- 2 files changed, 28 insertions(+), 36 deletions(-) create mode 100644 slic/devices/endstations/alvra_xtg.py delete mode 100644 slic/devices/endstations/unused/alvra_xtg.py diff --git a/slic/devices/endstations/alvra_xtg.py b/slic/devices/endstations/alvra_xtg.py new file mode 100644 index 00000000..205b509b --- /dev/null +++ b/slic/devices/endstations/alvra_xtg.py @@ -0,0 +1,28 @@ +from slic.core.device import Device, SimpleDevice +from self.devices.general.smaract import SmarActAxis + + +class XTG(Device): + + def __init__(self, ID, name="XTG SmarAct motor positions", **kwargs): + super().__init__(ID, name=name, **kwargs) + + self.sample = SimpleDevice("Sample", + x = SmarActAxis(ID + ":TRX3"), + y = SmarActAxis(ID + ":TRY3") + ) + + self.grating1 = = SimpleDevice("Grating 1", + x = SmarActAxis(ID + ":TRX1"), + y = SmarActAxis(ID + ":TRY1"), + z = SmarActAxis(ID + ":TRZ1") + ) + + self.grating2 = = SimpleDevice("Grating 2", + x = SmarActAxis(ID + ":TRX2"), + y = SmarActAxis(ID + ":TRY2"), + z = SmarActAxis(ID + ":TRZ2") + ) + + + diff --git a/slic/devices/endstations/unused/alvra_xtg.py b/slic/devices/endstations/unused/alvra_xtg.py deleted file mode 100644 index d9da718d..00000000 --- a/slic/devices/endstations/unused/alvra_xtg.py +++ /dev/null @@ -1,36 +0,0 @@ -from ..devices_general.smaract import SmarActAxis -from epics import PV - - -class XTG: - - def __init__(self, ID, alias_namespace=None): - self.ID = ID - - ### sample smaract motors ### - self.sx = SmarActAxis(ID + ":TRX3") - self.sy = SmarActAxis(ID + ":TRY3") - - ### grating 1 motors ### - self.g1x = SmarActAxis(ID + ":TRX1") - self.g1y = SmarActAxis(ID + ":TRY1") - self.g1z = SmarActAxis(ID + ":TRZ1") - ### grating 2 motors ### - self.g2x = SmarActAxis(ID + ":TRX2") - self.g2y = SmarActAxis(ID + ":TRY2") - self.g2z = SmarActAxis(ID + ":TRZ2") - - def get_adjustable_positions_str(self): - ostr = "*****SmarAct motor positions******\n" - - for tkey, item in self.__dict__.items(): - if hasattr(item, "get_current_value"): - pos = item.get_current_value() - ostr += " " + tkey.ljust(10) + " : % 14g\n" % pos - return ostr - - def __repr__(self): - return self.get_adjustable_positions_str() - - -