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,3 @@
Exercise CANON_ERROR
.. including embedding printf format-specifiers in the error string

View File

@@ -0,0 +1,20 @@
executing
1 N..... USE_LENGTH_UNITS(CANON_UNITS_MM)
2 N..... SET_G5X_OFFSET(1, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000)
3 N..... SET_G92_OFFSET(0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000)
4 N..... SET_XY_ROTATION(0.0000)
5 N..... SET_FEED_REFERENCE(CANON_XYZ)
6 N..... ON_RESET()
7 N..... MESSAGE(" before M400: call_level= 0.000000 remap_level=0.000000")
8 N..... CANON_ERROR(%s is a literal percent s)
A failed Python prolog returning INTERP_ERROR
O <notcalled> call
9 N..... MESSAGE(" after failed M400: call_level= 0.000000 remap_level=0.000000")
10 N..... SET_G5X_OFFSET(1, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000)
11 N..... SET_XY_ROTATION(0.0000)
12 N..... SET_FEED_MODE(0, 0)
13 N..... SET_FEED_RATE(0.0000)
14 N..... STOP_SPINDLE_TURNING(0)
15 N..... SET_SPINDLE_MODE(0 0.0000)
16 N..... PROGRAM_END()
17 N..... ON_RESET()

View File

@@ -0,0 +1,24 @@
# Copyright (C) 2013 Jeff Epler <jepler@unpythonic.net>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
import emccanon
import interpreter
def failingprolog(self,*args, **words):
emccanon.CANON_ERROR("%s is a literal percent s")
self.set_errormsg("A failed Python prolog returning INTERP_ERROR")
return interpreter.INTERP_ERROR

View File

@@ -0,0 +1,16 @@
# Copyright (C) 2013 Jeff Epler <jepler@unpythonic.net>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
import remap

View File

@@ -0,0 +1,15 @@
[EMC]
DEBUG=0
LOG_LEVEL=0
[RS274NGC]
SUBROUTINE_PATH = .
REMAP=M400 modalgroup=5 prolog=failingprolog ngc=notcalled
[PYTHON]
PATH_PREPEND=.
TOPLEVEL=subs.py

View File

@@ -0,0 +1,4 @@
(debug, before M400: call_level= #<_call_level> remap_level=#<_remap_level>)
M400
(debug, after failed M400: call_level= #<_call_level> remap_level=#<_remap_level>)
M2

View File

@@ -0,0 +1,5 @@
#!/bin/bash
export PYTHONUNBUFFERED=1
rs274 -i test.ini -n 0 -g test.ngc 2>&1
# expected to fail
exit 0