Bugfix: an awful _BRIDGE_FAN_END string was sometimes left in the output. #245

This commit is contained in:
Alessandro Ranellucci 2012-03-03 22:16:38 +01:00
parent 2ff3ab1faf
commit c7006fed26
2 changed files with 6 additions and 8 deletions

View file

@ -307,7 +307,7 @@ sub _Gx {
my $append_bridge_off = 0;
if ($speed ne $self->last_speed) {
if ($speed eq 'bridge') {
$gcode = "_BRIDGE_FAN_START\n$gcode";
$gcode = ";_BRIDGE_FAN_START\n$gcode";
} elsif ($self->last_speed eq 'bridge') {
$append_bridge_off = 1;
}
@ -325,7 +325,7 @@ sub _Gx {
$gcode .= sprintf " ; %s", $comment if $comment && $Slic3r::gcode_comments;
if ($append_bridge_off) {
$gcode .= "\n_BRIDGE_FAN_END";
$gcode .= "\n;_BRIDGE_FAN_END";
}
return "$gcode\n";
}

View file

@ -629,9 +629,7 @@ sub export_gcode {
}
# go to layer
print $fh $extruder->change_layer($layer);
my $layer_gcode = "";
my $layer_gcode = $extruder->change_layer($layer);
$extruder->elapsed_time(0);
# extrude skirts
@ -701,10 +699,10 @@ sub export_gcode {
# bridge fan speed
if (!$Slic3r::cooling || $Slic3r::bridge_fan_speed == 0 || $layer->id < $Slic3r::disable_fan_first_layers) {
$layer_gcode =~ s/^_BRIDGE_FAN_(?:START|END)\n//gm;
$layer_gcode =~ s/^;_BRIDGE_FAN_(?:START|END)\n//gm;
} else {
$layer_gcode =~ s/^_BRIDGE_FAN_START\n/ $extruder->set_fan($Slic3r::bridge_fan_speed, 1) /gmex;
$layer_gcode =~ s/^_BRIDGE_FAN_END\n/ $extruder->set_fan($fan_speed, 1) /gmex;
$layer_gcode =~ s/^;_BRIDGE_FAN_START\n/ $extruder->set_fan($Slic3r::bridge_fan_speed, 1) /gmex;
$layer_gcode =~ s/^;_BRIDGE_FAN_END\n/ $extruder->set_fan($fan_speed, 1) /gmex;
}
print $fh $layer_gcode;