Skip to content

feat/aligment-mode#1105

Merged
wyzula-jan merged 3 commits intomainfrom
feat/aligment-mode
Mar 26, 2026
Merged

feat/aligment-mode#1105
wyzula-jan merged 3 commits intomainfrom
feat/aligment-mode

Conversation

@wyzula-jan
Copy link
Copy Markdown
Contributor

@wyzula-jan wyzula-jan commented Mar 19, 2026

Description

Add alignment mode to the Waveform widget.

This introduces a new toolbar action that opens a dedicated alignment panel with:

  • embedded PositionerControlLine bound to the active x-axis positioner
  • embedded compact LMFitDialog showing existing DAP fits
  • Move action for fitted center
  • draggable target position line with Move To Target
  • live plot indicators for current motor position and target position
  • warning/status pill when the x axis is not a positioner or no DAP curve is available

The implementation adds dedicated alignment panel/controller utilities and wires them into Waveform. It also updates the compact LMFit dialog sizing so it embeds cleanly in the panel.

Related Issues

Type of Change

  • Add Waveform alignment mode UI and plot interaction
  • Add unit coverage for alignment panel, controller, and waveform integration

How to test

  • Open Waveform widget in the main app
  • Setup some curve with DAP curve
  • Click on the toolbar icon to activate alignment panel
  • Check fit parameters, use Move on center, activate target line, drag it, and move using Move To Target
  • Tweak the motor with the embedded positioner box and verify the current-position indicator follows
  • Remove the DAP curve or set the x mode to index / timestamp; the warning label should appear with instruction what to do to be able to use panel again

Additional Comments

Light-mode colors could still be tuned further; current readability is improved but could use another pass.

@wyzula-jan wyzula-jan self-assigned this Mar 19, 2026
@wyzula-jan wyzula-jan force-pushed the feat/aligment-mode branch 2 times, most recently from b51c85a to 3525a8d Compare March 19, 2026 12:36
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 19, 2026

@wyzula-jan wyzula-jan force-pushed the feat/aligment-mode branch 4 times, most recently from 65a7987 to b1f3c8e Compare March 20, 2026 13:57
@wyzula-jan wyzula-jan force-pushed the feat/aligment-mode branch 4 times, most recently from f5989b5 to c7aa285 Compare March 24, 2026 13:48
@wyzula-jan wyzula-jan marked this pull request as ready for review March 24, 2026 15:46
Copilot AI review requested due to automatic review settings March 24, 2026 15:46
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 introduces an “alignment mode” for the Waveform plot widget, adding a compact alignment panel plus plot overlays to support positioner-based alignment and fit-driven moves.

Changes:

  • Add alignment mode UI (toolbar toggle + top side panel) and wiring in Waveform.
  • Introduce WaveformAlignmentPanel (embedded positioner control + compact LMFit + target controls) and WaveformAlignmentController (marker/target overlays + action forwarding).
  • Add unit tests covering alignment mode behavior in Waveform, plus dedicated tests for the panel and controller; adjust LMFit compact dialog sizing behavior.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/unit_tests/test_waveform.py Adds integration-style tests for alignment mode toggling, positioner resolution, overlays, and DAP interactions.
tests/unit_tests/test_alignment_panel.py Adds unit tests validating alignment panel signal forwarding and fit-action filtering.
tests/unit_tests/test_alignment_controller.py Adds unit tests for controller overlay lifecycle, target bounds behavior, and move request emissions.
bec_widgets/widgets/plots/waveform/waveform.py Wires alignment mode into Waveform (toolbar bundle, side panel, context building, move handling, lifecycle hooks).
bec_widgets/widgets/plots/waveform/utils/alignment_panel.py New compact alignment panel widget (positioner control, compact LMFit, target controls, theme styling).
bec_widgets/widgets/plots/waveform/utils/alignment_controller.py New controller managing plot overlays and synchronizing panel state/actions.
bec_widgets/widgets/dap/lmfit_dialog/lmfit_dialog.py Improves size policies for the compact LMFit dialog when embedded.

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

Comment thread bec_widgets/widgets/plots/waveform/utils/alignment_controller.py Outdated
Comment thread bec_widgets/widgets/plots/waveform/waveform.py Outdated
@wyzula-jan wyzula-jan requested a review from a team March 24, 2026 16:15
@wyzula-jan wyzula-jan enabled auto-merge (rebase) March 24, 2026 16:16
@wyzula-jan wyzula-jan merged commit a292375 into main Mar 26, 2026
38 checks passed
@wyzula-jan wyzula-jan deleted the feat/aligment-mode branch March 26, 2026 11:24
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.

[AlignmentMode]: Positioner Fine Tuning

3 participants