Prusa Slicer 2.6.0
Loading...
Searching...
No Matches
Slic3r::OozePrevention Class Reference

#include <src/libslic3r/GCode.hpp>

Public Member Functions

 OozePrevention ()
 
std::string pre_toolchange (GCode &gcodegen)
 
std::string post_toolchange (GCode &gcodegen)
 

Public Attributes

bool enable
 

Private Member Functions

int _get_temp (const GCode &gcodegen) const
 

Detailed Description

Constructor & Destructor Documentation

◆ OozePrevention()

Slic3r::OozePrevention::OozePrevention ( )
inline
43: enable(false) {}
bool enable
Definition GCode.hpp:41

Member Function Documentation

◆ _get_temp()

int Slic3r::OozePrevention::_get_temp ( const GCode gcodegen) const
private
143 {
144 return (gcodegen.layer() == nullptr || gcodegen.layer()->id() == 0)
145 ? gcodegen.config().first_layer_temperature.get_at(gcodegen.writer().extruder()->id())
146 : gcodegen.config().temperature.get_at(gcodegen.writer().extruder()->id());
147 }

References Slic3r::GCode::config(), Slic3r::GCodeWriter::extruder(), Slic3r::Extruder::id(), Slic3r::Layer::id(), Slic3r::GCode::layer(), and Slic3r::GCode::writer().

Referenced by post_toolchange(), and pre_toolchange().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ post_toolchange()

std::string Slic3r::OozePrevention::post_toolchange ( GCode gcodegen)
136 {
137 return (gcodegen.config().standby_temperature_delta.value != 0) ?
138 gcodegen.writer().set_temperature(this->_get_temp(gcodegen), true, gcodegen.writer().extruder()->id()) :
139 std::string();
140 }
int _get_temp(const GCode &gcodegen) const
Definition GCode.cpp:142

References _get_temp(), Slic3r::GCode::config(), Slic3r::GCodeWriter::extruder(), Slic3r::Extruder::id(), Slic3r::GCodeWriter::set_temperature(), and Slic3r::GCode::writer().

Referenced by Slic3r::GCode::set_extruder().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pre_toolchange()

std::string Slic3r::OozePrevention::pre_toolchange ( GCode gcodegen)
110 {
111 std::string gcode;
112
113 unsigned int extruder_id = gcodegen.writer().extruder()->id();
114 const ConfigOptionIntsNullable& filament_idle_temp = gcodegen.config().idle_temperature;
115 if (filament_idle_temp.is_nil(extruder_id)) {
116 // There is no idle temperature defined in filament settings.
117 // Use the delta value from print config.
118 if (gcodegen.config().standby_temperature_delta.value != 0) {
119 // we assume that heating is always slower than cooling, so no need to block
120 gcode += gcodegen.writer().set_temperature
121 (this->_get_temp(gcodegen) + gcodegen.config().standby_temperature_delta.value, false, extruder_id);
122 gcode.pop_back();
123 gcode += " ;cooldown\n"; // this is a marker for GCodeProcessor, so it can supress the commands when needed
124 }
125 } else {
126 // Use the value from filament settings. That one is absolute, not delta.
127 gcode += gcodegen.writer().set_temperature(filament_idle_temp.get_at(extruder_id), false, extruder_id);
128 gcode.pop_back();
129 gcode += " ;cooldown\n"; // this is a marker for GCodeProcessor, so it can supress the commands when needed
130 }
131
132 return gcode;
133 }
ConfigOptionIntsTempl< true > ConfigOptionIntsNullable
Definition Config.hpp:845

References _get_temp(), Slic3r::GCode::config(), Slic3r::GCodeWriter::extruder(), Slic3r::ConfigOptionVector< T >::get_at(), Slic3r::Extruder::id(), Slic3r::ConfigOptionIntsTempl< NULLABLE >::is_nil(), Slic3r::GCodeWriter::set_temperature(), and Slic3r::GCode::writer().

Referenced by Slic3r::GCode::set_extruder().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ enable


The documentation for this class was generated from the following files: