-
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
Get moveonclick
to work
#194
Conversation
moveonclick
moveonclick
to work
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.
Thanks, just one comment
zoomcalibrator = RE(_calculate_zoom_calibrator(oav)).plan_result # type: ignore | ||
xmove = -1 * (beamX - x) * zoomcalibrator | ||
ymove = -1 * (beamY - y) * zoomcalibrator | ||
logger.info(f"Moving X and Y {xmove} {ymove}") | ||
xmovepmacstring = "#1J:" + str(xmove) | ||
ymovepmacstring = "#2J:" + str(ymove) | ||
yield from bps.abs_set(pmac.pmac_string, xmovepmacstring, wait=True) | ||
yield from bps.abs_set(pmac.pmac_string, ymovepmacstring, wait=True) | ||
RE(_move_to_position(pmac, xmovepmacstring, ymovepmacstring)) |
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.
Should: Instead of calling the run engine twice we could just have a plan that calculates the zoom calibration then moves
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.
Just one comment, sorry.
yield from bps.abs_set(pmac.pmac_string, xmovepmacstring, wait=True) | ||
yield from bps.abs_set(pmac.pmac_string, ymovepmacstring, wait=True) |
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.
Should: Can you either use _move_to_position
here or remove the unused function?
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.
Great, thank you!
Multiple
moveonclick
fixes/changes:zoomcalibrator
from fitting curve: so far this value has been fixed to an empirically determined constant that didn't work well for all zoom levels. This adds a way to work out a correct value depending on the zoom level currently in use. Closes I24 SSX: Take into account zoom in click to move #44yield from bps.abs_set(pmac.pmac_string, ymovepmacstring, wait=True)
inonMouse
made it a generator, which couldn't work insetMouseCallback