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,10 @@
this regression tests whether:
(1)
- variables inserted in a prolog can be references properly in the NGC procedure
- changes to variables in the NGC procedure can be properly retrieved in the epilog
(2)
- variables inserted in a prolog, NGC procedure or epilog are deleted on the end of a remap
- (1) also works for several remaps in a block

View File

@@ -0,0 +1,15 @@
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..... SET_G5X_OFFSET(1, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000)
8 N..... SET_XY_ROTATION(0.0000)
9 N..... SET_FEED_MODE(0, 0)
10 N..... SET_FEED_RATE(0.0000)
11 N..... STOP_SPINDLE_TURNING(0)
12 N..... SET_SPINDLE_MODE(0 0.0000)
13 N..... PROGRAM_END()
14 N..... ON_RESET()

View File

@@ -0,0 +1,58 @@
# This is a component of LinuxCNC
# Copyright 2011 Michael Haberler <git@mah.priv.at>
#
# 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.
#
from interpreter import *
def prolog405(self, **words):
self.params["foo405"] = 42
return INTERP_OK
# rm405 will bump foo405 by 1
def epilog405(self, **words):
if self.params["foo405"] != 43:
self.set_errormsg("foo405 != 43 in epilog405")
return INTERP_ERROR
return INTERP_OK
def prolog406(self, **words):
self.params["foo406"] = 42
return INTERP_OK
# rm406 will bump foo406 by 1
def epilog406(self, **words):
if self.params["foo406"] != 43:
self.set_errormsg("foo406 != 43 in epilog406")
return INTERP_ERROR
return INTERP_OK
def prolog407(self, **words):
self.params["foo407"] = 42
return INTERP_OK
# rm407 will bump foo407 by 1
def epilog407(self, **words):
if self.params["foo407"] != 43:
self.set_errormsg("foo407 != 43 in epilog407")
return INTERP_ERROR
return INTERP_OK

View File

@@ -0,0 +1,9 @@
o<rm405> sub
o100 if [#<foo405> NE 42]
(abort,rm405: foo405=#<foo405>)
o100 endif
; bump by 1 and check in epilog whether change is visible
#<foo405> = [#<foo405> + 1]
o<rm405> endsub
m2
%

View File

@@ -0,0 +1,14 @@
o<rm406> sub
o50 if [EXISTS[#<foo405>]]
(abort,WHOA! foo405 visible in rm406: foo405=#<foo405>)
o50 endif
o100 if [#<foo406> NE 42]
(abort,rm406: foo406=#<foo406>)
o100 endif
; bump by 1 and check in epilog whether change is visible
#<foo406> = [#<foo406> + 1]
o<rm406> endsub
m2
%

View File

@@ -0,0 +1,18 @@
o<rm407> sub
o50 if [EXISTS[#<foo405>]]
(abort,WHOA! foo405 visible in rm407: foo405=#<foo405>)
o50 endif
o70 if [EXISTS[#<foo406>]]
(abort,WHOA! foo406 visible in rm407: foo406=#<foo406>)
o70 endif
o100 if [#<foo407> NE 42]
(abort,rm407: foo407=#<foo407>)
o100 endif
; bump by 1 and check in epilog whether change is visible
#<foo407> = [#<foo407> + 1]
o<rm407> endsub
m2
%

View File

@@ -0,0 +1,21 @@
# This is a component of LinuxCNC
# Copyright 2011 Michael Haberler <git@mah.priv.at>
#
# 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,17 @@
[EMC]
DEBUG=0
LOG_LEVEL=0
[PYTHON]
PATH_PREPEND=.
TOPLEVEL=subs.py
LOG_LEVEL=0
[RS274NGC]
SUBROUTINE_PATH = .
REMAP=M405 modalgroup=5 prolog=prolog405 ngc=rm405 epilog=epilog405
REMAP=M406 modalgroup=6 prolog=prolog406 ngc=rm406 epilog=epilog406
REMAP=M407 modalgroup=7 prolog=prolog407 ngc=rm407 epilog=epilog407

View File

@@ -0,0 +1,6 @@
m405
m406
m407
m405 m406 m407
m2

View File

@@ -0,0 +1,2 @@
#!/bin/bash
exec rs274 -i test.ini -g test.ngc 2>&1