Skip to content

Commit d4908cc

Browse files
authored
D7 positioner (#1208)
* add xyz positioner * remove the unneeded path provider for xyz positioner * rename to sample stage at visr * add d7 positioner * respond to comments * ruff lint * make the d7 positioner use enum * make d7 enum all uppercase * into positioner A and B * add b positioner * lint * more lint * positioner a test * test for positioner b * lint * migrate to 1d generic positioner * delete the two mistaken test files * Delete tests/devices/i18/test_d7_positioner_a.py * fix connectivity to i18 diode * towards making the diode work * fix the d7 epics refs * fix trailing whitespace error
1 parent 1deaf91 commit d4908cc

File tree

2 files changed

+38
-5
lines changed

2 files changed

+38
-5
lines changed

src/dodal/beamlines/i18.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ def hfm() -> KBMirror:
113113

114114

115115
@device_factory()
116-
def d7diode() -> Diode:
116+
def d7_diode() -> Diode:
117117
return Diode(f"{PREFIX.beamline_prefix}-DI-PHDGN-07:")
118118

119119

src/dodal/devices/i18/diode.py

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,50 @@
1-
from ophyd_async.core import (
2-
StandardReadable,
3-
)
1+
from ophyd_async.core import StandardReadable, StrictEnum
42
from ophyd_async.epics.core import epics_signal_r
53

4+
from dodal.devices.positioner import create_positioner
5+
6+
7+
class FilterAValues(StrictEnum):
8+
"""Maps from a short usable name to the string name in EPICS"""
9+
10+
AL_2MM = "2 mm Al"
11+
AL_1_5MM = "1.5 mm Al"
12+
AL_1_25MM = "1.25 mm Al"
13+
AL_0_8MM = "0.8 mm Al"
14+
AL_0_55MM = "0.55 mm Al"
15+
AL_0_5MM = "0.5 mm Al"
16+
AL_0_3MM = "0.3 mm Al"
17+
AL_0_25MM = "0.25 mm Al"
18+
AL_0_15MM = "0.15 mm Al"
19+
AL_0_1MM = "0.1 mm Al"
20+
AL_0_05MM = "0.05 mm Al"
21+
AL_0_025MM = "0.025 mm Al"
22+
AL_GAP = "Gap"
23+
24+
25+
class FilterBValues(StrictEnum):
26+
DIAMOND_THIN = "Diamond thin"
27+
DIAMOND_THICK = "Diamond thick"
28+
NI_DRAIN = "ni drain"
29+
AU_DRAIN = "au drain"
30+
AL_DRAIN = "al drain"
31+
GAP = "Gap"
32+
IN_LINE_DIODE = "in line diode"
33+
634

735
class Diode(StandardReadable):
836
def __init__(
937
self,
1038
prefix: str,
1139
name: str = "",
1240
):
13-
self._prefix = prefix
1441
with self.add_children_as_readables():
1542
self.signal = epics_signal_r(float, prefix + "B:DIODE:I")
43+
self.positioner_a = create_positioner(
44+
FilterAValues, prefix + "A:MP", positioner_pv_suffix=":SELECT"
45+
) # more complex, will be fixed on Tuesday 20.05.2025
46+
self.positioner_b = create_positioner(
47+
FilterBValues, prefix + "B:MP", positioner_pv_suffix=":SELECT"
48+
)
1649

1750
super().__init__(name=name)

0 commit comments

Comments
 (0)