Machine Filament combo: create-and-link a proper preset for unmatched entries - #823
Open
studiofuga wants to merge 3 commits into
Open
Machine Filament combo: create-and-link a proper preset for unmatched entries#823studiofuga wants to merge 3 commits into
studiofuga wants to merge 3 commits into
Conversation
…ries greyed out The name-matching filter in the "Machine Filament" section of the filament combo box silently dropped entries reported by the remote printer whenever their name didn't exactly match a local preset name (and required is_compatible on top of that). Comment it out for now and, when no matching local preset is found, still show the entry using the machine's own filament name, rendered greyed out and non-selectable via the existing LABEL_ITEM_DISABLED marker, instead of hiding it outright.
Add a per-item 'muted' text colour to the custom ComboBox/DropDown widgets (the actual base of PresetComboBox — not wxBitmapComboBox), kept in sync alongside texts/icons/clientData through Append/DoClear/DoDeleteOneItem/DoInsertItems, with a public SetItemMuted()/IsItemMuted() API. DropDown's row renderer now paints muted rows in a light grey (dark-mode aware via StateColor::darkModeColorFor) instead of the normal text colour. 'Machine Filament' entries in PlaterPresetComboBox/TabPresetComboBox with no matching local preset now use the same indexed clientData as matched entries (so they're fully clickable through the normal update_ams_color()/on_select_preset() flow) and are marked muted instead of being hidden or disabled.
… entries
Clicking a muted "Machine Filament" entry (no local preset match) now
opens the "Create Filament" wizard instead of guessing/loading a
possibly-wrong preset:
- Plater.cpp: on_select_unmatched_machine_filament() reverts the combo
to whatever was actually active (nothing was applied by the click),
parses vendor/type/serial back out of the machine's reported
"<vendor> <type>[ <sub_type>]" string, and opens
CreateFilamentPresetDialog pre-filled with that plus the closest
known filament family. On success, persists a vendor+type ->
created-preset-name link in AppConfig ("machine_filament_presets"
section) so future readings of the same filament resolve to it
directly.
- PresetComboBoxes.cpp: ResolveMachineFilamentPreset()/-ForSlot() now
matches machine filaments to local presets via (in order) the
persisted link above, an exact historical name match, then a
"<vendor> <type>" prefix match — all gated on the resolved preset
actually being is_compatible with the current printer/nozzle, so a
preset that exists for the wrong nozzle no longer shows as a dead,
unselectable match; it stays muted so re-clicking can add the
missing nozzle variant instead.
- CreatePresetsDialog.cpp/.hpp: prefill_from_machine_filament() fills
in vendor/type/serial, selects the "Generic <type>" family
deterministically (previously could land on an unrelated family like
"... High Speed" due to unordered_map iteration order), and
auto-checks the printer/nozzle-diameter entry matching the current
printer. get_all_visible_printer_name() also includes every
nozzle-size variant of the printer *model* currently active for the
project, not just printer presets explicitly marked visible.
get_all_filament_presets() no longer skips filament presets that
aren't marked is_visible — that flag tracks the user's main filament
picker and doesn't apply here; it was hiding brand-new system
presets (e.g. a nozzle size just added to the vendor pack) from this
dialog's grid entirely. Added an "All nozzle" checkbox to
bulk (de)select every entry in the grid at once, and made the dialog
resizable (wxRESIZE_BORDER) since the grid can now list every
compatible nozzle instead of just one.
- Widgets/DropDown.cpp: drop a stale assert in SetSelection() that the
very next line already handles gracefully (index gets clamped to -1
instead of crashing a Debug build).
Author
|
This is particularly useful when using OpenSpool RFIDs with new filaments. If you already have a suitable filament profile, but they don't match (based on name, serial or other issues), you can simply use the suitable profile as a base. Match done! |
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.
What
When the remote printer reports a filament for which no local preset matches by name, the "Machine Filament" combo used to either silently hide the entry, or (in an earlier iteration of this work) show it greyed-out but load a wrong/guessed preset when clicked. This PR makes that click actually useful:
Commits
Machine Filament combo: disable name-match filter, show unmatched entries greyed out— stop silently dropping machine filaments whose reported name doesn't exactly match a local preset; show them muted instead.Machine Filament combo: make unmatched entries clickable, muted grey— add a per-item muted/light-grey rendering to the ComboBox/DropDown widgets, keep unmatched entries clickable.Machine Filament combo: create-and-link a proper preset for unmatched entries— clicking an unmatched entry opens "Create Filament" pre-filled from the machine reading; successful creation is persisted as an explicit machine→preset link; matching is nozzle/printer-compatibility aware.Testing
Built and manually tested against a Snapmaker U1 printer reporting filaments with no matching local preset, across several rounds of iteration (vendor/type/serial prefill, nozzle-diameter matching, family selection, printer visibility).