Fix role-based fan speeds being lost on layer change (#13390)
This commit is contained in:
@@ -2419,6 +2419,7 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato
|
||||
m_max_layer_z = 0.f;
|
||||
m_last_width = 0.f;
|
||||
m_is_role_based_fan_on.fill(false);
|
||||
m_role_based_fan_marker_layer.fill(-1);
|
||||
|
||||
m_fan_mover.release();
|
||||
|
||||
@@ -6746,11 +6747,14 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description,
|
||||
assert(m_enable_cooling_markers);
|
||||
|
||||
if (fan_on) {
|
||||
if (!m_is_role_based_fan_on[role]) {
|
||||
// Orca: CoolingBuffer consumes role fan markers per layer, so continuing
|
||||
// role-based fan regions need a fresh START marker on each new layer.
|
||||
if (!m_is_role_based_fan_on[role] || m_role_based_fan_marker_layer[role] != m_layer_index) {
|
||||
gcode += ";";
|
||||
gcode += marker_prefix;
|
||||
gcode += "_FAN_START\n";
|
||||
m_is_role_based_fan_on[role] = true;
|
||||
m_role_based_fan_marker_layer[role] = m_layer_index;
|
||||
}
|
||||
} else {
|
||||
if (m_is_role_based_fan_on[role]) {
|
||||
@@ -6758,6 +6762,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description,
|
||||
gcode += marker_prefix;
|
||||
gcode += "_FAN_END\n";
|
||||
m_is_role_based_fan_on[role] = false;
|
||||
m_role_based_fan_marker_layer[role] = -1;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user