Skip to content

Add tool to poll ophyd Signal instances#194

Open
cappel89 wants to merge 4 commits intomainfrom
feat/add-signal-monitoring-tool
Open

Add tool to poll ophyd Signal instances#194
cappel89 wants to merge 4 commits intomainfrom
feat/add-signal-monitoring-tool

Conversation

@cappel89
Copy link
Copy Markdown
Member

@cappel89 cappel89 commented Apr 7, 2026

Summary

This PR introduces a tool that allows to register signals or small callable scripts to poll from HW that is integrated in form of an ophyd.Signal. This allows us to implement synchronization logic asynchronously if combined with Compare/TransitionStatus objects for HW that usually does not support passive updates (i.e. EPICS HW without proper auto_monitor support, SocketSignals or HTTP signals). This type of logic is however regularly needed for complete, trigger etc.

TODO

  • Test with HW at a beamline.

Comment

I think it could be merged before tests with HW. The unit test indicates that it works well! If someone persists on HW test before merging, I can look into it.

@cappel89 cappel89 requested a review from a team April 7, 2026 11:50
@cappel89 cappel89 self-assigned this Apr 7, 2026
Copilot AI review requested due to automatic review settings April 7, 2026 11:50
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 7, 2026

Codecov Report

❌ Patch coverage is 90.90909% with 6 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
ophyd_devices/utils/signal_monitoring.py 90.90% 6 Missing ⚠️

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a utility to actively poll ophyd.Signal instances (or arbitrary callables) on a background thread, intended to support asynchronous synchronization for hardware sources that don’t produce passive updates.

Changes:

  • Introduces SignalMonitoring, a thread-based polling manager with start/stop/shutdown.
  • Supports registering either ophyd.Signal instances (polled via get()) or custom callables (polled via invocation).
  • Adds a configurable polling interval.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ophyd_devices/utils/signal_monitoring.py Outdated
Comment thread ophyd_devices/utils/signal_monitoring.py
Comment thread ophyd_devices/utils/signal_monitoring.py
Comment thread ophyd_devices/utils/signal_monitoring.py
Comment thread ophyd_devices/utils/signal_monitoring.py
@cappel89 cappel89 force-pushed the feat/add-signal-monitoring-tool branch from c648f24 to 6f5951b Compare April 7, 2026 12:08
@cappel89 cappel89 force-pushed the feat/add-signal-monitoring-tool branch from 6f5951b to 66db1ed Compare April 15, 2026 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants