Skip to content

Commit

Permalink
Add lower gonio to i03 and update XYZPositioner to ophyd_async (#614)
Browse files Browse the repository at this point in the history
  • Loading branch information
DominicOram authored Jun 12, 2024
1 parent bdadd3f commit 6f4b73a
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 12 deletions.
16 changes: 16 additions & 0 deletions src/dodal/beamlines/i03.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from dodal.devices.fast_grid_scan import PandAFastGridScan, ZebraFastGridScan
from dodal.devices.flux import Flux
from dodal.devices.focusing_mirror import FocusingMirrorWithStripes, VFMMirrorVoltages
from dodal.devices.motors import XYZPositioner
from dodal.devices.oav.oav_detector import OAV, OAVConfigParams
from dodal.devices.oav.pin_image_recognition import PinTipDetection
from dodal.devices.qbpm1 import QBPM1
Expand Down Expand Up @@ -495,3 +496,18 @@ def thawer(
wait_for_connection,
fake_with_ophyd_sim,
)


def lower_gonio_positioner(
wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False
) -> XYZPositioner:
"""Get the i03 lower gonio device, instantiate it if it hasn't already been.
If this is called when already instantiated in i03, it will return the existing object.
"""
return device_instantiation(
XYZPositioner,
"lower_gonio_positioner",
"-MO-GONP-01:",
wait_for_connection,
fake_with_ophyd_sim,
)
8 changes: 0 additions & 8 deletions src/dodal/devices/lower_gonio_stages.py

This file was deleted.

12 changes: 8 additions & 4 deletions src/dodal/devices/motors.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@
from typing import List, Tuple

import numpy as np
from ophyd import Component, Device, EpicsMotor
from ophyd import EpicsMotor
from ophyd_async.core import Device
from ophyd_async.epics.motion import Motor


class XYZPositioner(Device):
x = Component(EpicsMotor, "X")
y = Component(EpicsMotor, "Y")
z = Component(EpicsMotor, "Z")
def __init__(self, prefix: str, name: str):
self.x = Motor(prefix + "X")
self.y = Motor(prefix + "Y")
self.z = Motor(prefix + "Z")
super().__init__(name)


@dataclass
Expand Down

0 comments on commit 6f4b73a

Please sign in to comment.