Skip to content
9 changes: 3 additions & 6 deletions src/instrument/devices/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,14 @@
from .idt_mono import idt_mono
from .meascomp_usb_ctr import mcs
from .tetramm_picoammeter import tetramm

# from .qnw_device import qnw_env1, qnw_env2, qnw_env3
from .slit_4 import sl4
from .slit_8 import sl8
from .slit_9 import sl9
from .qnw_device import qnw_env1, qnw_env2, qnw_env3
from .slit_base import sl4_base, sl5_base, sl7_base, sl8_base, sl9_base
from .slit import sl4, sl5, sl7, sl8, sl9
from .granite import granite

## Beamline Area Detectors
from .ad_eiger_4M import eiger4M
from .ad_flag1 import flag1ad

from .ad_flag2 import flag2ad
from .ad_lambda_2M import lambda2M
from .ad_rigaku_3M import rigaku3M
Expand Down
4 changes: 2 additions & 2 deletions src/instrument/devices/damm.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
logger.info(__file__)


class Slit2(Device):
class Damm(Device):
def __init__(
self,
prefix: str,
Expand All @@ -40,4 +40,4 @@ def __init__(
y = FCpt(EpicsMotor, "{motor_prefix}:{_y_motor}", labels={"motors"})


damm = Slit2(name="damm", prefix="8iddSoft:CR8-D1:US", x_motor="m2", y_motor="m3")
damm = Damm(name="damm", prefix="8iddSoft:CR8-D1:US", x_motor="m2", y_motor="m3")
47 changes: 47 additions & 0 deletions src/instrument/devices/slit.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
"""
Slit Devices at 8-ID
"""

__all__ = """
sl4
sl5
sl7
sl8
sl9
""".split()

import logging

from apstools.devices.positioner_soft_done import PVPositionerSoftDone
from apstools.synApps.db_2slit import Optics2Slit1D
from apstools.synApps.db_2slit import Optics2Slit2D_HV
from ophyd import Component as cpt
from ophyd import EpicsSignal

logger = logging.getLogger(__name__)
logger.info(__file__)


class ID8Optics2Slit1D(Optics2Slit1D):
xn = cpt(PVPositionerSoftDone, "", setpoint_pv="xn", readback_pv="xn.RBV")
xp = cpt(PVPositionerSoftDone, "", setpoint_pv="xp", readback_pv="xp.RBV")
size = cpt(PVPositionerSoftDone, "", setpoint_pv="size", readback_pv="size.RBV")
center = cpt(
PVPositionerSoftDone, "", setpoint_pv="center", readback_pv="center.RBV"
)
sync = cpt(
EpicsSignal, "doSync", put_complete=True, kind="omitted"
) # TODO: What is the pv value for sync


class ID8Optics2Slit2D_HV(Optics2Slit2D_HV):
h = cpt(ID8Optics2Slit1D, "H")
v = cpt(ID8Optics2Slit1D, "V")


# Create the sl9 object
sl4 = ID8Optics2Slit2D_HV("8iddSoft:Slit1", name="sl-4")
sl5 = ID8Optics2Slit2D_HV("8ideSoft:Slit1", name="sl-5")
sl7 = ID8Optics2Slit2D_HV("8ideSoft:Slit2", name="sl-7")
sl8 = ID8Optics2Slit2D_HV("8idiSoft:Slit1", name="sl-8")
sl9 = ID8Optics2Slit2D_HV("8idiSoft:Slit2", name="sl-9")
64 changes: 0 additions & 64 deletions src/instrument/devices/slit_4.py

This file was deleted.

64 changes: 0 additions & 64 deletions src/instrument/devices/slit_8.py

This file was deleted.

64 changes: 0 additions & 64 deletions src/instrument/devices/slit_9.py

This file was deleted.

61 changes: 61 additions & 0 deletions src/instrument/devices/slit_base.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
"""
Slit Base Devices at 8-ID
"""

__all__ = """
sl4_base
sl5_base
sl7_base
sl8_base
sl9_base
""".split()


import logging

from ophyd import Device
from ophyd import EpicsMotor
from ophyd import FormattedComponent as FCpt

logger = logging.getLogger(__name__)
logger.info(__file__)


class SlitBase(Device):
def __init__(
self,
prefix: str,
h_motor: str,
v_motor: str,
*args,
**kwargs,
):
# Determine the prefix for the motors
pieces = prefix.strip(":").split(":")
self.motor_prefix = ":".join(pieces[:-1])

self._h_motor = h_motor
self._v_motor = v_motor

super().__init__(prefix, *args, **kwargs)

# Real motors that directly control the slits
h = FCpt(EpicsMotor, "{motor_prefix}:{_h_motor}", labels={"motors"})
v = FCpt(EpicsMotor, "{motor_prefix}:{_v_motor}", labels={"motors"})


sl4_base = SlitBase(
name="SL 4 Base", prefix="8iddSoft:CR8-D1:US", h_motor="m15", v_motor="m16"
)
sl5_base = SlitBase(
name="SL 5 Base", prefix="8ideSoft:CR8-E2:US", h_motor="m5", v_motor="m6"
)
sl7_base = SlitBase(
name="SL 7 Base", prefix="8ideSoft:CR8-E2:US", h_motor="m15", v_motor="m16"
)
sl8_base = SlitBase(
name="SL 8 Base", prefix="8idiSoft:CR8-I2:US", h_motor="m5", v_motor="m6"
)
sl9_base = SlitBase(
name="SL 9 Base", prefix="8idiSoft:CR8-I2:US", h_motor="m15", v_motor="m16"
)