mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-19 11:23:42 +00:00
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_max_layer_z = 0.f;
|
||||||
m_last_width = 0.f;
|
m_last_width = 0.f;
|
||||||
m_is_role_based_fan_on.fill(false);
|
m_is_role_based_fan_on.fill(false);
|
||||||
|
m_role_based_fan_marker_layer.fill(-1);
|
||||||
|
|
||||||
m_fan_mover.release();
|
m_fan_mover.release();
|
||||||
|
|
||||||
@@ -6746,11 +6747,14 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description,
|
|||||||
assert(m_enable_cooling_markers);
|
assert(m_enable_cooling_markers);
|
||||||
|
|
||||||
if (fan_on) {
|
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 += ";";
|
||||||
gcode += marker_prefix;
|
gcode += marker_prefix;
|
||||||
gcode += "_FAN_START\n";
|
gcode += "_FAN_START\n";
|
||||||
m_is_role_based_fan_on[role] = true;
|
m_is_role_based_fan_on[role] = true;
|
||||||
|
m_role_based_fan_marker_layer[role] = m_layer_index;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (m_is_role_based_fan_on[role]) {
|
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 += marker_prefix;
|
||||||
gcode += "_FAN_END\n";
|
gcode += "_FAN_END\n";
|
||||||
m_is_role_based_fan_on[role] = false;
|
m_is_role_based_fan_on[role] = false;
|
||||||
|
m_role_based_fan_marker_layer[role] = -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -559,6 +559,7 @@ private:
|
|||||||
std::string _encode_label_ids_to_base64(std::vector<size_t> ids);
|
std::string _encode_label_ids_to_base64(std::vector<size_t> ids);
|
||||||
// ORCA: Add support for role based fan speed control
|
// ORCA: Add support for role based fan speed control
|
||||||
std::array<bool, ExtrusionRole::erCount> m_is_role_based_fan_on;
|
std::array<bool, ExtrusionRole::erCount> m_is_role_based_fan_on;
|
||||||
|
std::array<int, ExtrusionRole::erCount> m_role_based_fan_marker_layer;
|
||||||
// Markers for the Pressure Equalizer to recognize the extrusion type.
|
// Markers for the Pressure Equalizer to recognize the extrusion type.
|
||||||
// The Pressure Equalizer removes the markers from the final G-code.
|
// The Pressure Equalizer removes the markers from the final G-code.
|
||||||
bool m_enable_extrusion_role_markers;
|
bool m_enable_extrusion_role_markers;
|
||||||
|
|||||||
Reference in New Issue
Block a user