mirror of https://github.com/vitalif/Slic3r
Adjust M-codes for temperature handling for Teacup. #539
parent
94a096f1d2
commit
202bfa91c8
|
@ -421,25 +421,34 @@ sub set_temperature {
|
||||||
|
|
||||||
return "" if $wait && $Slic3r::Config->gcode_flavor eq 'makerbot';
|
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')
|
? ('M109', 'wait for temperature to be reached')
|
||||||
: ('M104', 'set temperature');
|
: ('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,
|
($Slic3r::Config->gcode_flavor eq 'mach3' ? 'P' : 'S'), $temperature,
|
||||||
(defined $tool && $tool != $self->extruder_idx) ? "T$tool " : "";
|
(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 {
|
sub set_bed_temperature {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my ($temperature, $wait) = @_;
|
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 'makerbot' ? 'M109'
|
||||||
: $Slic3r::Config->gcode_flavor eq 'teacup' ? 'M109 P1'
|
|
||||||
: 'M190'), 'wait for bed temperature to be reached')
|
: 'M190'), 'wait for bed temperature to be reached')
|
||||||
: ('M140', 'set bed temperature');
|
: ('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;
|
($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;
|
1;
|
||||||
|
|
Loading…
Reference in New Issue