Repository navigation
Conversation
The last comment on PR #539 asked for the concept of test layers: the calibration tests are layers, so their settings belong with the other layer settings, and their layers should not take other workpieces. Layers now carry a layer type, saved with the project. Addons register what their types mean in a new core registry: a title, an icon and whether the layer accepts other workpieces. Addons also contribute sections to the layer settings dialog through a new UI registry, so a kind of layer brings its own settings into the dialog. The laser addon uses this for the calibration tests. Creating a test now opens the settings dialog of its layer, where its parameters appear under Test Settings and every change still rebuilds the test in one undo entry. The card in the item properties panel points to the dialog, with an Open Layer Settings button, and creation selects the test as before. The settings edit loop moved into a controller shared by the dialog section. The test's layer is registered as a Calibration Test layer and locked: paste, import, duplicate, array and drag-and-drop refuse to place other workpieces in it, with a notification explaining why. Moving a cell out of the test or deleting one stays possible, and steps added to the layer keep surviving rebuilds. Legacy Material Test Grids have no layer type yet and keep behaving as before until their first parameter change; projects saved by older versions open unchanged. The calibration docs, in every language, and the test screenshots describe the new settings location and the locked layers.
Creating a test no longer opens the settings dialog: it appeared exactly over the new test and hid it, and GTK4 offers no say in where a dialog lands. The card in the item properties panel is the way in. The card is now a proper action row, and the first row of the item properties: an activatable Open Layer Settings row whose subtitle explains what the workpiece is, with a chevron like the other navigating rows. It no longer floats as its own box. The layer settings dialog stops growing with its content and scrolls instead, and its Test Settings group drops the subtitle that repeated the dialog title. The screenshots show the compact dialog.
This branch was successfully deployed
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.
Resolves the follow-ups named in the last comment on PR #539:
What changes
Layer types (core).
Layergains alayer_typestring that is saved with the project. Addons register what their kinds of layers mean in a new core registry (rayforge/core/layer_types.py): a title, an icon and whether the layer accepts other workpieces. Unknown or empty types behave like ordinary layers, so projects open with or without the generating addon, and files saved by older versions load unchanged.Settings in the layer dialog (UI). Addons can contribute sections to the
LayerSettingsDialogthrough a new registry (layer_settings_sections.py), mirroring the property-provider pattern including cleanup on addon unload. Each section decides per layer whether it applies.Calibration tests (laser addon).
calibration_teston its layer and registers it as a locked kind. The layer's settings dialog shows the test's parameters under Test Settings (help/warning/error/note rows plus the generator VarSet), above General and Rotary.CalibrationSettingsController, shared by the dialog section; the item-properties Test Settings card is now a slim pointer with an Open Layer Settings button (and the scroll-into-view behavior is kept), which resolves the discoverability complaint.record_for_layerfinds a test's record by layer uid, including the legacy derivation for pre-feat: add Interval Test and Focus Test generators to the Tools menu #539 Material Test Grids, so their settings also show in the dialog.Locked layers. Paste, import, duplicate, array and drag-and-drop refuse to place other workpieces into a locked layer, with a notification (
layer_cmd,edit_cmd,array_cmd, and the layer column's drop targets show the no-drop cursor). Moving a cell out of a test, deleting one, or adding operations to the layer still works, as the rebuild logic supports today.Tests
tests/core/test_layer_types.py, layer-type serialization tests, locked-layer guards intest_layer_cmd.py/test_edit_cmd.py,record_for_layer(incl. legacy) intest_calibration_tests.py.test_calibration_provider.py(controller + section + slim card) and the main-window teststests/ui_gtk/doceditor/test_calibration_test_settings.py(dialog opens on create, edits in the dialog rebuild and keep the selection).pixi run test7902 passed,pixi run uitest1292 passed (run under Xvfb).Docs
interval-and-focus-tests.mdandmaterial-test-grid.mdupdated in all 7 languages, the three test screenshots regenerated (they now show the layer settings dialog), and a changelog entry added.