Resolve the IMEX mode the same way everywhere it is read

A plate can carry its own parallel mode, or leave it on Primary and inherit the
process preset's. set_imex_mode() erases the key on Primary precisely so the
preset's value survives the config merge, and the slicer honors it: Print::validate()
and the G-code path both read the merged object config, so such a plate slices, and
emits, in the preset's mode.

Three places that describe that plate did not resolve it the same way. They read
the plate's own value and stopped, so on a plate left at Primary:

  the multi-material conflict badge stayed dark on a plate validate() will refuse,
  which is the one invariant the comment above it claims to keep;
  the bed-temperature and filament-type warnings never ran, so the job went out in
  copy or mirror with a mismatched bed and no notice;
  the plate tooltip reported Primary for a plate about to print in another mode.

The geometric badge beside the first of those already resolved correctly, because
it goes through the zone layout, so one badge fired while its neighbour stayed
dark on the same plate.

The fallback had been written out by hand four times. Three are now collapsed onto
one accessor, get_effective_imex_mode(); the fourth is in libslic3r, which cannot
call a GUI method and resolves the two modes itself from arguments. The remaining
callers of the raw get_imex_mode() want the raw value and keep it: the accessor
itself, the zone layout call that passes both modes separately, the mode menu and
the left-click cycle, which act on what the plate stores, and the reset that looks
for plates whose own mode was removed.

The tooltip is the one place the two readings meet. It headlines the stored mode,
because it sits on the button whose menu and click act on that value, and names
the inherited mode after it when they differ -- so one control no longer says
three different things while still telling the user what will actually print.

Reachability, honestly: nothing in the UI writes the process preset's copy today,
so this needs a hand-edited preset, a vendor process profile or a project that
carries one. It is latent rather than live -- and it stops being latent the moment
a process-level mode selector exists. Note the key lives in the process preset, so
one value there would govern every Primary plate in every project using it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Clifford Garwood
2026-09-30 20:54:17 -04:00
co-authored by Claude Opus 5
parent 8350bac123
commit a3eccdc8b7
4 changed files with 51 additions and 18 deletions
+3 -1
View File
@@ -13352,7 +13352,9 @@ static std::vector<wxString> collect_imex_warnings(PartPlate* plate)
// was dropped. Bed-temp + filament-type checks below remain useful soft
// warnings — they catch user configurations that *will* slice but produce
// problematic gcode.
const std::string mode = plate->get_imex_mode();
// Resolved: a plate on Primary still slices in the process preset's mode, and these
// bed-temperature and filament-type warnings are the only notice the user gets.
const std::string mode = plate->get_effective_imex_mode();
if (mode == kImexPrimaryMode) return warnings;
PresetBundle* bundle = wxGetApp().preset_bundle;