mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-11-01 05:01:10 -06:00
Bugfix: ambiguous semantics of the layers_count() method caused M73 to go beyond 100%. #1670
This commit is contained in:
parent
a32f548a23
commit
5c02bfd310
4 changed files with 66 additions and 39 deletions
17
t/gcode.t
17
t/gcode.t
|
|
@ -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__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue