mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-16 10:02:12 +00:00
ENH: don't apply new fan speed until filament change finished
This patch can make sure that the cooling fan will not be enabled during change fimanet. Signed-off-by: salt.wei <salt.wei@bambulab.com> Change-Id: I9f480b99116d62fe7522233b69b5bca209663821
This commit is contained in:
@@ -722,7 +722,7 @@ std::string CoolingBuffer::apply_layer_cooldown(
|
||||
new_gcode.reserve(gcode.size() * 2);
|
||||
bool overhang_fan_control= false;
|
||||
int overhang_fan_speed = 0;
|
||||
auto change_extruder_set_fan = [ this, layer_id, layer_time, &new_gcode, &overhang_fan_control, &overhang_fan_speed]() {
|
||||
auto change_extruder_set_fan = [ this, layer_id, layer_time, &new_gcode, &overhang_fan_control, &overhang_fan_speed](bool immediately_apply) {
|
||||
#define EXTRUDER_CONFIG(OPT) m_config.OPT.get_at(m_current_extruder)
|
||||
int fan_min_speed = EXTRUDER_CONFIG(fan_min_speed);
|
||||
int fan_speed_new = EXTRUDER_CONFIG(reduce_fan_stop_start_freq) ? fan_min_speed : 0;
|
||||
@@ -771,18 +771,20 @@ std::string CoolingBuffer::apply_layer_cooldown(
|
||||
m_fan_speed = fan_speed_new;
|
||||
//BBS
|
||||
m_current_fan_speed = fan_speed_new;
|
||||
new_gcode += GCodeWriter::set_fan(m_config.gcode_flavor, m_fan_speed);
|
||||
if (immediately_apply)
|
||||
new_gcode += GCodeWriter::set_fan(m_config.gcode_flavor, m_fan_speed);
|
||||
}
|
||||
//BBS
|
||||
if (additional_fan_speed_new != m_additional_fan_speed) {
|
||||
m_additional_fan_speed = additional_fan_speed_new;
|
||||
new_gcode += GCodeWriter::set_additional_fan(m_additional_fan_speed);
|
||||
if (immediately_apply)
|
||||
new_gcode += GCodeWriter::set_additional_fan(m_additional_fan_speed);
|
||||
}
|
||||
};
|
||||
|
||||
const char *pos = gcode.c_str();
|
||||
int current_feedrate = 0;
|
||||
change_extruder_set_fan();
|
||||
change_extruder_set_fan(true);
|
||||
for (const CoolingLine *line : lines) {
|
||||
const char *line_start = gcode.c_str() + line->line_start;
|
||||
const char *line_end = gcode.c_str() + line->line_end;
|
||||
@@ -792,7 +794,7 @@ std::string CoolingBuffer::apply_layer_cooldown(
|
||||
unsigned int new_extruder = (unsigned int)atoi(line_start + m_toolchange_prefix.size());
|
||||
if (new_extruder != m_current_extruder) {
|
||||
m_current_extruder = new_extruder;
|
||||
change_extruder_set_fan();
|
||||
change_extruder_set_fan(false); //BBS: will force to resume fan speed when filament change is finished
|
||||
}
|
||||
new_gcode.append(line_start, line_end - line_start);
|
||||
} else if (line->type & CoolingLine::TYPE_OVERHANG_FAN_START) {
|
||||
|
||||
@@ -2647,7 +2647,7 @@ void PrintConfigDef::init_fff_params()
|
||||
def->sidetext = L("°C");
|
||||
def->min = 0;
|
||||
def->max = max_temp;
|
||||
def->set_default_value(new ConfigOptionInts { 0 });
|
||||
def->set_default_value(new ConfigOptionInts { 190 });
|
||||
|
||||
def = this->add("nozzle_temperature_range_high", coInts);
|
||||
def->label = L("Max");
|
||||
@@ -2655,7 +2655,7 @@ void PrintConfigDef::init_fff_params()
|
||||
def->sidetext = L("°C");
|
||||
def->min = 0;
|
||||
def->max = max_temp;
|
||||
def->set_default_value(new ConfigOptionInts { 0 });
|
||||
def->set_default_value(new ConfigOptionInts { 240 });
|
||||
|
||||
def = this->add("bed_temperature_difference", coInts);
|
||||
def->label = L("Bed temperature difference");
|
||||
|
||||
Reference in New Issue
Block a user