From c03a9d1a3ed75eb589b21b9dae4340ecb6caa040 Mon Sep 17 00:00:00 2001 From: enricoturri1966 Date: Thu, 25 May 2023 13:42:42 +0200 Subject: [PATCH] Follow-up of 2424f9826fd13a4f5174067d6c417468bdf45284 - Fixed the fix in GCodeProcessor.cpp --- src/libslic3r/GCode/GCodeProcessor.cpp | 44 +++++++++++++------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/src/libslic3r/GCode/GCodeProcessor.cpp b/src/libslic3r/GCode/GCodeProcessor.cpp index 6cfeda4cb..51e4c88c1 100644 --- a/src/libslic3r/GCode/GCodeProcessor.cpp +++ b/src/libslic3r/GCode/GCodeProcessor.cpp @@ -3922,29 +3922,29 @@ void GCodeProcessor::post_process() if (m_print != nullptr) m_print->active_step_add_warning(PrintStateBase::WarningLevel::CRITICAL, warning); } - export_lines.insert_lines(backtrace, cmd, - // line inserter - [tool_number, this](unsigned int id, float time, float time_diff) { - int temperature = int( m_layer_id != 1 ? m_extruder_temps_config[tool_number] : m_extruder_temps_first_layer_config[tool_number]); - const std::string out = "M104 T" + std::to_string(tool_number) + " P" + std::to_string(int(std::round(time_diff))) + " S" + std::to_string(temperature) + "\n"; - return out; - }, - // line replacer - [this, tool_number](const std::string& line) { - if (GCodeReader::GCodeLine::cmd_is(line, "M104")) { - GCodeReader::GCodeLine gline; - GCodeReader reader; - reader.parse_line(line, [&gline](GCodeReader& reader, const GCodeReader::GCodeLine& l) { gline = l; }); - - float val; - if (gline.has_value('T', val) && gline.raw().find("cooldown") != std::string::npos && m_is_XL_printer) { - if (static_cast(val) == tool_number) - return std::string("; removed M104\n"); - } - } - return line; - }); } + export_lines.insert_lines(backtrace, cmd, + // line inserter + [tool_number, this](unsigned int id, float time, float time_diff) { + int temperature = int( m_layer_id != 1 ? m_extruder_temps_config[tool_number] : m_extruder_temps_first_layer_config[tool_number]); + const std::string out = "M104 T" + std::to_string(tool_number) + " P" + std::to_string(int(std::round(time_diff))) + " S" + std::to_string(temperature) + "\n"; + return out; + }, + // line replacer + [this, tool_number](const std::string& line) { + if (GCodeReader::GCodeLine::cmd_is(line, "M104")) { + GCodeReader::GCodeLine gline; + GCodeReader reader; + reader.parse_line(line, [&gline](GCodeReader& reader, const GCodeReader::GCodeLine& l) { gline = l; }); + + float val; + if (gline.has_value('T', val) && gline.raw().find("cooldown") != std::string::npos && m_is_XL_printer) { + if (static_cast(val) == tool_number) + return std::string("; removed M104\n"); + } + } + return line; + }); } };