ENH: modify the error information of gcode check

jira: none
Change-Id: Icccd17e110408f2fdb9890307139de0f9821f008
(cherry picked from commit 2ee87600cb6d1d09808447bb6ec996224d633905)
This commit is contained in:
zhimin.zeng 2024-10-14 09:57:49 +08:00 committed by Noisyfox
parent 1737829922
commit 3e9e9a1fa0
2 changed files with 13 additions and 2 deletions

View file

@ -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;
}

View file

@ -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<NotificationManager>(q))