-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use dodal devices more widely for I24 #116
Changes from 8 commits
b366efb
51b326e
2dd2d32
29315c1
494e718
7f49439
ea3dbbf
798702a
c51fdbd
308aff0
cca6ff6
952beb1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,8 @@ | |
from blueapi.core import MsgGenerator | ||
from dodal.beamlines import i24 | ||
from dodal.common import inject | ||
from dodal.devices.i24.beamstop import Beamstop, BeamstopPositions | ||
from dodal.devices.i24.dual_backlight import BacklightPositions, DualBacklight | ||
from dodal.devices.i24.I24_detector_motion import DetectorMotion | ||
from dodal.devices.i24.pmac import PMAC, EncReset, LaserSettings | ||
|
||
|
@@ -610,7 +612,13 @@ def moveto(place: str = "origin", pmac: PMAC = inject("pmac")) -> MsgGenerator: | |
|
||
|
||
@log.log_on_entry | ||
def moveto_preset(place: str, pmac: PMAC = inject("pmac")) -> MsgGenerator: | ||
def moveto_preset( | ||
place: str, | ||
pmac: PMAC = inject("pmac"), | ||
beamstop: Beamstop = inject("beamstop"), | ||
backlight: DualBacklight = inject("backlight"), | ||
det_stage: DetectorMotion = inject("detector_motion"), | ||
) -> MsgGenerator: | ||
setup_logging() | ||
|
||
# Non Chip Specific Move | ||
|
@@ -620,16 +628,22 @@ def moveto_preset(place: str, pmac: PMAC = inject("pmac")) -> MsgGenerator: | |
|
||
elif place == "load_position": | ||
logger.info("load position") | ||
caput(pv.bs_mp_select, "Robot") | ||
caput(pv.bl_mp_select, "Out") | ||
caput(pv.det_z, 1300) | ||
yield from bps.abs_set( | ||
beamstop.pos_select, BeamstopPositions.ROBOT, group=place | ||
) | ||
yield from bps.abs_set(backlight, BacklightPositions.OUT, group=place) | ||
yield from bps.mv(det_stage.z, 1300) | ||
yield from bps.wait(group=place) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: mixing yield from bps.mv(
beamstop.pos_select, BeamstopPositions.ROBOT,
backlight, BacklightPositions.OUT,
det_stage.z, 1300
) or yield from bps.abs_set(
beamstop.pos_select, BeamstopPositions.ROBOT, group=place
)
yield from bps.abs_set(backlight, BacklightPositions.OUT, group=place)
yield from bps.abs_set(det_stage.z, 1300, group=place)
yield from bps.wait(group=place) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd go with the second one because for the backlight I've overloaded set as it needs to turn it on and off depending on position. Not sure move would achieve that in this case... |
||
|
||
elif place == "collect_position": | ||
logger.info("collect position") | ||
caput(pv.me14e_filter, 20) | ||
yield from bps.mv(pmac.x, 0.0, pmac.y, 0.0, pmac.z, 0.0) | ||
caput(pv.bs_mp_select, "Data Collection") | ||
caput(pv.bl_mp_select, "In") | ||
yield from bps.abs_set( | ||
beamstop.pos_select, BeamstopPositions.DATA_COLLECTION, group=place | ||
) | ||
yield from bps.abs_set(backlight, BacklightPositions.IN, group=place) | ||
yield from bps.wait(group=place) | ||
Comment on lines
+658
to
+662
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: As above, a |
||
|
||
elif place == "microdrop_position": | ||
logger.info("microdrop align position") | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could: It would be nice to have a test that covered that
call_nexgen
has been called with the expected params