class BEST_Yaxis(Device): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.readback.name = self.name readback = Comp(EpicsSignalLastElement, "FM}:BPM0:PosY", kind='hinted') # Make these EpicsSignal, 'PV:...' setpoint = Comp(EpicsSignal, "FM}:PID:SetpointY") tolerance = 0.1 def set(self, value): desired_value = value status = DeviceStatus(self) def are_we_there_yet(value, *args, **kwargs): if abs(value[-1] - desired_value) < self.tolerance: # This alerts the RunEngine that it can move on. status._finished() # Start us moving. self.setpoint.put(desired_value) # The function are_we_there_yet will receive # updates from pyepics as the readback changes. self.readback.subscribe(are_we_there_yet) # Hand this back the RunEngine immediately. return status
class Monochromator(Device): Focus_Const = Comp(EpicsMotor, "-Ax:8_Cff}Mtr", kind='hinted') Energy = Comp(EpicsMotor, "-Ax:8_Eng}Mtr", kind='hinted') Grating_Trans = Comp(EpicsMotor, "-Ax:8_GT}Mtr") Mirror_Pitch = Comp(EpicsMotor, "-Ax:8_MP}Mtr") Mirror_Pitch_off = Comp(EpicsSignal, "-Ax:8_MP}Mtr.OFF") Mirror_Pitch_set = Comp(EpicsSignal, "-Ax:8_MP}Mtr.SET") Grating_Pitch = Comp(EpicsMotor, "-Ax:8_GP}Mtr") Grating_Pitch_off = Comp(EpicsSignal, "-Ax:8_GP}Mtr.OFF") Grating_Pitch_set = Comp(EpicsSignal, "-Ax:8_GP}Mtr.SET") Grating_lines = Comp(EpicsSignal, "}:LINES:RBV", write_pv="}:LINES:SET", put_complete=False, kind='hinted')
class ESMSlit_type1(Device): inboard = Comp(EpicsMotor, "-Ax:I}Mtr") outboard = Comp(EpicsMotor, "-Ax:O}Mtr") bottom = Comp(EpicsMotor, "-Ax:B}Mtr") top = Comp(EpicsMotor, "-Ax:T}Mtr") h_gap = Comp(EpicsMotor, "-Ax:HG}Mtr") h_center = Comp(EpicsMotor, "-Ax:HC}Mtr") v_gap = Comp(EpicsMotor, "-Ax:VG}Mtr") v_center = Comp(EpicsMotor, "-Ax:VC}Mtr")
class ESMSlit_type2(Device): h_scan = Comp(EpicsMotor, "-Ax:HS}Mtr") h_apperture = Comp(EpicsMotor, "-Ax:HA}Mtr") v_scan = Comp(EpicsMotor, "-Ax:VS}Mtr") v_aperture = Comp(EpicsMotor, "-Ax:VA}Mtr") h_gap = Comp(EpicsMotor, "-Ax:HG}Mtr") h_center = Comp(EpicsMotor, "-Ax:HC}Mtr") v_gap = Comp(EpicsMotor, "-Ax:VG}Mtr") v_center = Comp(EpicsMotor, "-Ax:VC}Mtr")
class M1_mirror(Device): X = Comp(EpicsMotor, "Trans}Mtr") Mirror_Trans = Comp(EpicsMotor, "Trans}Mtr") Mirror_InOut = Comp(EpicsMotor, "Trans}Mtr") Ry = Comp(EpicsMotor, "Pitch}Mtr") Mirror_Pitch = Comp(EpicsMotor, "Pitch}Mtr") Rz = Comp(EpicsMotor, "Roll}Mtr") Mirror_Roll = Comp(EpicsMotor, "Roll}Mtr")
class An_mtr(Device): #Add micro-scanning stage motors here when done Claw_Trans = Comp(EpicsMotor, "{ST:1-Claw:EA1_1-Ax:T}Mtr") Claw_Grab = Comp(EpicsMotor, "{ST:1-Claw:EA1_1-Ax:C}Mtr")
class Blades(Device): #This creates a class for the independent motion of each of the front end slit "blades" outboard = Comp(EpicsMotor, "1-Ax:O}Mtr") inboard = Comp(EpicsMotor, "2-Ax:I}Mtr") top = Comp(EpicsMotor, "1-Ax:T}Mtr") bottom = Comp(EpicsMotor, "2-Ax:B}Mtr")
class SP_mtr(Device): X = Comp(EpicsMotor, "-Ax:X}Mtr") Y = Comp(EpicsMotor, "-Ax:Y}Mtr") Z = Comp(EpicsMotor, "-Ax:Z}Mtr") Rx = Comp(EpicsMotor, "-Ax:Rx}Mtr")
class Virtual_Motor_Center_And_Gap(Device): #This is used to combine the gap centre and size classes from above into a single class object h_gap = Comp(Virtual_Size, '12-Ax:X}') h_center = Comp(Virtual_Center, '12-Ax:X}') v_gap = Comp(Virtual_Size, '12-Ax:Y}') v_center = Comp(Virtual_Center, '12-Ax:Y}')
class LT_mtr(Device): X = Comp(EpicsMotor, "-Ax:X}Mtr") Y = Comp(EpicsMotor, "-Ax:Y}Mtr") Z = Comp(EpicsMotor, "-Ax:Z}Mtr") Ry = Comp(EpicsMotor, "-Ax:Ry}Mtr")
class LT_mtr(Device): X = Comp(EpicsMotor, "-Ax:X}Mtr", kind='hinted') Y = Comp(EpicsMotor, "-Ax:Y}Mtr", kind='hinted') Z = Comp(EpicsMotor, "-Ax:Z}Mtr", kind='hinted') Ry = Comp(EpicsMotor, "-Ax:Ry}Mtr", kind='hinted')
class Virtual_Center(PVPositioner): #This is used to connect to the front end gap centre PV's. readback = Comp(EpicsSignalRO, 't2.D') setpoint = Comp(EpicsSignal, 'center') done = Comp(EpicsSignalRO, 'DMOV') done_value = 1
class KB_pair(Device): VFM_Y = Comp(EpicsMotor, "Ax:A4_VFMTy}Mtr", kind='hinted') VFM_Mirror_InOut = Comp(EpicsMotor, "Ax:A4_VFMTy}Mtr") VFM_Mirror_Trans = Comp(EpicsMotor, "Ax:A4_VFMTy}Mtr") VFM_Z = Comp(EpicsMotor, "Ax:A4_VFMTz}Mtr", kind='hinted') VFM_Mirror_Astig = Comp(EpicsMotor, "Ax:A4_VFMTz}Mtr") VFM_Mirror_Horizontal = Comp(EpicsMotor, "Ax:A4_VFM_Astig}Mtr") VFM_Mirror_Incline = Comp(EpicsMotor, "Ax:A4_VFM_IO}Mtr") HFM_Z = Comp(EpicsMotor, "Ax:A4_HFM_Astig}Mtr", kind='hinted') HFM_X = Comp(EpicsMotor, "Ax:A4_HFM_IO}Mtr", kind='hinted') HFM_Mirror_Astig = Comp(EpicsMotor, "Ax:A4_HFM_Astig}Mtr") HFM_Mirror_InOut = Comp(EpicsMotor, "Ax:A4_HFM_IO}Mtr") HFM_Mirror_Trans = Comp(EpicsMotor, "Ax:A4_HFM_IO}Mtr") HFM_Au_Mesh = Comp(EpicsMotor, "Ax:A4_HGM}Mtr") VFM_Au_Mesh = Comp(EpicsMotor, "Ax:A4_VGM}Mtr") VFM_Rx = Comp(BEST_Xaxis, "", kind='hinted') VFM_Pitch = Comp(BEST_Xaxis, "") HFM_Ry = Comp(BEST_Yaxis, "", kind='hinted') HFM_Pitch = Comp(BEST_Yaxis, "")
class DIAG(Device): trans = Comp(EpicsMotor, "}Mtr")
class ESM_Diagon(Device): H_mirror = Comp(EpicsMotor, "-Ax:3_HLPM}Mtr", kind='hinted') H_Yag = Comp(EpicsMotor, "-Ax:3_HLPF}Mtr", kind='hinted') V_mirror = Comp(EpicsMotor, "-Ax:3_VLPM}Mtr", kind='hinted') V_Yag = Comp(EpicsMotor, "-Ax:3_VLPF}Mtr", kind='hinted')
class LL_mtr(Device): Claw_Trans = Comp(EpicsMotor, '2-Claw:EA3_1-Ax:T}Mtr') Claw_Rotate = Comp(EpicsMotor, '2-Claw:EA3_1-Ax:R}Mtr') Claw_Grab = Comp(EpicsMotor, '2-Claw:EA3_1-Ax:C}Mtr') Dock_Trans = Comp(EpicsMotor, '1-Dock:EA4_1-Ax:F}Mtr')
class KB_pair(Device): VFM_Y = Comp(EpicsMotor, "VFMTy}Mtr") VFM_Mirror_InOut = Comp(EpicsMotor, "VFMTy}Mtr") VFM_Mirror_Trans = Comp(EpicsMotor, "VFMTy}Mtr") VFM_Z = Comp(EpicsMotor, "VFMTz}Mtr") VFM_Mirror_Astig = Comp(EpicsMotor, "VFMTz}Mtr") VFM_Mirror_Horizontal = Comp(EpicsMotor, "VFM_Astig}Mtr") VFM_Mirror_Incline = Comp(EpicsMotor, "VFM_IO}Mtr") HFM_Z = Comp(EpicsMotor, "HFM_Astig}Mtr") HFM_X = Comp(EpicsMotor, "HFM_IO}Mtr") HFM_Mirror_Astig = Comp(EpicsMotor, "HFM_Astig}Mtr") HFM_Mirror_InOut = Comp(EpicsMotor, "HFM_IO}Mtr") HFM_Mirror_Trans = Comp(EpicsMotor, "HFM_IO}Mtr") HFM_Au_Mesh = Comp(EpicsMotor, "HGM}Mtr") VFM_Au_Mesh = Comp(EpicsMotor, "VGM}Mtr")
class Monochromator(Device): Focus_Const = Comp(EpicsMotor, "Cff}Mtr") Energy = Comp(EpicsMotor, "Eng}Mtr") Grating_Trans = Comp(EpicsMotor, "GT}Trans:Mtr") Mirror_Pitch = Comp(EpicsMotor, "MP}Mtr") Grating_Pitch = Comp(EpicsMotor, "GP}Mtr")
class SP_mtr(Device): X = Comp(EpicsMotor, "-Ax:X}Mtr", kind='hinted') Y = Comp(EpicsMotor, "-Ax:Y}Mtr", kind='hinted') Z = Comp(EpicsMotor, "-Ax:Z}Mtr", kind='hinted') Rx = Comp(EpicsMotor, "-Ax:Rx}Mtr", kind='hinted')
class Analyzer_mtr(Device): Rz = Comp(EpicsMotor, "{SA:1-DPRF:EA1_1-Ax:1}Mtr")
class Virtual_Size(PVPositioner): #This is used to connect to the front end gap size PV's. readback = Comp(EpicsSignalRO, 't2.C') setpoint = Comp(EpicsSignal, 'size') done = Comp(EpicsSignalRO, 'DMOV') done_value = 1
class ExitSlit(Device): v_gap = Comp(EpicsMotor, "_VG}Mtr") h_gap = Comp(EpicsMotor, "_HG}Mtr") h_def = Comp(EpicsMotor, "_HDS}Mtr") v_def = Comp(EpicsMotor, "_VDS}Mtr")
class DIAG(Device): trans = Comp(EpicsMotor, "}Mtr", kind='hinted')
class Hexapod_Mir(Device): X = Comp(EpicsMotor, "_X}Mtr") Mirror_Trans = Comp(EpicsMotor, "_X}Mtr") Mirror_InOut = Comp(EpicsMotor, "_X}Mtr") Y = Comp(EpicsMotor, "_Y}Mtr") Mirror_Stripe = Comp(EpicsMotor, "_Y}Mtr") Mirror_Exchange = Comp(EpicsMotor, "_Y}Mtr") Z = Comp(EpicsMotor, "_Z}Mtr") Rx = Comp(EpicsMotor, "_Rx}Mtr") Mirror_Roll = Comp(EpicsMotor, "_Rx}Mtr") Ry = Comp(EpicsMotor, "_Ry}Mtr") Mirror_Pitch = Comp(EpicsMotor, "_Ry}Mtr") Rz = Comp(EpicsMotor, "_Rz}Mtr") Mirror_Yaw = Comp(EpicsMotor, "_Rz}Mtr")
class Pol_mtr(Device): Rz = Comp(EpicsMotor, 'Mtr', kind='hinted')