From b449e6e378334e06dc3476d2f518a1fb4054bd99 Mon Sep 17 00:00:00 2001 From: Christos Karampeazis-Papadakis Date: Sat, 27 Jul 2024 13:13:06 +0200 Subject: [PATCH] Add missing members ESL filter and setters to CoolingBuffer --- src/libslic3r/GCode.cpp | 1 + src/libslic3r/GCode.hpp | 2 +- src/libslic3r/GCode/CoolingBuffer.hpp | 7 +++++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index fe873281e78..5142101eaab 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -1726,6 +1726,7 @@ void GCode::_do_export(Print& print_mod, GCodeOutputStream &file, ThumbnailsGene m_cooling_buffer = make_unique(*this); m_cooling_buffer->set_current_extruder(initial_extruder_id); + m_cooling_buffer->set_exclude_print_speed_filter(m_exclude_print_speeds); // Emit machine envelope limits for the Marlin firmware. this->print_machine_envelope(file, print); diff --git a/src/libslic3r/GCode.hpp b/src/libslic3r/GCode.hpp index 9e8919c3e4b..4336e98d071 100644 --- a/src/libslic3r/GCode.hpp +++ b/src/libslic3r/GCode.hpp @@ -486,7 +486,7 @@ class GCode : ExtrusionVisitorConst { std::unique_ptr m_find_replace; std::unique_ptr m_pressure_equalizer; std::unique_ptr m_wipe_tower; - std::unique_ptr m_exclude_print_speeds; + std::shared_ptr m_exclude_print_speeds; // Heights (print_z) at which the skirt has already been extruded. std::vector m_skirt_done; diff --git a/src/libslic3r/GCode/CoolingBuffer.hpp b/src/libslic3r/GCode/CoolingBuffer.hpp index 77ff8879cb8..2b7edb502b9 100644 --- a/src/libslic3r/GCode/CoolingBuffer.hpp +++ b/src/libslic3r/GCode/CoolingBuffer.hpp @@ -1,6 +1,7 @@ #ifndef slic3r_CoolingBuffer_hpp_ #define slic3r_CoolingBuffer_hpp_ +#include "ExcludePrintSpeeds.hpp" #include "../libslic3r.h" #include #include @@ -25,6 +26,10 @@ class CoolingBuffer { CoolingBuffer(GCode &gcodegen); void reset(const Vec3d &position); void set_current_extruder(unsigned int extruder_id) { m_current_extruder = extruder_id; } + void set_exclude_print_speed_filter(std::shared_ptr _exclude_print_speeds_filter) + { + exclude_print_speeds_filter = std::move(_exclude_print_speeds_filter); + } /// process the layer: check the time and apply fan / speed change /// append_time_only: if the layer is only support, then you can put this at true to not process the layer but just append its time to the next one. std::string process_layer(std::string &&gcode, size_t layer_id, bool flush, bool append_time_only = false); @@ -60,6 +65,8 @@ class CoolingBuffer { std::map saved_layer_time_support; std::map saved_layer_time_object; + std::shared_ptr exclude_print_speeds_filter; + // Old logic: proportional. bool m_cooling_logic_proportional = false;