chiark / gitweb /
quacks-ingredients: gcode manipulation - better EH
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 20 Feb 2020 15:03:36 +0000 (15:03 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 20 Feb 2020 15:03:36 +0000 (15:03 +0000)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
quacks-ingredients-make-copy-gcodes

index 742d9246d2114f5e397cc45008906adbae6413a9..4f0ddd3547fa755db3fccbf65afb65d1665a725e 100755 (executable)
@@ -51,13 +51,13 @@ for l in 2 4 5; do
                                        (?: ; .* \s*\n )?
                                        ^G1 \ Z([0-9.]+) \s*\n  )
                                }{
-                                       die unless $1 > $4;
-                                       die unless $3 > 9000;
+                                       die "$& $3" unless $1 >= $4;
+                                       die "$& $3" unless $3 > 9000;
                                        my $z = $i == $#l ? $1 : $4 + 0.5;
                                        "G0 F$3\n".
                                        "G1 Z$z\n" .
                                        $2
-                               }gmxe or $l==0 or die $i;
+                               }gmxe or $i==0 or die "$l[$i] $i";
                }
                print or die $! foreach @l;
        ' $g