Bugfix: ambiguous semantics of the layers_count() method caused M73 to go beyond 100%. #1670

This commit is contained in:
Alessandro Ranellucci 2014-01-11 17:24:56 +01:00
parent a32f548a23
commit 5c02bfd310
4 changed files with 66 additions and 39 deletions

View file

@ -83,4 +83,21 @@ use Slic3r::Test;
ok $print->extruders->[0]->absolute_E + $config->retract_length->[0] > 0, 'total filament length is positive';
}
{
my $config = Slic3r::Config->new_from_defaults;
$config->set('gcode_flavor', 'sailfish');
$config->set('raft_layers', 3);
my $print = Slic3r::Test::init_print('20mm_cube', config => $config);
my @percent = ();
Slic3r::GCode::Reader->new->parse(Slic3r::Test::gcode($print), sub {
my ($self, $cmd, $args, $info) = @_;
if ($cmd eq 'M73') {
push @percent, $args->{P};
}
});
# the extruder heater is turned off when M73 P100 is reached
ok !(defined first { $_ > 100 } @percent), 'M73 is never given more than 100%';
}
__END__