diff options
author | Alessandro Ranellucci <aar@cpan.org> | 2015-03-03 01:56:38 +0300 |
---|---|---|
committer | Alessandro Ranellucci <aar@cpan.org> | 2015-03-03 01:56:38 +0300 |
commit | a3b843b24e4426c18ab9179d26e543a83071be24 (patch) | |
tree | 07216c15c457a3081780527697f5a33af4c277ea | |
parent | 9d435c8f4d4e1f932fbb5e37cdca163d0bb316ea (diff) |
Bugfix: temperature was not set correctly when using sequential printing. Includes regression test. #2702
-rw-r--r-- | lib/Slic3r/Print/GCode.pm | 1 | ||||
-rw-r--r-- | t/gcode.t | 10 |
2 files changed, 10 insertions, 1 deletions
diff --git a/lib/Slic3r/Print/GCode.pm b/lib/Slic3r/Print/GCode.pm index 72ac2d38e..bdc928685 100644 --- a/lib/Slic3r/Print/GCode.pm +++ b/lib/Slic3r/Print/GCode.pm @@ -217,6 +217,7 @@ sub export { } $self->flush_filters; $finished_objects++; + $self->_second_layer_things_done(0); } } } else { @@ -1,4 +1,4 @@ -use Test::More tests => 21; +use Test::More tests => 22; use strict; use warnings; @@ -86,6 +86,7 @@ use Slic3r::Test; # - no hard-coded "E" are generated # - Z moves are correctly generated for both objects # - no travel moves go outside skirt + # - temperatures are set correctly my $config = Slic3r::Config->new_from_defaults; $config->set('gcode_comments', 1); $config->set('complete_objects', 1); @@ -93,11 +94,14 @@ use Slic3r::Test; $config->set('start_gcode', ''); # prevent any default extra Z move $config->set('layer_height', 0.4); $config->set('first_layer_height', 0.4); + $config->set('temperature', [200]); + $config->set('first_layer_temperature', [210]); my $print = Slic3r::Test::init_print('20mm_cube', config => $config, duplicate => 2); ok my $gcode = Slic3r::Test::gcode($print), "complete_objects"; my @z_moves = (); my @travel_moves = (); # array of scaled points my @extrusions = (); # array of scaled points + my @temps = (); Slic3r::GCode::Reader->new->parse($gcode, sub { my ($self, $cmd, $args, $info) = @_; fail 'unexpected E argument' if defined $args->{E}; @@ -112,6 +116,8 @@ use Slic3r::Test; push @travel_moves, Slic3r::Point->new_scale($info->{new_X}, $info->{new_Y}) if @extrusions; # skip initial travel move to first skirt point } + } elsif ($cmd eq 'M104' || $cmd eq 'M109') { + push @temps, $args->{S} if !@temps || $args->{S} != $temps[-1]; } }); my $layer_count = 20/0.4; # cube is 20mm tall @@ -120,6 +126,8 @@ use Slic3r::Test; my $convex_hull = convex_hull(\@extrusions); ok !(defined first { !$convex_hull->contains_point($_) } @travel_moves), 'all travel moves happen within skirt'; + + is_deeply \@temps, [210, 200, 210, 200, 0], 'expected temperature changes'; } { |