From 5baee8a1cb485f4d20f76def55195d0422ac751e Mon Sep 17 00:00:00 2001 From: Joseph Lenox Date: Sun, 5 Aug 2018 22:27:36 -0500 Subject: [PATCH] Cooling buffer works in cppgui --- src/test/libslic3r/test_printgcode.cpp | 3 +++ xs/src/libslic3r/PrintGCode.cpp | 2 ++ 2 files changed, 5 insertions(+) diff --git a/src/test/libslic3r/test_printgcode.cpp b/src/test/libslic3r/test_printgcode.cpp index ee669d01a..34c529ed6 100644 --- a/src/test/libslic3r/test_printgcode.cpp +++ b/src/test/libslic3r/test_printgcode.cpp @@ -45,6 +45,9 @@ SCENARIO( "PrintGCode basic functionality") { REQUIRE(exported.find("; support material extrusion width") == std::string::npos); REQUIRE(exported.find("; first layer extrusion width") == std::string::npos); } + THEN("Exported text does not contain cooling markers (they were consumed)") { + REQUIRE(exported.find(";_EXTRUDE_SET_SPEED") == std::string::npos); + } THEN("GCode preamble is emitted.") { REQUIRE(exported.find("G21 ; set units to millimeters") != std::string::npos); diff --git a/xs/src/libslic3r/PrintGCode.cpp b/xs/src/libslic3r/PrintGCode.cpp index 3fc7f0127..72f3ff03c 100644 --- a/xs/src/libslic3r/PrintGCode.cpp +++ b/xs/src/libslic3r/PrintGCode.cpp @@ -659,6 +659,8 @@ PrintGCode::process_layer(size_t idx, const Layer* layer, const Points& copies) copy_idx++; } // write the resulting gcode + gcode = this->_cooling_buffer.append(gcode, std::to_string(reinterpret_cast(layer->object())) + std::string(typeid(layer).name()), + layer->id(), layer->print_z); fh << this->filter(gcode); }