diff options
author | Joseph Lenox <lenox.joseph@gmail.com> | 2016-07-21 02:15:24 +0300 |
---|---|---|
committer | bubnikv <bubnikv@gmail.com> | 2017-02-10 11:39:33 +0300 |
commit | eb9f1808c019bce0ec86d2e5cbd0be5478cf1837 (patch) | |
tree | 2b740661f5efea09c85046469cf5b729cbe36aaa /t/gcode.t | |
parent | abda05472081e5fe831135ac72b14791bd35fbd1 (diff) |
Test to ensure that the repetier firmware returns the correct acceleration M code and that the values are set properly.
Diffstat (limited to 't/gcode.t')
-rw-r--r-- | t/gcode.t | 29 |
1 files changed, 28 insertions, 1 deletions
@@ -1,4 +1,4 @@ -use Test::More tests => 23; +use Test::More tests => 25; use strict; use warnings; @@ -215,4 +215,31 @@ use Slic3r::Test; ok !$spiral, 'spiral vase is correctly disabled on layers with multiple loops'; } + +{ + # Tests that the Repetier flavor produces M201 Xnnn Ynnn for resetting + # acceleration, also that M204 Snnn syntax is not generated. + my $config = Slic3r::Config->new_from_defaults; + $config->set('gcode_flavor', 'repetier'); + $config->set('default_acceleration', 1337); + my $print = Slic3r::Test::init_print('cube_with_hole', config => $config); + + my $has_accel = 0; + my $has_m204 = 0; + Slic3r::GCode::Reader->new->parse(Slic3r::Test::gcode($print), sub { + my ($self, $cmd, $args, $info) = @_; + + if ($cmd eq 'M201' && exists $args->{X} && exists $args->{Y}) { + if ($args->{X} == 1337 && $args->{Y} == 1337) { + $has_accel = 1; + } + } + if ($cmd eq 'M204' && exists $args->{S}) { + $has_m204 = 1; + } + }); + ok $has_accel, 'M201 is generated for repetier firmware.'; + ok !$has_m204, 'M204 is not generated for repetier firmware'; +} + __END__ |