mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-14 18:55:59 +08:00
Fixed a bug in cooling buffer resulting in G-codes setting fan to more than 100 %
This commit is contained in:
parent
4981b33b01
commit
d907a004cf
@ -783,8 +783,8 @@ std::string CoolingBuffer::apply_layer_cooldown(
|
|||||||
if (int(layer_id) >= disable_fan_first_layers && int(layer_id) + 1 < full_fan_speed_layer) {
|
if (int(layer_id) >= disable_fan_first_layers && int(layer_id) + 1 < full_fan_speed_layer) {
|
||||||
// Ramp up the fan speed from disable_fan_first_layers to full_fan_speed_layer.
|
// Ramp up the fan speed from disable_fan_first_layers to full_fan_speed_layer.
|
||||||
float factor = float(int(layer_id + 1) - disable_fan_first_layers) / float(full_fan_speed_layer - disable_fan_first_layers);
|
float factor = float(int(layer_id + 1) - disable_fan_first_layers) / float(full_fan_speed_layer - disable_fan_first_layers);
|
||||||
fan_speed_new = std::clamp(int(float(fan_speed_new) * factor + 0.5f), 0, 255);
|
fan_speed_new = std::clamp(int(float(fan_speed_new) * factor + 0.5f), 0, 100);
|
||||||
bridge_fan_speed = std::clamp(int(float(bridge_fan_speed) * factor + 0.5f), 0, 255);
|
bridge_fan_speed = std::clamp(int(float(bridge_fan_speed) * factor + 0.5f), 0, 100);
|
||||||
custom_fan_speed_limits.second = fan_speed_new;
|
custom_fan_speed_limits.second = fan_speed_new;
|
||||||
}
|
}
|
||||||
#undef EXTRUDER_CONFIG
|
#undef EXTRUDER_CONFIG
|
||||||
|
Loading…
x
Reference in New Issue
Block a user