From 212f81446c20e0f774f20137f9a0a526a569b6a4 Mon Sep 17 00:00:00 2001 From: Clifford Garwood Date: Sat, 25 Apr 2026 00:42:51 -0400 Subject: [PATCH] refactor(imex): convert remaining "primary" literals in GCodeViewer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/slic3r/GUI/GCodeViewer.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/slic3r/GUI/GCodeViewer.cpp b/src/slic3r/GUI/GCodeViewer.cpp index 86c27d88be..4259f7a9dd 100644 --- a/src/slic3r/GUI/GCodeViewer.cpp +++ b/src/slic3r/GUI/GCodeViewer.cpp @@ -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("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("imex_mode_names"); auto* active_tools_opt = printer_cfg.opt("imex_mode_active_tools");