refactor(imex): convert remaining "primary" literals in GCodeViewer

Follow-up to 085f5ccec8. Self-review of that commit's grep output missed
GCodeViewer.cpp. Three sites in the layer-preview multi-carriage marker
logic still compared against the bare "primary" literal:

  - GCodeViewer.cpp:1538 — process-preset mode default
  - GCodeViewer.cpp:1542 — per-plate mode override gate
  - GCodeViewer.cpp:1551 — secondary marker computation gate

All three now use kImexPrimaryMode. The file already includes
IMEXHelpers.hpp (line 13) so no new include needed.

Verified by grepping the full IMEX-touching set: only IMEXHelpers.hpp
itself (the constant definition) still references the literal string,
which is correct.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Clifford Garwood
2026-04-25 00:42:51 -04:00
co-authored by Claude Opus 4.7
parent 7dcb74e504
commit 212f81446c
+3 -3
View File
@@ -1535,11 +1535,11 @@ void GCodeViewer::render(int canvas_width, int canvas_height, int right_margin)
if (is_imex_opt && is_imex_opt->value) {
const DynamicPrintConfig& process_cfg = preset_bundle->prints.get_edited_preset().config;
auto* mode_opt = process_cfg.opt<ConfigOptionString>("imex_parallel_mode");
std::string mode = mode_opt ? mode_opt->value : "primary";
std::string mode = mode_opt ? mode_opt->value : kImexPrimaryMode;
// Per-plate mode overrides the process preset.
if (auto* plate = wxGetApp().plater()->get_partplate_list().get_curr_plate()) {
std::string plate_mode = plate->get_imex_mode();
if (plate_mode != "primary")
if (plate_mode != kImexPrimaryMode)
mode = plate_mode;
}
@@ -1548,7 +1548,7 @@ void GCodeViewer::render(int canvas_width, int canvas_height, int right_margin)
m_imex_last_mode = mode;
}
if (!mode.empty() && mode != "primary") {
if (!mode.empty() && mode != kImexPrimaryMode) {
auto* mode_names_opt = printer_cfg.opt<ConfigOptionStrings>("imex_mode_names");
auto* active_tools_opt = printer_cfg.opt<ConfigOptionStrings>("imex_mode_active_tools");