Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJoseph Lenox <lenox.joseph@gmail.com>2016-07-21 02:15:24 +0300
committerbubnikv <bubnikv@gmail.com>2017-02-10 11:39:33 +0300
commiteb9f1808c019bce0ec86d2e5cbd0be5478cf1837 (patch)
tree2b740661f5efea09c85046469cf5b729cbe36aaa /t
parentabda05472081e5fe831135ac72b14791bd35fbd1 (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')
-rw-r--r--t/gcode.t29
1 files changed, 28 insertions, 1 deletions
diff --git a/t/gcode.t b/t/gcode.t
index ef2209a80..9e7bd354a 100644
--- a/t/gcode.t
+++ b/t/gcode.t
@@ -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__