From 4bb6525c4ffdbcc0446a96d67d608db6743bd6f2 Mon Sep 17 00:00:00 2001 From: Noisyfox Date: Thu, 24 Oct 2024 21:27:03 +0800 Subject: [PATCH] Fix issue that `total_time` is not updated after slowing down --- src/libslic3r/GCode/CoolingBuffer.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/libslic3r/GCode/CoolingBuffer.cpp b/src/libslic3r/GCode/CoolingBuffer.cpp index 2197428bc0..e88f3b38f1 100644 --- a/src/libslic3r/GCode/CoolingBuffer.cpp +++ b/src/libslic3r/GCode/CoolingBuffer.cpp @@ -151,6 +151,7 @@ struct PerExtruderAdjustments } time_total += line.time; } + this->time_total = time_total; return time_total; } // Slow down each adjustable G-code line proportionally by a factor. @@ -166,6 +167,7 @@ struct PerExtruderAdjustments } time_total += line.time; } + this->time_total = time_total; return time_total; } @@ -204,6 +206,7 @@ struct PerExtruderAdjustments // Used by non-proportional slow down. void slow_down_to_feedrate(float min_feedrate) { assert(this->slow_down_min_speed < min_feedrate + EPSILON); + float time_total = 0.f; for (size_t i = 0; i < n_lines_adjustable; ++ i) { CoolingLine &line = lines[i]; if (line.feedrate > min_feedrate) { @@ -211,7 +214,9 @@ struct PerExtruderAdjustments line.feedrate = min_feedrate; line.slowdown = true; } + time_total += line.time; } + this->time_total = time_total; } // Extruder, for which the G-code will be adjusted.