From 350adb617681ecf2fb631340dbf2c538a2e0a1c6 Mon Sep 17 00:00:00 2001 From: "qing.zhang" Date: Fri, 17 Feb 2023 13:38:31 +0800 Subject: [PATCH] FIX: revert "FIX: fix adjust of cooling time" This reverts commit 9e026a289542545d5f63cd72fb9416be1521ecc2. This Revert "ENH: STUDIO-2221 adjust cooling time for each layer" This reverts commit eb1fa5975eb7dc3ff832539e9bec5a04515ff2f9. Change-Id: Iba8d0a1492b81922aad0d64df81c74cff5eabbb3 --- src/libslic3r/GCode/CoolingBuffer.cpp | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/src/libslic3r/GCode/CoolingBuffer.cpp b/src/libslic3r/GCode/CoolingBuffer.cpp index e7494bd40d..fe14a9e492 100644 --- a/src/libslic3r/GCode/CoolingBuffer.cpp +++ b/src/libslic3r/GCode/CoolingBuffer.cpp @@ -336,8 +336,7 @@ std::vector CoolingBuffer::parse_layer_gcode(const std:: // Index of an existing CoolingLine of the current adjustment, which holds the feedrate setting command // for a sequence of extrusion moves. size_t active_speed_modifier = size_t(-1); - bool layer_change = false; - bool layer_print = false; + for (; *line_start != 0; line_start = line_end) { while (*line_end != '\n' && *line_end != 0) @@ -348,23 +347,6 @@ std::vector CoolingBuffer::parse_layer_gcode(const std:: if (*line_end == '\n') ++ line_end; CoolingLine line(0, line_start - gcode.c_str(), line_end - gcode.c_str()); - - std::string prefix = ";" + Slic3r::GCodeProcessor::reserved_tag(GCodeProcessor::ETags::Layer_Change); - - if (boost::starts_with(sline, prefix)) { - layer_change = true; - layer_print = false; - continue; - } - - prefix = Slic3r::GCodeProcessor::reserved_tag(GCodeProcessor::ETags::Role); - std::string role = ExtrusionEntity::role_to_string(erWipeTower).c_str(); - if (layer_change && boost::starts_with(sline, ";" + prefix) && !boost::starts_with(sline, ";" + prefix + role)) { - layer_change = false; - layer_print = true; - continue; - } - if (boost::starts_with(sline, "G0 ")) line.type = CoolingLine::TYPE_G0; else if (boost::starts_with(sline, "G1 ")) @@ -447,7 +429,7 @@ std::vector CoolingBuffer::parse_layer_gcode(const std:: } line.feedrate = new_pos[4]; assert((line.type & CoolingLine::TYPE_ADJUSTABLE) == 0 || line.feedrate > 0.f); - if (line.length > 0 && layer_print) + if (line.length > 0) line.time = line.length / line.feedrate; line.time_max = line.time; if ((line.type & CoolingLine::TYPE_ADJUSTABLE) || active_speed_modifier != size_t(-1))