-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Modified hhl_slits to be a ophyd device. * Added documentation for hhl_slits file * appended _devices.rst file * made change to release date in rst file --------- Co-authored-by: Sector 25 ID-C User <[email protected]>
- Loading branch information
1 parent
5a18d41
commit 767640c
Showing
4 changed files
with
77 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
from ophyd import Component as Cpt | ||
from ophyd import Device | ||
from ophyd import FormattedComponent as FCpt | ||
from ophyd import EpicsMotor | ||
|
||
|
||
class HHLSlits(Device): | ||
""" | ||
High Heat Load Slit. | ||
There are no independent parts to move, so each axis only has center and size. | ||
Based on the 25-ID-A whitebeam slits. | ||
The motor parameters listed below specify which motor records | ||
control which axis. The last piece of the PV prefix will be | ||
removed, and the motor number added on. For example, if the prefix | ||
is "255ida:slits:US:", and the pitch motor is "255ida:slits:m3", | ||
then *pitch_motor* should be "m3". | ||
Parameters | ||
========== | ||
prefix: | ||
EPICS prefix required to communicate with HHL Slit IOC, ex: "25ida:slits:US:" | ||
pitch_motor: | ||
The motor record suffix controlling the real pitch motor, ex "m3" | ||
yaw_motor: | ||
The motor record suffix controlling the real yaw motor, ex "m4" | ||
horizontal_motor: | ||
The motor record suffix controlling the real horizontal motor, ex: "m1" | ||
diagonal_motor: | ||
The motor record suffix controlling the real diagonal motor, ex: "m2" | ||
""" | ||
|
||
def __init__( | ||
self, | ||
prefix: str, | ||
pitch_motor: str, | ||
yaw_motor: str, | ||
horizontal_motor: str, | ||
diagonal_motor: str, | ||
*args, | ||
**kwargs, | ||
): | ||
# Determine the prefix for the motors | ||
pieces = prefix.strip(":").split(":") | ||
self.motor_prefix = ":".join(pieces[:-1]) | ||
|
||
self._pitch_motor = pitch_motor | ||
self._yaw_motor = yaw_motor | ||
self._horizontal_motor = horizontal_motor | ||
self._diagonal_motor = diagonal_motor | ||
|
||
super().__init__(prefix, *args, **kwargs) | ||
|
||
class SlitAxis(Device): | ||
size = Cpt(EpicsMotor, "Size", labels={"motors"}) | ||
center = Cpt(EpicsMotor, "Center", labels={"motors"}) | ||
|
||
# Individual slit directions | ||
h = Cpt(SlitAxis, "h") | ||
v = Cpt(SlitAxis, "v") | ||
|
||
# Real motors that directly control the slits | ||
pitch = FCpt(EpicsMotor, "{motor_prefix}:{_pitch_motor}", labels={"motors"}) | ||
yaw = FCpt(EpicsMotor, "{motor_prefix}:{_yaw_motor}", labels={"motors"}) | ||
horizontal = FCpt(EpicsMotor, "{motor_prefix}:{_horizontal_motor}", labels={"motors"}) | ||
diagonal = FCpt(EpicsMotor, "{motor_prefix}:{_diagonal_motor}", labels={"motors"}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters