Skip to content

Commit

Permalink
add a kb mirror device@
Browse files Browse the repository at this point in the history
  • Loading branch information
stan-dot committed Aug 22, 2024
1 parent bff93b7 commit c064bec
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/dodal/beamlines/i18.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
from dodal.common.beamlines.device_helpers import numbered_slits
from dodal.common.crystal_metadata import CrystalMetadata
from dodal.common.visit import DirectoryServiceClient, StaticVisitDirectoryProvider
from dodal.devices.focusing_mirror import FocusingMirror
from dodal.devices.i18.diode import Diode
from dodal.devices.i18.KBMirror import KBMirror
from dodal.devices.i18.sim_detector import SimDetector
from dodal.devices.i18.sim_raster_stage import RasterStage
from dodal.devices.i18.table import Table
Expand Down Expand Up @@ -185,23 +185,22 @@ def it(
def vfm(
wait_for_connection: bool = True,
fake_with_ophyd_sim: bool = False,
) -> FocusingMirror:
) -> KBMirror:
return device_instantiation(
FocusingMirror,
KBMirror,
"vfm",
"-OP-VFM-01:",
wait_for_connection,
fake_with_ophyd_sim,
)


@skip_device
def hfm(
wait_for_connection: bool = True,
fake_with_ophyd_sim: bool = False,
) -> FocusingMirror:
) -> KBMirror:
return device_instantiation(
FocusingMirror,
KBMirror,
"hfm",
"-OP-HFM-01:",
wait_for_connection,
Expand Down
22 changes: 22 additions & 0 deletions src/dodal/devices/i18/KBMirror.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
from bluesky.protocols import Movable
from ophyd_async.core import (
StandardReadable,
)
from ophyd_async.epics.signal import epics_signal_rw


class KBMirror(StandardReadable, Movable):
def __init__(
self,
prefix: str,
name: str = "",
):
self._prefix = prefix
with self.add_children_as_readables():
self.x = epics_signal_rw(float, prefix + "X")
self.y = epics_signal_rw(float, prefix + "Y")
self.bend1 = epics_signal_rw(float, prefix + "BEND1")
self.bend2 = epics_signal_rw(float, prefix + "BEND2")
self.curve = epics_signal_rw(float, prefix + "CURVE")
self.ellip = epics_signal_rw(float, prefix + "ELLIP")
super().__init__(name=name)

0 comments on commit c064bec

Please sign in to comment.