feat(multipoint): add Prev and Set XY to the flexible multipoint tab - #617
Open
jsschwrz wants to merge 1 commit into
Open
feat(multipoint): add Prev and Set XY to the flexible multipoint tab#617jsschwrz wants to merge 1 commit into
jsschwrz wants to merge 1 commit into
Conversation
Stepping through the position list was one-way. Next had no counterpart, and only Z could be corrected on a point already in the list, so fixing a slightly off XY meant deleting the point and adding it again. Nothing on the scan grid said which rectangle belonged to which list entry either, so pressing Next gave no feedback about where in the list you had landed. Prev takes half of Next's cell and walks the list backwards, wrapping the way Next already does. btn_previous and previous() turned out to exist already, and to be connected already - they had simply never been added to a layout. previous() now guards the empty list, and treats "nothing selected" as the last entry rather than letting (index - 1) % N skip quietly to the second to last. Set XY takes half of the Update Z cell; both buttons are renamed to fit side by side. It re-tiles the region at the current stage position through the same add_flexible_region* calls add_location and cell_was_changed use, erasing the old rectangles first, and leaves Z to Set Z. update_z picked up the same empty-list guard and now writes the table's z cell, which it had been skipping. Both share one location-string helper, so the dropdown text no longer depends on which button wrote it. NavigationViewer numbers each position 1..N by list order and highlights the selected one, outlining every FOV of its region so the mark is right for any NxN grid. The numbers are pg.TextItems rather than text baked into the overlay: they stay upright and legibly sized whatever the zoom, and are unaffected by the ViewBox's invertX, which is set on builds where the objective is not inverted. clear_overlay drops them, so the tab-switch path that already clears regions cleans up the labels on its own. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a Prev button and a Set XY button to the Flexible Multipoint tab, and numbers the positions on the scan grid.
Why
Stepping through the position list was one-way —
Nexthad no counterpart. And only Z could be corrected on a point already in the list, so fixing a slightly off XY meant deleting the point and adding it again. Nothing on the scan grid indicated which rectangle belonged to which list entry, so pressingNextgave no feedback about where you had landed.What changed
Prev takes half of
Next's cell and walks the list backwards, wrapping the wayNextalready does.btn_previousandprevious()turned out to already exist, and to already be connected — they had simply never been added to a layout.previous()now guards the empty list, and treats "nothing selected" as the last entry rather than letting(index - 1) % Nskip quietly to the second to last.Set XY takes half of the
Update Zcell; both buttons are renamed to fit side by side. It re-tiles the region at the current stage position through the sameadd_flexible_region*calls thatadd_locationandcell_was_changeduse, erasing the old rectangles first, and leaves Z toSet Z.update_zpicked up the same empty-list guard (previously a click with an empty list wrote tolocation_list[-1]) and now writes the table's z cell, which it had been skipping. Both buttons share one location-string helper, so the dropdown text no longer depends on which button wrote it.Numbered positions.
NavigationViewerlabels each position1..Nby list order and highlights the selected one, outlining every FOV of its region so the mark is correct for any NxN grid. The numbers arepg.TextItems rather than text baked into the overlay: they stay upright and legibly sized at any zoom, and are unaffected by the ViewBox'sinvertX, which is set on builds where the objective is not inverted.clear_overlaydrops them, so the tab-switch path that already clears regions cleans up the labels on its own.Testing
upstream/masterate86a608fgives 1518 passed, 13 failed, and this branch's failures are a strict subset. The one extra failure on master (test_job_completion_decrements_backpressure_counters) is flaky and passes in isolation.Set XYre-tiling while leaving Z alone, overlap vs step-size modes, labels renumbering after a deletion, and the highlight tracking selection. Happy to include them in this PR if wanted — they are not committed here.PrevandNextmeasure 87px each and together span exactly the 180pxNextalone used to hold;Set XY/Set Zshare the right end and still align withClear's edge.NavigationViewer: scan boxes drawn with the selected one highlighted, labels confirmed as['1','2','3','4']with only the current one bold, andclear_overlay()drops them to zero.One caveat: the offscreen Qt platform used for these checks does not rasterize glyphs (button text renders blank too), so while the label objects are verified correct in text, color, boldness and position, the drawn numbers have not been visually confirmed on a real display.
🤖 Generated with Claude Code