Repository navigation
Conversation
15ab845 to
397b50b
Compare
397b50b to
4b72dd2
Compare
4b72dd2 to
61bb134
Compare
|
@switch87 Nice one! I have not run it on my laser yet (might try later this week), but I did run your PR without machine to try your new function. Would it be an idea to make the Method "Z- axis steps" the default if the machine definition indicates it supports a z-axis? Of course just a nice to have, but I think it would make sense. |
61bb134 to
73ca5b7
Compare
|
@atkaper Good idea, done in 73ca5b7. The method list was already ordered by preference (Z axis steps, manual, ramp) and only contains what the machine supports, but the dialog started on the manual method regardless. It now starts on the first available method, so a machine with a Z axis and a G-code driver opens on Z axis steps. A UI test covers it, and the docs say which method is the default. Also rebased onto current main. |
|
Super! I will try this one later this week! |
|
Dropped the laser_essentials .po/.pot changes from this PR, following your rule of one catalog update before each release; the new strings are still wrapped in |
30c1f09 to
c6814ed
Compare
|
I went over this again against the rest of the code base and pushed two small follow-up commits on top, no force-push:
I also corrected the PR description, which described the ramp and the Interval Test wrongly. |
|
Thank you for this PR! In testing I noticed some issues:
Proposed next phases
Specific design proposal for phase 1 (AI generated but reviewed)
Out of scope (deferred by design): interactive filter editing in the UI, multi-select semantics beyond what generators set. |
|
(I will draft a PR for phase 1, as that was a pre-existing mess so I will clean this up.) |
|
Thanks for testing it this thoroughly and for the detailed plan. I agree on all three points, and the workpiece filter is a much cleaner base than I'll leave phase 1 to you then. Meanwhile I'll write the phase 2 plan, refactoring the Material Test Grid generator so the three tests share one architecture and one UX (dedicated layer, dialog opens immediately and doesn't hide the test, per-cell editable result), and post it here for review before writing any code. I've turned this PR back into a draft so it doesn't sit in your review queue; phase 3 will rebuild these generators on top of the cleaned-up code, including the screenshot targets for the docs. |
Phase 2 plan: one generator architecture for all calibration testsThis plan starts after your phase 1 ( Where things stand today
What all three tests share: a parameter VarSet, a row or grid layout with labels, an ordered list of "cell = workpiece + step" entries (sometimes with commands in between), placement on the work area, one undo entry, and regeneration when a parameter changes. Target shape (all in
|
The values every cell or line of the two new calibration tests is made with: evenly spread line intervals (with their LPI) and focus offsets, the row layout, and the commands the Focus Test puts between its lines: an M0 pause in manual mode, or relative Z moves (G91/G0 Z/G90) that end at the starting height, honouring Reverse Z. Offsets are limited to +/-10 mm. Refs barebaric#519
CalibrationTestCmd creates each test as its own layer. Every cell or line is a vector workpiece with its own step, linked through generated_workpiece_uid like the Material Test Grid, so it stays editable. Interval cells are Engrave steps with constant power and their own line interval; focus lines are Contour steps, with Command steps in between for the manual and Z axis modes. Labels share one workpiece and one low-power contour step that runs first. The test is centered on the work area and added in one undoable step. Golden G-code tests cover the interval pitch per cell, the M0 pauses (always after M5) and the balanced Z moves. Refs barebaric#519
Each entry opens a dialog for the settings, with unit-aware lengths and speeds capped at the machine's maximum. The Focus Test dialog only offers the methods the machine supports and explains the procedure for the chosen one. Refs barebaric#519
The method list is already ordered by preference (Z axis steps, manual, ramp) and only holds what the machine supports, so the dialog now starts on its first entry instead of the manual method. Refs barebaric#519
The Focus Test imported the private _driver_uses_gcode helper from the pipeline's intent builder. Resolve the driver class with get_driver_cls, the same way Machine does, so the addon no longer depends on pipeline internals. Refs barebaric#519
The Interval and Focus Test dialogs assembled their rows by hand, with spin rows for power. Declare the fields as VarSets and render them with VarSetWidget, like the Material Test Grid settings: power is now the usual percent slider, speed limits come from the machine through the speed adapter, and visibility and sensitivity use visible_when and sensitive_when. The dialog is as wide as the step settings dialog, and the existing label strings are reused. Refs barebaric#519
Carry the sentence about the dialog starting on the first supported method into every translated Interval and Focus Tests page. Refs barebaric#519
row_for() returns an Adw.PreferencesRow, which has no set_selected, so pyright rejected the call that switches the dialog to RAMP.
7e93efc to
2e5dc9e
Compare
Step.generated_workpiece_uid became a legacy serialization key: the grid and calibration steps now link to their workpiece through workpiece_uids, and nothing reads the old attribute anymore. Assigning it left the interval and focus test steps unlinked after a reload. Fixes the pyright error and the failing backend tests on this branch after the rebase onto main.
|
This pull request was closed automatically because its description does not follow the pull request template. Problems found:
Please edit the pull request description to answer every section and to tick every checkbox; as soon as it complies, the pull request is reopened automatically. See CONTRIBUTING.md. |
|
Sorry, bot went wild. Tried to reopen and that is also blocked... ugh. Checking what can be done. |
Summary
Add Interval Test and Focus Test generators to the Tools menu. Both
create an ordinary layer with workpieces and steps, as discussed in #519.
Fixes #519. Closes #550.
What's in this PR
Test, each opening a small parameters dialog built from VarSets.
linked through
generated_workpiece_uid, with line intervals spread evenlyfrom the smallest to the largest value, at one power and speed. Labels show
the interval in mm and LPI and are engraved by one low-power Contour step.
Methods: Z axis steps (relative
G91/G0 Z/G90Command steps, back to thestart height at the end; only with a Z axis), manual (
M0Command stepbefore each line) and ramp (one long line with 10 mm ticks for a tilted
strip, no machine support needed). Z and manual need a G-code driver and the
Command step. The dialog starts on the first available method, so machines
with a Z axis get Z axis steps (Focus Test: default the Method to "Z axis steps" when the machine has a Z axis #550).
Tests
tests/doceditor/test_calibration_tests.py: generated layers, steps,available methods and GRBL G-code for both tests.
rayforge-addon-laser/tests/test_calibration_test_params.py: parametervalidation and layout values.
rayforge-addon-laser/tests/ui_gtk/test_calibration_test_dialogs.py: theparameter dialogs.