Fix/scan panel user values #200

Merged
duan_j merged 8 commits from fix/scan-panel-user-values into main 2026-09-08 11:56:57 +02:00
Owner

Fix transmission/dtz being properly sourced from user or spreadsheet

Fix transmission/dtz being properly sourced from user or spreadsheet
leonarski_f added 4 commits 2026-09-08 10:15:39 +02:00
fix: keep user values in the scan panels across sample mounts
CI / lint (push) Skipped
CI / test (3.13) (push) Skipped
CI / test-with-beamline-plugins (pxi_bec) (push) Skipped
CI / test-with-beamline-plugins (pxii_bec) (push) Skipped
CI / test-with-beamline-plugins (pxiii_bec) (push) Skipped
CI / test (3.12) (push) Skipped
fd4b9b3122
The panels kept the effective detector distance, resolution and
transmission in their own attributes, and a sample change overwrote those
from the spreadsheet whatever the Database/User toggle said. The fields
went on showing the user's numbers while the scan request carried the
database ones, so a value had to be re-entered after every mount.

The fields are now the only place a value lives. Each setting is worth,
in order: what the user typed while "User values" is selected, what the
mounted sample asks for, the panel default - one rule, ScanSettingsPanel
._setting, that each panel spells out a line at a time. Overrides are per
setting, so a setting the user did not touch keeps following the sample.

Along the way:

* DbOverrideLineEdit is gone; the panels use NumberLineEdit directly, and
  the per-widget database/user bookkeeping is replaced by SampleParameters,
  the one place that knows the aareDB spreadsheet column names.
* The (name, widget, converter) mapping loops with getattr/hasattr are
  replaced by explicit per-field commit slots.
* The omega speed cap no longer drives one field's validator from another
  field's value: it is a read-out plus a check on the pair at Run time.
* _add_row/_add_pair_row build the label/field/unit rows, which also puts
  the Total angle degree sign on its own row instead of the header above.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JHoUkj66jxByS2ypY5h9Mn
fix: read the aareDB total angle from the column that exists
CI / lint (push) Skipped
CI / test (3.12) (push) Skipped
CI / test (3.13) (push) Skipped
CI / test-with-beamline-plugins (pxi_bec) (push) Skipped
CI / test-with-beamline-plugins (pxii_bec) (push) Skipped
CI / test-with-beamline-plugins (pxiii_bec) (push) Skipped
85e0609aa4
The column is totalangle, not totalrange, so reading it raised
AttributeError four times a second in the status loop.

Reading a spreadsheet cell now goes through _spreadsheet_float, which
treats a missing column, an empty cell and a cell that does not hold a
number all as "not set" and logs the column once. aareDB owns these
names; the GUI should fall back to its defaults when one moves, not die
on the status loop it is read from.

Note that the same misspelling is still in daq.py (spreadsheet_params
and get_auto_raster_params), where getattr's default hides it: automation
has never picked up the total angle from the spreadsheet either.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JHoUkj66jxByS2ypY5h9Mn
fix: read the aareDB transmission as the percentage it is
CI / lint (push) Skipped
CI / test-with-beamline-plugins (pxii_bec) (push) Skipped
CI / test-with-beamline-plugins (pxiii_bec) (push) Skipped
CI / test (3.12) (push) Skipped
CI / test (3.13) (push) Skipped
CI / test-with-beamline-plugins (pxi_bec) (push) Skipped
daabf830d7
DataCollectionParameters.transmission is a StrictInt documented as
"positive, between 0 and 100" (aareDB's own API description of the
spreadsheet payload), while every model that consumes it wants a 0-to-1
fraction. The old "divide by 100 only when above 1.0" guess therefore
turned a spreadsheet asking for 1% into a scan at 100% transmission -
a hundredfold dose on the sample. A fraction cannot be stored in that
column at all: the model rejects 0.2.

The mapping test now builds a real DataCollectionParameters instead of a
stand-in namespace, so a renamed column fails the test rather than the
beamline. That is what let 'totalrange' through.

daq.py's spreadsheet_params and get_auto_raster_params still carry both
the old column name and the same transmission guess.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JHoUkj66jxByS2ypY5h9Mn
revert: drop the ZMQ video change from this branch
CI / lint (push) Skipped
CI / test (3.12) (push) Skipped
CI / test (3.13) (push) Skipped
CI / test-with-beamline-plugins (pxii_bec) (push) Skipped
CI / test-with-beamline-plugins (pxiii_bec) (push) Skipped
CI / test-with-beamline-plugins (pxi_bec) (push) Skipped
CI / lint (pull_request) Canceled after 22s
CI / test (3.12) (pull_request) Canceled after 20s
CI / test-with-beamline-plugins (pxiii_bec) (pull_request) Canceled after 7s
CI / test (3.13) (pull_request) Canceled after 17s
CI / test (3.14) (pull_request) Canceled after 15s
CI / test-with-coverage (pull_request) Canceled after 5s
CI / test-with-beamline-plugins (pxi_bec) (pull_request) Canceled after 12s
CI / test-with-beamline-plugins (pxii_bec) (pull_request) Canceled after 10s
CI / coverage-analysis (pull_request) Canceled after 0s
179d4346ce
Committed by mistake in daabf83 - the video stream work was explicitly
put on hold and does not belong in this branch.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JHoUkj66jxByS2ypY5h9Mn
leonarski_f added 1 commit 2026-09-08 10:16:06 +02:00
Merge branch 'main' into fix/scan-panel-user-values
CI / lint (push) Skipped
CI / test (3.12) (push) Skipped
CI / test (3.13) (push) Skipped
CI / test-with-beamline-plugins (pxi_bec) (push) Skipped
CI / test-with-beamline-plugins (pxii_bec) (push) Skipped
CI / test-with-beamline-plugins (pxiii_bec) (push) Skipped
CI / lint (pull_request) Failing after 45s
CI / test (3.12) (pull_request) Failing after 1m3s
CI / test (3.13) (pull_request) Failing after 1m6s
CI / test (3.14) (pull_request) Failing after 1m4s
CI / test-with-beamline-plugins (pxi_bec) (pull_request) Failing after 1m7s
CI / test-with-beamline-plugins (pxii_bec) (pull_request) Failing after 1m11s
CI / test-with-beamline-plugins (pxiii_bec) (pull_request) Failing after 1m24s
CI / test-with-coverage (pull_request) Failing after 1m25s
CI / coverage-analysis (pull_request) Skipped
5d3972f20c
duan_j added 1 commit 2026-09-08 11:21:34 +02:00
fix: put Mount next in the automation row, gated to the Queued view
CI / lint (push) Skipped
CI / test (3.12) (push) Skipped
CI / test (3.13) (push) Skipped
CI / test-with-beamline-plugins (pxi_bec) (push) Skipped
CI / test-with-beamline-plugins (pxii_bec) (push) Skipped
CI / test-with-beamline-plugins (pxiii_bec) (push) Skipped
CI / lint (pull_request) Failing after 49s
CI / test (3.12) (pull_request) Failing after 1m1s
CI / test (3.13) (pull_request) Failing after 1m5s
CI / test (3.14) (pull_request) Failing after 1m9s
CI / test-with-beamline-plugins (pxi_bec) (pull_request) Failing after 1m9s
CI / test-with-beamline-plugins (pxii_bec) (pull_request) Failing after 1m10s
CI / test-with-beamline-plugins (pxiii_bec) (pull_request) Failing after 1m17s
CI / test-with-coverage (pull_request) Failing after 1m23s
CI / coverage-analysis (pull_request) Skipped
2fdb1952b6
The button was parented to the dewar tab but never added to a layout, so
Qt painted it at (0, 0) over the TELL sample changer banner. It now sits
left of Unmount in the automation row (docked and pop-out), greyed out
outside the Queued view like Remove/Clear. A trailing stretch keeps the
row's buttons at their natural width instead of sharing the spare space.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
duan_j added 1 commit 2026-09-08 11:35:29 +02:00
feat: show AUTO CENTERING in the sample camera view while a loop centering runs
CI / lint (push) Skipped
CI / test-with-beamline-plugins (pxiii_bec) (push) Skipped
CI / test (3.13) (push) Skipped
CI / test-with-beamline-plugins (pxi_bec) (push) Skipped
CI / test-with-beamline-plugins (pxii_bec) (push) Skipped
CI / test (3.12) (push) Skipped
CI / lint (pull_request) Failing after 1m2s
CI / test (3.12) (pull_request) Failing after 1m5s
CI / test (3.13) (pull_request) Failing after 1m10s
CI / test (3.14) (pull_request) Failing after 1m19s
CI / test-with-beamline-plugins (pxi_bec) (pull_request) Failing after 1m19s
CI / test-with-beamline-plugins (pxiii_bec) (pull_request) Failing after 1m20s
CI / test-with-beamline-plugins (pxii_bec) (pull_request) Failing after 1m25s
CI / test-with-coverage (pull_request) Failing after 1m25s
CI / coverage-analysis (pull_request) Skipped
2df433b33c
/status cannot tell an auto centering from a manual alignment move (both
are busy + SampleAlignment, the combo the overlay deliberately hides), so
the DAQ worker emits its own auto_centering flag: True while its own
/alc/center_loop POST is in flight (the endpoint blocks until done) or
while the automation progress reports the Center step running. The
sample camera views pass it to build_busy_overlay_style, which paints a
purple AUTO CENTERING wave text like the ROBOT MOUNTING/COOLING ones.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
duan_j added 1 commit 2026-09-08 11:53:27 +02:00
fix: take the aareDB transmission as the fraction aarecommon >= 0.7 declares
CI / lint (push) Skipped
CI / test (3.12) (push) Skipped
CI / test (3.13) (push) Skipped
CI / test-with-beamline-plugins (pxi_bec) (push) Skipped
CI / test-with-beamline-plugins (pxii_bec) (push) Skipped
CI / test-with-beamline-plugins (pxiii_bec) (push) Skipped
CI / lint (pull_request) Successful in 54s
CI / test (3.12) (pull_request) Successful in 59s
CI / test (3.13) (pull_request) Successful in 58s
CI / test (3.14) (pull_request) Successful in 1m0s
CI / test-with-beamline-plugins (pxii_bec) (pull_request) Successful in 1m7s
CI / test-with-beamline-plugins (pxi_bec) (pull_request) Successful in 1m9s
CI / test-with-beamline-plugins (pxiii_bec) (pull_request) Successful in 1m12s
CI / test-with-coverage (pull_request) Successful in 1m32s
CI / coverage-analysis (pull_request) Successful in 21s
2d0235071c
CI resolves aarecommon 0.7.3, where DataCollectionParameters.transmission
is a 0-to-1 fraction that rejects anything above 1.0 (the percent sheets
are converted inside AareDB >= 0.83, which main already requires). The
divide-by-100 from the earlier 'percentage' fix therefore failed the
model test on CI and would have turned 20% into 0.2% at the beamline.
Pass the fraction through and pin aarecommon>=0.7.3 so the older int
percentage model can no longer be installed; relock.

Also satisfy the diff typecheck gate: basedpyright only counts instance
variables assigned in __init__, so the Database/User toggle widgets are
created there and _build_source_toggle only lays them out.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

Coverage report (automated)

Total line + branch coverage: 50%
Diff coverage vs main: 90% (minimum 80%)

Full report: coverage artifact on this run.

Coverage report (automated) Total line + branch coverage: 50% Diff coverage vs main: 90% (minimum 80%) Full report: coverage artifact on this run.
duan_j merged commit f1cf55adb9 into main 2026-09-08 11:56:57 +02:00
Sign in to join this conversation.