From ec6a7a4576dcc70a0d8ebb48b8de50cb455f06c2 Mon Sep 17 00:00:00 2001 From: supermerill Date: Sun, 15 Nov 2020 02:09:33 +0100 Subject: [PATCH] fix layer_time --- src/libslic3r/GCode.cpp | 2 +- src/libslic3r/GCode/GCodeProcessor.cpp | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index 0fe2bccc0..df5760214 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -2380,7 +2380,7 @@ void GCode::process_layer( #if ENABLE_GCODE_VIEWER // add tag for processor - gcode += "; " + GCodeProcessor::Layer_Change_Tag + "\n"; + gcode += ";" + GCodeProcessor::Layer_Change_Tag + "\n"; // export layer z char buf[64]; sprintf(buf, ";Z:%g\n", print_z); diff --git a/src/libslic3r/GCode/GCodeProcessor.cpp b/src/libslic3r/GCode/GCodeProcessor.cpp index bd8664e61..d911a3f30 100644 --- a/src/libslic3r/GCode/GCodeProcessor.cpp +++ b/src/libslic3r/GCode/GCodeProcessor.cpp @@ -394,10 +394,11 @@ void GCodeProcessor::TimeProcessor::post_process(const std::string& filename) // check for temporary lines auto is_temporary_decoration = [](const std::string& gcode_line) { // remove trailing '\n' - std::string line = gcode_line.substr(0, gcode_line.length() - 1); - if (line == "; " + Layer_Change_Tag) - return true; - else + //std::string line = gcode_line.substr(0, gcode_line.length() - 1); + // Don't remove Layer_Change_Tag, it will render the layer_time view unusable + //if (line == "; " + Layer_Change_Tag) + // return true; + //else return false; };