|
6 | 6 | idd == id1, idu == id2. |
7 | 7 | """ |
8 | 8 |
|
9 | | -from daq_config_server.client import ConfigServer |
10 | | - |
11 | 9 | from dodal.common.beamlines.beamline_utils import device_factory |
12 | 10 | from dodal.common.beamlines.beamline_utils import set_beamline as set_utils_beamline |
13 | | -from dodal.devices.apple2_undulator import ( |
14 | | - BeamEnergy, |
15 | | - InsertionDeviceEnergy, |
16 | | - InsertionDevicePolarisation, |
17 | | - UndulatorGap, |
18 | | - UndulatorJawPhase, |
19 | | - UndulatorPhaseAxes, |
20 | | -) |
21 | 11 | from dodal.devices.current_amplifiers import CurrentAmpDet |
22 | | -from dodal.devices.i10.diagnostics import I10Diagnostic, I10Diagnostic5ADet |
23 | | -from dodal.devices.i10.i10_apple2 import ( |
24 | | - I10Apple2, |
25 | | - I10Apple2Controller, |
26 | | - LinearArbitraryAngle, |
| 12 | +from dodal.devices.i10 import ( |
| 13 | + I10Diagnostic, |
| 14 | + I10Diagnostic5ADet, |
| 15 | + I10Slits, |
| 16 | + I10SlitsDrainCurrent, |
| 17 | + PiezoMirror, |
27 | 18 | ) |
28 | | -from dodal.devices.i10.i10_setting_data import I10Grating |
29 | | -from dodal.devices.i10.mirrors import PiezoMirror |
| 19 | +from dodal.devices.i10.diagnostics import I10Diagnostic, I10Diagnostic5ADet |
30 | 20 | from dodal.devices.i10.rasor.rasor_current_amp import RasorFemto, RasorSR570 |
31 | 21 | from dodal.devices.i10.rasor.rasor_motors import ( |
32 | 22 | DetSlits, |
33 | 23 | Diffractometer, |
34 | 24 | PaStage, |
35 | 25 | ) |
36 | 26 | from dodal.devices.i10.rasor.rasor_scaler_cards import RasorScalerCard1 |
37 | | -from dodal.devices.i10.slits import I10Slits, I10SlitsDrainCurrent |
38 | 27 | from dodal.devices.motors import XYStage, XYZStage |
39 | | -from dodal.devices.pgm import PGM |
40 | 28 | from dodal.devices.temperture_controller import ( |
41 | 29 | Lakeshore340, |
42 | 30 | ) |
|
48 | 36 | set_utils_beamline(BL) |
49 | 37 | PREFIX = BeamlinePrefix(BL) |
50 | 38 |
|
51 | | -I10_CONF_CLIENT = ConfigServer(url="https://daq-config.diamond.ac.uk") |
52 | | - |
53 | | - |
54 | | -LOOK_UPTABLE_DIR = "/dls_sw/i10/software/gda/workspace_git/gda-diamond.git/configurations/i10-shared/lookupTables/" |
55 | | - |
56 | | - |
57 | | -@device_factory() |
58 | | -def pgm() -> PGM: |
59 | | - "I10 Plane Grating Monochromator, it can change energy via pgm.energy.set(<energy>)" |
60 | | - return PGM( |
61 | | - prefix=f"{PREFIX.beamline_prefix}-OP-PGM-01:", |
62 | | - grating=I10Grating, |
63 | | - grating_pv="NLINES2", |
64 | | - ) |
65 | | - |
66 | | - |
67 | | -@device_factory() |
68 | | -def idd() -> I10Apple2: |
69 | | - """i10 downstream insertion device:""" |
70 | | - return I10Apple2( |
71 | | - id_gap=UndulatorGap(prefix=f"{PREFIX.insertion_prefix}-MO-SERVC-01:"), |
72 | | - id_phase=UndulatorPhaseAxes( |
73 | | - prefix=f"{PREFIX.insertion_prefix}-MO-SERVC-01:", |
74 | | - top_outer="RPQ1", |
75 | | - top_inner="RPQ2", |
76 | | - btm_inner="RPQ3", |
77 | | - btm_outer="RPQ4", |
78 | | - ), |
79 | | - id_jaw_phase=UndulatorJawPhase( |
80 | | - prefix=f"{PREFIX.insertion_prefix}-MO-SERVC-01:", |
81 | | - move_pv="RPQ1", |
82 | | - ), |
83 | | - ) |
84 | | - |
85 | | - |
86 | | -@device_factory() |
87 | | -def idd_controller() -> I10Apple2Controller: |
88 | | - """I10 downstream insertion device controller.""" |
89 | | - return I10Apple2Controller( |
90 | | - apple2=idd(), |
91 | | - lookuptable_dir=LOOK_UPTABLE_DIR, |
92 | | - source=("Source", "idd"), |
93 | | - config_client=I10_CONF_CLIENT, |
94 | | - ) |
95 | | - |
96 | | - |
97 | | -@device_factory() |
98 | | -def idd_energy() -> InsertionDeviceEnergy: |
99 | | - return InsertionDeviceEnergy(id_controller=idd_controller()) |
100 | | - |
101 | | - |
102 | | -@device_factory() |
103 | | -def idd_polarisation() -> InsertionDevicePolarisation: |
104 | | - return InsertionDevicePolarisation(id_controller=idd_controller()) |
105 | | - |
106 | | - |
107 | | -@device_factory() |
108 | | -def idd_laa() -> LinearArbitraryAngle: |
109 | | - return LinearArbitraryAngle(id_controller=idd_controller()) |
110 | | - |
111 | | - |
112 | | -@device_factory() |
113 | | -def energy_dd() -> BeamEnergy: |
114 | | - """Beam energy from down energy devices.""" |
115 | | - return BeamEnergy(id_energy=idd_energy(), mono=pgm().energy) |
116 | | - |
117 | | - |
118 | | -@device_factory() |
119 | | -def idu() -> I10Apple2: |
120 | | - """i10 upstream insertion device""" |
121 | | - return I10Apple2( |
122 | | - id_gap=UndulatorGap(prefix=f"{PREFIX.insertion_prefix}-MO-SERVC-21:"), |
123 | | - id_phase=UndulatorPhaseAxes( |
124 | | - prefix=f"{PREFIX.insertion_prefix}-MO-SERVC-21:", |
125 | | - top_outer="RPQ1", |
126 | | - top_inner="RPQ2", |
127 | | - btm_inner="RPQ3", |
128 | | - btm_outer="RPQ4", |
129 | | - ), |
130 | | - id_jaw_phase=UndulatorJawPhase( |
131 | | - prefix=f"{PREFIX.insertion_prefix}-MO-SERVC-21:", |
132 | | - move_pv="RPQ1", |
133 | | - ), |
134 | | - ) |
135 | | - |
136 | | - |
137 | | -@device_factory() |
138 | | -def idu_controller() -> I10Apple2Controller: |
139 | | - """I10 upstream insertion device controller.""" |
140 | | - return I10Apple2Controller( |
141 | | - apple2=idu(), |
142 | | - lookuptable_dir=LOOK_UPTABLE_DIR, |
143 | | - source=("Source", "idu"), |
144 | | - config_client=I10_CONF_CLIENT, |
145 | | - ) |
146 | | - |
147 | | - |
148 | | -@device_factory() |
149 | | -def idu_energy() -> InsertionDeviceEnergy: |
150 | | - return InsertionDeviceEnergy(id_controller=idu_controller()) |
151 | | - |
152 | | - |
153 | | -@device_factory() |
154 | | -def idu_polarisation() -> InsertionDevicePolarisation: |
155 | | - return InsertionDevicePolarisation(id_controller=idu_controller()) |
156 | | - |
157 | | - |
158 | | -@device_factory() |
159 | | -def idu_laa() -> LinearArbitraryAngle: |
160 | | - return LinearArbitraryAngle(id_controller=idu_controller()) |
161 | | - |
162 | | - |
163 | | -@device_factory() |
164 | | -def energy_ud() -> BeamEnergy: |
165 | | - """Beam energy from down energy devices.""" |
166 | | - return BeamEnergy(id_energy=idu_energy(), mono=pgm().energy) |
167 | | - |
168 | | - |
169 | 39 | """Mirrors""" |
170 | 40 |
|
171 | 41 |
|
172 | | -@device_factory() |
173 | | -def first_mirror() -> PiezoMirror: |
174 | | - return PiezoMirror(prefix=f"{PREFIX.beamline_prefix}-OP-COL-01:") |
175 | | - |
176 | | - |
177 | | -@device_factory() |
178 | | -def switching_mirror() -> PiezoMirror: |
179 | | - return PiezoMirror(prefix=f"{PREFIX.beamline_prefix}-OP-SWTCH-01:") |
180 | | - |
181 | | - |
182 | 42 | @device_factory() |
183 | 43 | def focusing_mirror() -> PiezoMirror: |
184 | 44 | return PiezoMirror(prefix=f"{PREFIX.beamline_prefix}-OP-FOCS-01:") |
|
0 commit comments