Skip to content

Commit 24a51cf

Browse files
add PGM support for i21 (#1538)
* add PGM support for i21 * remove name arg as the default is the same Co-authored-by: oliwenmandiamond <[email protected]> --------- Co-authored-by: oliwenmandiamond <[email protected]>
1 parent b2a3f9c commit 24a51cf

File tree

3 files changed

+38
-0
lines changed

3 files changed

+38
-0
lines changed

src/dodal/beamlines/i21.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
from dodal.common.beamlines.beamline_utils import (
2+
device_factory,
3+
)
4+
from dodal.common.beamlines.beamline_utils import set_beamline as set_utils_beamline
5+
from dodal.devices.i21 import Grating
6+
from dodal.devices.pgm import PGM
7+
from dodal.devices.synchrotron import Synchrotron
8+
from dodal.log import set_beamline as set_log_beamline
9+
from dodal.utils import BeamlinePrefix, get_beamline_name
10+
11+
BL = get_beamline_name("i21")
12+
PREFIX = BeamlinePrefix(BL, suffix="I")
13+
set_log_beamline(BL)
14+
set_utils_beamline(BL)
15+
16+
17+
@device_factory()
18+
def synchrotron() -> Synchrotron:
19+
return Synchrotron()
20+
21+
22+
@device_factory()
23+
def pgm() -> PGM:
24+
return PGM(
25+
prefix=f"{PREFIX.beamline_prefix}-OP-PGM-01:",
26+
grating=Grating,
27+
)

src/dodal/devices/i21/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from dodal.devices.i21.enums import Grating
2+
3+
__all__ = ["Grating"]

src/dodal/devices/i21/enums.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
from ophyd_async.core import StrictEnum
2+
3+
4+
class Grating(StrictEnum):
5+
VPG1 = "VPG1"
6+
VPG2 = "VPG2"
7+
VPG3 = "VPG3"
8+
VPG4 = "VPG4"

0 commit comments

Comments
 (0)