Skip to content
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

I24 SSX: Take into account zoom in click to move #44

Open
DominicOram opened this issue Sep 14, 2023 · 4 comments
Open

I24 SSX: Take into account zoom in click to move #44

DominicOram opened this issue Sep 14, 2023 · 4 comments
Labels
I24 serial Issues relating to ssx on I24

Comments

@DominicOram
Copy link
Contributor

Currently the click to move has a hardcoded scale factor for pixels to microns. We should instead get the scale from the OAVParameters and we should make sure it's updated on zoom level

@DominicOram
Copy link
Contributor Author

Should probably do #42 first

@noemifrisina noemifrisina added the I24 serial Issues relating to ssx on I24 label Sep 15, 2023
@DominicOram
Copy link
Contributor Author

We may also need to do #54 first

@noemifrisina
Copy link
Contributor

OAVParameters related issue from testing on 14/11/23

Viewer opens fine but it gets shut off after a bit with the following error:

Clicked X and Y 827 266
Moving X and Y 1134 756
Clicked X and Y 684 467
Moving X and Y 276 -450
Clicked X and Y 528 596
Moving X and Y -660 -1224
Traceback (most recent call last):
  File "/dls_sw/i24/software/bluesky/mx_bluesky/src/mx_bluesky/I24/serial/fixed_target/i24ssx_moveonclick.py", line 59, in onMouse
  File "/dls_sw/i24/software/bluesky/mx_bluesky/src/mx_bluesky/I24/serial/fixed_target/i24ssx_moveonclick.py", line 54, in get_beam_centre_from_oav
  File "/dls_sw/i24/software/bluesky/mx_bluesky/src/mx_bluesky/I24/serial/fixed_target/i24ssx_moveonclick.py", line 38, in _get_beam_centre
  File "/dls_sw/i24/software/bluesky/mx_bluesky/.venv/lib/python3.10/site-packages/bluesky/run_engine.py", line 364, in __init__
  File "/dls_sw/apps/python/miniforge/4.10.0-0/envs/python3.10/lib/python3.10/asyncio/events.py", line 783, in new_event_loop
  File "/dls_sw/apps/python/miniforge/4.10.0-0/envs/python3.10/lib/python3.10/asyncio/events.py", line 673, in new_event_loop
  File "/dls_sw/apps/python/miniforge/4.10.0-0/envs/python3.10/lib/python3.10/asyncio/unix_events.py", line 64, in __init__
  File "/dls_sw/apps/python/miniforge/4.10.0-0/envs/python3.10/lib/python3.10/asyncio/selector_events.py", line 56, in __init__
  File "/dls_sw/apps/python/miniforge/4.10.0-0/envs/python3.10/lib/python3.10/asyncio/selector_events.py", line 103, in _make_self_pipe
  File "/dls_sw/apps/python/miniforge/4.10.0-0/envs/python3.10/lib/python3.10/socket.py", line 607, in socketpair
OSError: [Errno 24] Too many open files
Exception ignored in: <function BaseEventLoop.__del__ at 0x7fed02b84ca0>
Traceback (most recent call last):
  File "/dls_sw/apps/python/miniforge/4.10.0-0/envs/python3.10/lib/python3.10/asyncio/base_events.py", line 690, in __del__
  File "/dls_sw/apps/python/miniforge/4.10.0-0/envs/python3.10/lib/python3.10/asyncio/unix_events.py", line 68, in close
  File "/dls_sw/apps/python/miniforge/4.10.0-0/envs/python3.10/lib/python3.10/asyncio/selector_events.py", line 87, in close
  File "/dls_sw/apps/python/miniforge/4.10.0-0/envs/python3.10/lib/python3.10/asyncio/selector_events.py", line 94, in _close_self_pipe
AttributeError: '_UnixSelectorEventLoop' object has no attribute '_ssock'
Traceback (most recent call last):
  File "/dls_sw/i24/software/bluesky/mx_bluesky/src/mx_bluesky/I24/serial/fixed_target/i24ssx_moveonclick.py", line 59, in onMouse
  File "/dls_sw/i24/software/bluesky/mx_bluesky/src/mx_bluesky/I24/serial/fixed_target/i24ssx_moveonclick.py", line 52, in get_beam_centre_from_oav
  File "/dls_sw/i24/software/bluesky/dodal/src/dodal/devices/oav/oav_parameters.py", line 35, in __init__
  File "/dls_sw/i24/software/bluesky/dodal/src/dodal/devices/oav/oav_parameters.py", line 49, in load_json
OSError: [Errno 24] Too many open files: '/dls_sw/i24/software/daq_configuration/json/OAVCentring.json'
Traceback (most recent call last):
  File "/dls_sw/i24/software/bluesky/mx_bluesky/src/mx_bluesky/I24/serial/fixed_target/i24ssx_moveonclick.py", line 215, in <module>
  File "/dls_sw/i24/software/bluesky/mx_bluesky/src/mx_bluesky/I24/serial/fixed_target/i24ssx_moveonclick.py", line 169, in start_viewer
  File "/dls_sw/i24/software/bluesky/mx_bluesky/src/mx_bluesky/I24/serial/fixed_target/i24ssx_moveonclick.py", line 73, in update_ui
  File "/dls_sw/i24/software/bluesky/mx_bluesky/src/mx_bluesky/I24/serial/fixed_target/i24ssx_moveonclick.py", line 52, in get_beam_centre_from_oav
  File "/dls_sw/i24/software/bluesky/dodal/src/dodal/devices/oav/oav_parameters.py", line 35, in __init__
  File "/dls_sw/i24/software/bluesky/dodal/src/dodal/devices/oav/oav_parameters.py", line 49, in load_json
OSError: [Errno 24] Too many open files: '/dls_sw/i24/software/daq_configuration/json/OAVCentring.json'
Traceback (most recent call last):
  File "/dls_sw/i24/software/bluesky/mx_bluesky/src/mx_bluesky/I24/serial/fixed_target/i24ssx_moveonclick.py", line 59, in onMouse
  File "/dls_sw/i24/software/bluesky/mx_bluesky/src/mx_bluesky/I24/serial/fixed_target/i24ssx_moveonclick.py", line 54, in get_beam_centre_from_oav
  File "/dls_sw/i24/software/bluesky/mx_bluesky/src/mx_bluesky/I24/serial/fixed_target/i24ssx_moveonclick.py", line 38, in _get_beam_centre
  File "/dls_sw/i24/software/bluesky/mx_bluesky/.venv/lib/python3.10/site-packages/bluesky/run_engine.py", line 364, in __init__
  File "/dls_sw/apps/python/miniforge/4.10.0-0/envs/python3.10/lib/python3.10/asyncio/events.py", line 783, in new_event_loop
  File "/dls_sw/apps/python/miniforge/4.10.0-0/envs/python3.10/lib/python3.10/asyncio/events.py", line 673, in new_event_loop
  File "/dls_sw/apps/python/miniforge/4.10.0-0/envs/python3.10/lib/python3.10/asyncio/unix_events.py", line 64, in __init__
  File "/dls_sw/apps/python/miniforge/4.10.0-0/envs/python3.10/lib/python3.10/asyncio/selector_events.py", line 56, in __init__
  File "/dls_sw/apps/python/miniforge/4.10.0-0/envs/python3.10/lib/python3.10/asyncio/selector_events.py", line 103, in _make_self_pipe
  File "/dls_sw/apps/python/miniforge/4.10.0-0/envs/python3.10/lib/python3.10/socket.py", line 607, in socketpair
OSError: [Errno 24] Too many open files
Exception ignored in: <function BaseEventLoop.__del__ at 0x7fed02b84ca0>
Traceback (most recent call last):
  File "/dls_sw/apps/python/miniforge/4.10.0-0/envs/python3.10/lib/python3.10/asyncio/base_events.py", line 690, in __del__
  File "/dls_sw/apps/python/miniforge/4.10.0-0/envs/python3.10/lib/python3.10/asyncio/unix_events.py", line 68, in close
  File "/dls_sw/apps/python/miniforge/4.10.0-0/envs/python3.10/lib/python3.10/asyncio/selector_events.py", line 87, in close
  File "/dls_sw/apps/python/miniforge/4.10.0-0/envs/python3.10/lib/python3.10/asyncio/selector_events.py", line 94, in _close_self_pipe
AttributeError: '_UnixSelectorEventLoop' object has no attribute '_ssock'
Traceback (most recent call last):
  File "/dls_sw/i24/software/bluesky/mx_bluesky/src/mx_bluesky/I24/serial/fixed_target/i24ssx_moveonclick.py", line 59, in onMouse
  File "/dls_sw/i24/software/bluesky/mx_bluesky/src/mx_bluesky/I24/serial/fixed_target/i24ssx_moveonclick.py", line 52, in get_beam_centre_from_oav
  File "/dls_sw/i24/software/bluesky/dodal/src/dodal/devices/oav/oav_parameters.py", line 35, in __init__
  File "/dls_sw/i24/software/bluesky/dodal/src/dodal/devices/oav/oav_parameters.py", line 49, in load_json
OSError: [Errno 24] Too many open files: '/dls_sw/i24/software/daq_configuration/json/OAVCentring.json'
Traceback (most recent call last):
  File "/dls_sw/i24/software/bluesky/mx_bluesky/src/mx_bluesky/I24/serial/fixed_target/i24ssx_moveonclick.py", line 215, in <module>
  File "/dls_sw/i24/software/bluesky/mx_bluesky/src/mx_bluesky/I24/serial/fixed_target/i24ssx_moveonclick.py", line 169, in start_viewer
  File "/dls_sw/i24/software/bluesky/mx_bluesky/src/mx_bluesky/I24/serial/fixed_target/i24ssx_moveonclick.py", line 73, in update_ui
  File "/dls_sw/i24/software/bluesky/mx_bluesky/src/mx_bluesky/I24/serial/fixed_target/i24ssx_moveonclick.py", line 52, in get_beam_centre_from_oav
  File "/dls_sw/i24/software/bluesky/dodal/src/dodal/devices/oav/oav_parameters.py", line 35, in __init__
  File "/dls_sw/i24/software/bluesky/dodal/src/dodal/devices/oav/oav_parameters.py", line 49, in load_json
OSError: [Errno 24] Too many open files: '/dls_sw/i24/software/daq_configuration/json/OAVCentring.json'

This issue should get fixed by Dodal224, which is also needed before proceeding with this issue.

@noemifrisina noemifrisina mentioned this issue Nov 15, 2023
4 tasks
@noemifrisina
Copy link
Contributor

The OSError above seems to have been cause by the same file being opened in another process at the same time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I24 serial Issues relating to ssx on I24
Projects
None yet
Development

No branches or pull requests

2 participants