Import LinuxCNC source tree

This commit is contained in:
Wang Dequan
2026-08-20 06:17:39 +08:00
commit 2c814634c3
9429 changed files with 10556013 additions and 0 deletions

View File

@@ -0,0 +1,39 @@
#!/usr/bin/env python3
import tempfile
import gcode
import sys
def float_fmt(f):
if isinstance(f, float): return "% 5.1g" % f
return "%5s" % f
class Canon:
# Stay on the per-event canon protocol; the catch-all __getattr__ below
# would otherwise answer gcode.parse's move-batch probe with a callable.
use_move_batches = False
def __getattr__(self, attr):
"""Assume that any unknown attribute is a canon call; just print
its args and return None"""
def inner(*args):
args = list(map(float_fmt, args))
print("%-17s %s" % (attr, " ".join(args)))
return inner
# this is just noisy
def next_line(self, linecode): pass
# These can't just return None...
def get_external_length_units(self): return 1.0
def get_external_angular_units(self): return 1.0
def get_axis_mask(self): return 7 # (x y z)
def get_block_delete(self): return False
def get_tool(self, pocket):
return -1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0
parameter = tempfile.NamedTemporaryFile()
canon = Canon()
canon.parameter_file = parameter.name
result, seq = gcode.parse(sys.argv[1], canon, '', '', '')
if result > gcode.MIN_ERROR: raise SystemExit(gcode.strerror(result))

View File

@@ -0,0 +1,2 @@
#!/bin/sh
grep -q -F 'Radius to end of arc differs from radius to start:' "$1"

View File

@@ -0,0 +1,2 @@
G0 X0 Y0
G2 X1 Y1 I.25 F1

View File

@@ -0,0 +1,2 @@
#!/bin/sh
! python3 -mcanon error.ngc 2>&1