ENH: optimize group logic for unprintable filaments

1.Also fix a tip mistake

jira: NONE

Signed-off-by: xun.zhang <xun.zhang@bambulab.com>
Change-Id: Ia52f95988d467a7018579a774376578b83e7ca05
(cherry picked from commit 804fe8d124e916f5957244913a50d24aceb621bd)
This commit is contained in:
xun.zhang
2025-03-18 21:37:14 +08:00
committed by Noisyfox
parent 542ddebbc5
commit f4445d0c04
3 changed files with 29 additions and 35 deletions

View File

@@ -10034,10 +10034,10 @@ void GLCanvas3D::_set_warning_notification(EWarning warning, bool state)
}
std::string extruder_name = extruder_name_list[extruder_id-1];
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();
text += (boost::format(_u8L("Filament %s 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 += (boost::format(_u8L("Filaments %s is placed in the %s, but the generated G-code path exceeds the printable range of the %s.")) %filaments %extruder_name %extruder_name).str();
}
}
error = ErrorType::SLICING_LIMIT_ERROR;
@@ -10070,7 +10070,7 @@ void GLCanvas3D::_set_warning_notification(EWarning warning, bool state)
std::string filaments;
int index = 0;
for (auto filament_id : filament_ids) {
if (index == 0) {
if (index > 0) {
filaments += ", ";
}
filaments += std::to_string(filament_id);
@@ -10087,9 +10087,9 @@ void GLCanvas3D::_set_warning_notification(EWarning warning, bool state)
}
std::string extruder_name = extruder_name_list[extruder_id-1];
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 height of the %s.")) % filaments % extruder_name % extruder_name).str();
text += (boost::format(_u8L("Filament %s is placed in the %s, but the generated G-code path exceeds the printable height 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 height of the %s.")) % filaments % extruder_name % extruder_name).str();
text += (boost::format(_u8L("Filaments %s is placed in the %s, but the generated G-code path exceeds the printable height of the %s.")) % filaments % extruder_name % extruder_name).str();
}
}
if (!text.empty()) {