diff options
author | Alessandro Ranellucci <aar@cpan.org> | 2012-08-31 01:13:28 +0400 |
---|---|---|
committer | Alessandro Ranellucci <aar@cpan.org> | 2012-08-31 01:13:28 +0400 |
commit | 5017f17171f7e38046026559993f301157ee8a6d (patch) | |
tree | 94228b6cdee284c815d5aace00679b7c1b5ce40f | |
parent | b37af86befc09c075fe7eae9c4b1d79148f7abd8 (diff) |
Adjust M-codes for temperature handling for Teacup. #539
-rw-r--r-- | lib/Slic3r/GCode.pm | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/lib/Slic3r/GCode.pm b/lib/Slic3r/GCode.pm index 94b065dec..499502696 100644 --- a/lib/Slic3r/GCode.pm +++ b/lib/Slic3r/GCode.pm @@ -421,25 +421,34 @@ sub set_temperature { return "" if $wait && $Slic3r::Config->gcode_flavor eq 'makerbot'; - my ($code, $comment) = $wait + my ($code, $comment) = ($wait && $Slic3r::Config->gcode_flavor ne 'teacup') ? ('M109', 'wait for temperature to be reached') : ('M104', 'set temperature'); - return sprintf "$code %s%d %s; $comment\n", + my $gcode = sprintf "$code %s%d %s; $comment\n", ($Slic3r::Config->gcode_flavor eq 'mach3' ? 'P' : 'S'), $temperature, (defined $tool && $tool != $self->extruder_idx) ? "T$tool " : ""; + + $gcode .= "M116 ; wait for temperature to be reached\n" + if $Slic3r::Config->gcode_flavor eq 'teacup' && $wait; + + return $gcode; } sub set_bed_temperature { my $self = shift; my ($temperature, $wait) = @_; - my ($code, $comment) = $wait + my ($code, $comment) = ($wait && $Slic3r::Config->gcode_flavor ne 'teacup') ? (($Slic3r::Config->gcode_flavor eq 'makerbot' ? 'M109' - : $Slic3r::Config->gcode_flavor eq 'teacup' ? 'M109 P1' : 'M190'), 'wait for bed temperature to be reached') : ('M140', 'set bed temperature'); - return sprintf "$code %s%d ; $comment\n", + my $gcode = sprintf "$code %s%d ; $comment\n", ($Slic3r::Config->gcode_flavor eq 'mach3' ? 'P' : 'S'), $temperature; + + $gcode .= "M116 ; wait for bed temperature to be reached\n" + if $Slic3r::Config->gcode_flavor eq 'teacup' && $wait; + + return $gcode; } 1; |