diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index e0af20a63..c61474fa3 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -2498,9 +2498,10 @@ void GCode::process_layer( this->set_origin(unscale(offset)); if (instance_to_print.object_by_extruder.support != nullptr && !print_wipe_extrusions) { m_layer = layers[instance_to_print.layer_id].support_layer; - gcode += this->extrude_support( - // support_extrusion_role is erSupportMaterial, erSupportMaterialInterface or erMixed for all extrusion paths. - instance_to_print.object_by_extruder.support->chained_path_from(m_last_pos, instance_to_print.object_by_extruder.support_extrusion_role)); + gcode += m_writer.set_temperature(m_config.temperature.get_at(m_writer.tool()->id()), false, m_writer.tool()->id()); + gcode += this->extrude_support( + // support_extrusion_role is erSupportMaterial, erSupportMaterialInterface or erMixed for all extrusion paths. + instance_to_print.object_by_extruder.support->chained_path_from(m_last_pos, instance_to_print.object_by_extruder.support_extrusion_role)); m_layer = layers[instance_to_print.layer_id].layer(); } for (ObjectByExtruder::Island &island : instance_to_print.object_by_extruder.islands) { @@ -3738,6 +3739,10 @@ std::string GCode::extrude_perimeters(const Print &print, const std::vectorconfig()); m_writer.apply_print_region_config(print.regions()[®ion - &by_region.front()]->config()); + if (m_config.print_temperature > 0) + gcode += m_writer.set_temperature(m_config.print_temperature.value, false, m_writer.tool()->id()); + else + gcode += m_writer.set_temperature(m_config.temperature.get_at(m_writer.tool()->id()), false, m_writer.tool()->id()); for (const ExtrusionEntity *ee : region.perimeters) gcode += this->extrude_entity(*ee, "", -1., &lower_layer_edge_grid); } @@ -3752,6 +3757,10 @@ std::string GCode::extrude_infill(const Print &print, const std::vectorconfig().infill_first == is_infill_first) { m_config.apply(print.regions()[®ion - &by_region.front()]->config()); m_writer.apply_print_region_config(print.regions()[®ion - &by_region.front()]->config()); + if (m_config.print_temperature > 0) + gcode += m_writer.set_temperature(m_config.print_temperature.value, false, m_writer.tool()->id()); + else + gcode += m_writer.set_temperature(m_config.temperature.get_at(m_writer.tool()->id()), false, m_writer.tool()->id()); ExtrusionEntitiesPtr extrusions { region.infills }; chain_and_reorder_extrusion_entities(extrusions, &m_last_pos); for (const ExtrusionEntity *fill : extrusions) { diff --git a/src/libslic3r/GCodeWriter.cpp b/src/libslic3r/GCodeWriter.cpp index a9bdefdf0..3c2444b51 100644 --- a/src/libslic3r/GCodeWriter.cpp +++ b/src/libslic3r/GCodeWriter.cpp @@ -87,8 +87,10 @@ std::string GCodeWriter::postamble() const return gcode.str(); } -std::string GCodeWriter::set_temperature(unsigned int temperature, bool wait, int tool) const +std::string GCodeWriter::set_temperature(unsigned int temperature, bool wait, int tool) { + if (m_last_temperature == temperature) + return ""; if (wait && (FLAVOR_IS(gcfMakerWare) || FLAVOR_IS(gcfSailfish))) return ""; @@ -126,6 +128,8 @@ std::string GCodeWriter::set_temperature(unsigned int temperature, bool wait, in if ((FLAVOR_IS(gcfTeacup) || FLAVOR_IS(gcfRepRap)) && wait) gcode << "M116 ; wait for temperature to be reached\n"; + m_last_temperature = temperature; + return gcode.str(); } diff --git a/src/libslic3r/GCodeWriter.hpp b/src/libslic3r/GCodeWriter.hpp index 976b5e010..15019b30f 100644 --- a/src/libslic3r/GCodeWriter.hpp +++ b/src/libslic3r/GCodeWriter.hpp @@ -65,7 +65,7 @@ public: } std::string preamble(); std::string postamble() const; - std::string set_temperature(unsigned int temperature, bool wait = false, int tool = -1) const; + std::string set_temperature(unsigned int temperature, bool wait = false, int tool = -1); std::string set_bed_temperature(unsigned int temperature, bool wait = false); std::string set_fan(unsigned int speed, bool dont_save = false); void set_acceleration(unsigned int acceleration); @@ -109,6 +109,7 @@ private: // If set to zero, the limit is not in action. unsigned int m_max_acceleration; unsigned int m_last_fan_speed; + unsigned int m_last_temperature; unsigned int m_last_bed_temperature; bool m_last_bed_temperature_reached; double m_lifted; diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index 3f605079a..80b1877a3 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -978,7 +978,7 @@ void PrintConfigDef::init_fff_params() def = this->add("print_extrusion_multiplier", coPercent); def->label = L("Extrusion multiplier"); - def->category = OptionCategory::width; + def->category = OptionCategory::filament; def->tooltip = L("This factor changes the amount of flow proportionally. You may need to tweak " "this setting to get nice surface finish and correct single wall widths. " "Usual values are between 90% and 110%. If you think you need to change this more, " @@ -2494,7 +2494,7 @@ void PrintConfigDef::init_fff_params() def = this->add("print_retract_length", coFloat); def->label = L("Retraction length"); - def->category = OptionCategory::width; + def->category = OptionCategory::filament; def->tooltip = L("Override the retract_length settign from the printer config. Used for calibration. Set negative to disable"); def->mode = comExpert; def->set_default_value(new ConfigOptionFloat( -1.f)); @@ -3211,6 +3211,13 @@ void PrintConfigDef::init_fff_params() def->max = max_temp; def->set_default_value(new ConfigOptionInts { 200 }); + def = this->add("print_temperature", coInt); + def->label = L("Temperature"); + def->category = OptionCategory::filament; + def->tooltip = L("Override the temperature of the extruder. Avoid doing too many changes, it won't stop for cooling/heating. 0 to disable."); + def->mode = comExpert; + def->set_default_value(new ConfigOptionInt(0)); + def = this->add("thin_perimeters", coBool); def->label = L("Overlapping external perimeter"); def->full_label = L("Overlapping external perimeter"); diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index ebf341e35..05348c2fd 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -689,7 +689,7 @@ public: ConfigOptionFloatOrPercent solid_infill_extrusion_width; ConfigOptionInt solid_infill_every_layers; ConfigOptionFloatOrPercent solid_infill_speed; - // Detect thin walls. + ConfigOptionInt print_temperature; ConfigOptionBool thin_perimeters; ConfigOptionBool thin_perimeters_all; ConfigOptionBool thin_walls; @@ -777,6 +777,7 @@ protected: OPT_PTR(solid_infill_extrusion_width); OPT_PTR(solid_infill_every_layers); OPT_PTR(solid_infill_speed); + OPT_PTR(print_temperature); OPT_PTR(thin_perimeters); OPT_PTR(thin_perimeters_all); OPT_PTR(thin_walls); diff --git a/src/slic3r/GUI/GUI_ObjectList.cpp b/src/slic3r/GUI/GUI_ObjectList.cpp index d96ec2ae4..b2ded689f 100644 --- a/src/slic3r/GUI/GUI_ObjectList.cpp +++ b/src/slic3r/GUI/GUI_ObjectList.cpp @@ -109,6 +109,7 @@ void fill_CATEGORY_ICON(std::map &CATEGORY_ICON) CATEGORY_ICON[OptionCategory::hollowing] = create_scaled_bitmap("hollowing"); //others CATEGORY_ICON[OptionCategory::milling] = create_scaled_bitmap("milling"); + CATEGORY_ICON[OptionCategory::filament] = create_scaled_bitmap("spool"); } ObjectList::ObjectList(wxWindow* parent) : diff --git a/src/slic3r/GUI/Preset.cpp b/src/slic3r/GUI/Preset.cpp index d25629223..7cf0765e6 100644 --- a/src/slic3r/GUI/Preset.cpp +++ b/src/slic3r/GUI/Preset.cpp @@ -539,7 +539,8 @@ const std::vector& Preset::print_options() , "curve_smoothing_angle_convex" , "curve_smoothing_angle_concave", "print_extrusion_multiplier", - "print_retract_length", + "print_retract_length", + "print_temperature", "external_perimeter_cut_corners", "external_perimeter_overlap", "perimeter_bonding",