Skip to content

Add the filter bank (fb) - #9

Merged
Anthony Sligar (sligara7) merged 1 commit into
NSLS2:pdf-profile-conversionfrom
sligara7:pdf-conv-04d-filter-bank
Oct 23, 2026
Merged

Anthony Sligar (sligara7) merged 1 commit into
NSLS2:pdf-profile-conversionfrom
sligara7:pdf-conv-04d-filter-bank

Conversation

@sligara7

Copy link
Copy Markdown

Adds pdftools.shutter.TwoButtonShutter and FilterBank, and builds fb (XF:28ID1B-OP{Fltr:1..4}) in the profile.

  • Each filter fires Cmd:Opn-Cmd / Cmd:Cls-Cmd and waits for Pos-Sts; 1/"Open" takes it out of the beam, 0/"Close" puts it in, and it reads back "Open"/"Close" (as the old profile's read() patch did). PV names and meaning checked against the old 11-motors.py and the cs-studio-xf OCM screen.
  • One device fb replaces the old fb (open commands only) and fb_two_button_shutters/fb2; plans use fb.flt4 where they used fb2.flt4.
  • No re-actuation retry (nslsii's TwoButtonShutter re-fires up to 10 times); as in hextools' Shutter, a move that does not finish times out.

Verified: mock tests (PV names, commands fired, readback, timeout, profile boots in mock mode with fb). Not run on the beamline.

TwoButtonShutter fires Cmd:Opn-Cmd or Cmd:Cls-Cmd and waits for Pos-Sts, as nslsii.devices.TwoButtonShutter does; FilterBank holds the four filters at XF:28ID1B-OP{Fltr:1..4}. PV names and the Open=out/Close=in meaning come from pdf-profile-collection 11-motors and the cs-studio-xf OCM screen. One device, fb, replaces the old fb (open commands only) and fb_two_button_shutters/fb2.

Assisted-by: copilot:claude-opus-5-5
Copilot AI balanced review requested due to automatic review settings October 23, 2026 22:25

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Live command and readback behavior for beamline attenuation hardware remains unverified and needs human confirmation.

No open issues 🎉

What changed in this PR

Adds a four-filter bank to the PDF beamline profile, using two-button actuators with command execution and position readback.

Changes:

  • Adds TwoButtonShutter and FilterBank, supporting numeric and string targets, status-based completion, and timeouts.
  • Exposes the filter bank as fb in the collection profile.
  • Adds mock tests for PV names, commands, readback, timeout behavior, and profile initialization.
File Description
tests/​test_utils.py Checks that the mock profile exposes fb.
tests/​test_filter_bank.py Tests filter commands, readback, validation, and timeouts.
src/​pdftools/​shutter.py Implements two-button actuators, mock behavior, and the four-filter bank.
src/​pdftools/​profiles/​collection.py Creates fb with the beamline filter PV prefix.

Review effort: Balanced

@sligara7
Anthony Sligar (sligara7) merged commit d04f064 into NSLS2:pdf-profile-conversion Oct 23, 2026
4 checks passed
@sligara7
Anthony Sligar (sligara7) deleted the pdf-conv-04d-filter-bank branch October 23, 2026 22:28
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