mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-14 00:52:04 +00:00
Fix fan stuck at wrong speed (#13336)
Fix fan speed staying high When fan speed-up time is enabled, layers can inherit a higher fan speed than intended. If a layer ended with a role-driven fan change, the last applied fan speed was not properly tracked. As a result, the next layer could start with an incorrect fan state and keep the higher speed until another fan command overrode it. Ensure the emitted fan speed is always tracked correctly, including when flushing buffered commands at the end of a layer.
This commit is contained in:
@@ -33,7 +33,11 @@ const std::string& FanMover::process_gcode(const std::string& gcode, bool flush)
|
||||
|
||||
if (flush) {
|
||||
while (!m_buffer.empty()) {
|
||||
m_process_output += m_buffer.front().raw + "\n";
|
||||
BufferData &front = m_buffer.front();
|
||||
m_process_output += front.raw + "\n";
|
||||
// Orca: Keep the emitted fan state in sync when flushing buffered fan commands.
|
||||
if (front.fan_speed >= 0)
|
||||
m_front_buffer_fan_speed = front.fan_speed;
|
||||
remove_from_buffer(m_buffer.begin());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user