From 3e9e9a1fa0cb631f0744dfa4e1a1c2be2a090d86 Mon Sep 17 00:00:00 2001 From: "zhimin.zeng" Date: Mon, 14 Oct 2024 09:57:49 +0800 Subject: [PATCH] ENH: modify the error information of gcode check jira: none Change-Id: Icccd17e110408f2fdb9890307139de0f9821f008 (cherry picked from commit 2ee87600cb6d1d09808447bb6ec996224d633905) --- src/slic3r/GUI/GLCanvas3D.cpp | 13 ++++++++++++- src/slic3r/GUI/Plater.cpp | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index 8097a8a08c..dc07cfe63e 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -9708,6 +9708,9 @@ void GLCanvas3D::_set_warning_notification(EWarning warning, bool state) case EWarning::ToolpathOutside: text = _u8L("A G-code path goes beyond the plate boundaries."); error = ErrorType::SLICING_ERROR; break; case EWarning::MultiExtruderPrintableError: { text.clear(); + int master_extruder_id = 0; // main extruder is left or right + if (m_config->has("master_extruder_id")) + master_extruder_id = m_config->opt_int("master_extruder_id") - 1; for (auto error_iter = m_gcode_viewer.m_gcode_check_result.error_infos.begin(); error_iter != m_gcode_viewer.m_gcode_check_result.error_infos.end(); ++error_iter) { if (error_iter != m_gcode_viewer.m_gcode_check_result.error_infos.begin()) { text += "\n"; @@ -9720,8 +9723,16 @@ void GLCanvas3D::_set_warning_notification(EWarning warning, bool state) } filaments += std::to_string(error_iter->second[i] + 1); } - text += (boost::format(_u8L("Extruder %d conflicts with filaments: %s.")) %extruder_id %filaments).str(); + std::string extruder_name = extruder_id == master_extruder_id ? "Left extruder" : "Right extruder"; + if (error_iter->second.size() == 1) { + text += (boost::format(_u8L("Filament %d is placed in the %s, but the generated G-code path exceeds the printable range of the %s.")) %filaments %extruder_name %extruder_name).str(); + } + else { + text += (boost::format(_u8L("Filaments %d is placed in the %s, but the generated G-code path exceeds the printable range of the %s.")) %filaments %extruder_name %extruder_name).str(); + } } + text += "\n"; + text += _u8L("Open wiki for more information."); error = ErrorType::SLICING_ERROR; break; } diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 39493fcdaf..3333ff6f85 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -3114,7 +3114,7 @@ Plater::priv::priv(Plater *q, MainFrame *main_frame) "wipe_tower_rotation_angle", "wipe_tower_cone_angle", "wipe_tower_extra_spacing", "wipe_tower_extra_flow", "wipe_tower_max_purge_speed", "wipe_tower_wall_type", "wipe_tower_extra_rib_length","wipe_tower_rib_width","wipe_tower_fillet_wall", "wipe_tower_filament", - "best_object_pos", "extruder_change_length" + "best_object_pos", "extruder_change_length", "master_extruder_id" })) , sidebar(new Sidebar(q)) , notification_manager(std::make_unique(q))