Import LinuxCNC source tree
This commit is contained in:
48
tests/interp/unit-conversion/expected
Normal file
48
tests/interp/unit-conversion/expected
Normal file
@@ -0,0 +1,48 @@
|
||||
N..... USE_LENGTH_UNITS(CANON_UNITS_MM)
|
||||
N..... SET_G5X_OFFSET(1, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000)
|
||||
N..... SET_G92_OFFSET(0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000)
|
||||
N..... SET_XY_ROTATION(0.0000)
|
||||
N..... SET_FEED_REFERENCE(CANON_XYZ)
|
||||
N..... ON_RESET()
|
||||
N..... COMMENT("Verify G20/G21 unit switching. The current position and the interpreter's")
|
||||
N..... COMMENT("internal offsets are converted, while the numbered parameters that back")
|
||||
N..... COMMENT("the work and axis offsets stay constant because they are stored in user")
|
||||
N..... COMMENT("INI units. salvaged from the retired meson-only unit_tests/interp tests")
|
||||
N..... USE_LENGTH_UNITS(CANON_UNITS_INCHES)
|
||||
N..... COMMENT("interpreter: continuing to use same coordinate system")
|
||||
N..... SET_G92_OFFSET(0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000)
|
||||
N..... SET_G5X_OFFSET(1, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000)
|
||||
N..... SET_XY_ROTATION(0.0000)
|
||||
N..... MESSAGE(" --- position conversion: move to x1 y2 z3 a4 b5 c6 in inches")
|
||||
N..... STRAIGHT_TRAVERSE(1.0000, 2.0000, 3.0000, 4.0000, 5.0000, 6.0000)
|
||||
N..... MESSAGE(" in inches, expect 1 2 3 4 5 6: 1.000000 2.000000 3.000000 4.000000 5.000000 6.000000")
|
||||
N..... USE_LENGTH_UNITS(CANON_UNITS_MM)
|
||||
N..... MESSAGE(" in mm, expect 25.4 50.8 76.2 4 5 6: 25.400000 50.800000 76.200000 4.000000 5.000000 6.000000")
|
||||
N..... USE_LENGTH_UNITS(CANON_UNITS_INCHES)
|
||||
N..... MESSAGE(" back in inches, expect 1 2 3 4 5 6: 1.000000 2.000000 3.000000 4.000000 5.000000 6.000000")
|
||||
N..... MESSAGE(" --- work offsets: g10 l2 p1 x1 y2 z3 a4 b5 c6, params stay in user units")
|
||||
N..... SET_G5X_OFFSET(1, 1.0000, 2.0000, 3.0000, 4.0000, 5.0000, 6.0000)
|
||||
N..... SET_XY_ROTATION(0.0000)
|
||||
N..... COMMENT("interpreter: continuing to use same coordinate system")
|
||||
N..... MESSAGE(" params as stored, expect 1 2 3 4 5 6: 1.000000 2.000000 3.000000 4.000000 5.000000 6.000000")
|
||||
N..... USE_LENGTH_UNITS(CANON_UNITS_MM)
|
||||
N..... MESSAGE(" unchanged after g21, expect 1 2 3 4 5 6: 1.000000 2.000000 3.000000 4.000000 5.000000 6.000000")
|
||||
N..... USE_LENGTH_UNITS(CANON_UNITS_INCHES)
|
||||
N..... MESSAGE(" unchanged after g20, expect 1 2 3 4 5 6: 1.000000 2.000000 3.000000 4.000000 5.000000 6.000000")
|
||||
N..... MESSAGE(" --- axis offsets: g92 x1 y2 z3 a4 b5 c6, params stay in user units")
|
||||
N..... SET_G92_OFFSET(-1.0000, -2.0000, -3.0000, -4.0000, -5.0000, -6.0000)
|
||||
N..... MESSAGE(" params as stored, expect -1 -2 -3 -4 -5 -6: -1.000000 -2.000000 -3.000000 -4.000000 -5.000000 -6.000000")
|
||||
N..... USE_LENGTH_UNITS(CANON_UNITS_MM)
|
||||
N..... MESSAGE(" unchanged after g21, expect -1 -2 -3 -4 -5 -6: -1.000000 -2.000000 -3.000000 -4.000000 -5.000000 -6.000000")
|
||||
N..... USE_LENGTH_UNITS(CANON_UNITS_INCHES)
|
||||
N..... MESSAGE(" unchanged after g20, expect -1 -2 -3 -4 -5 -6: -1.000000 -2.000000 -3.000000 -4.000000 -5.000000 -6.000000")
|
||||
N..... SET_G92_OFFSET(0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000)
|
||||
N..... SET_G5X_OFFSET(1, 1.0000, 2.0000, 3.0000, 4.0000, 5.0000, 6.0000)
|
||||
N..... SET_XY_ROTATION(0.0000)
|
||||
N..... SET_FEED_MODE(0, 0)
|
||||
N..... SET_FEED_RATE(0.0000)
|
||||
N..... STOP_SPINDLE_TURNING(0)
|
||||
N..... SET_SPINDLE_MODE(0 0.0000)
|
||||
N..... PROGRAM_END()
|
||||
N..... ON_RESET()
|
||||
N..... ON_RESET()
|
||||
43
tests/interp/unit-conversion/test.ngc
Normal file
43
tests/interp/unit-conversion/test.ngc
Normal file
@@ -0,0 +1,43 @@
|
||||
(Verify G20/G21 unit switching. The current position and the interpreter's)
|
||||
(internal offsets are converted, while the numbered parameters that back)
|
||||
(the work and axis offsets stay constant because they are stored in user)
|
||||
(INI units. salvaged from the retired meson-only unit_tests/interp tests)
|
||||
|
||||
g20
|
||||
g54
|
||||
g92.1
|
||||
g10 l2 p1 x0 y0 z0 a0 b0 c0
|
||||
|
||||
(debug, --- position conversion: move to x1 y2 z3 a4 b5 c6 in inches)
|
||||
g0 x1 y2 z3 a4 b5 c6
|
||||
(debug, in inches, expect 1 2 3 4 5 6: #5420 #5421 #5422 #5423 #5424 #5425)
|
||||
|
||||
g21
|
||||
(debug, in mm, expect 25.4 50.8 76.2 4 5 6: #5420 #5421 #5422 #5423 #5424 #5425)
|
||||
|
||||
g20
|
||||
(debug, back in inches, expect 1 2 3 4 5 6: #5420 #5421 #5422 #5423 #5424 #5425)
|
||||
|
||||
(debug, --- work offsets: g10 l2 p1 x1 y2 z3 a4 b5 c6, params stay in user units)
|
||||
g10 l2 p1 x1 y2 z3 a4 b5 c6
|
||||
g54
|
||||
(debug, params as stored, expect 1 2 3 4 5 6: #5221 #5222 #5223 #5224 #5225 #5226)
|
||||
|
||||
g21
|
||||
(debug, unchanged after g21, expect 1 2 3 4 5 6: #5221 #5222 #5223 #5224 #5225 #5226)
|
||||
|
||||
g20
|
||||
(debug, unchanged after g20, expect 1 2 3 4 5 6: #5221 #5222 #5223 #5224 #5225 #5226)
|
||||
|
||||
(debug, --- axis offsets: g92 x1 y2 z3 a4 b5 c6, params stay in user units)
|
||||
g92 x1 y2 z3 a4 b5 c6
|
||||
(debug, params as stored, expect -1 -2 -3 -4 -5 -6: #5211 #5212 #5213 #5214 #5215 #5216)
|
||||
|
||||
g21
|
||||
(debug, unchanged after g21, expect -1 -2 -3 -4 -5 -6: #5211 #5212 #5213 #5214 #5215 #5216)
|
||||
|
||||
g20
|
||||
(debug, unchanged after g20, expect -1 -2 -3 -4 -5 -6: #5211 #5212 #5213 #5214 #5215 #5216)
|
||||
|
||||
g92.1
|
||||
m2
|
||||
3
tests/interp/unit-conversion/test.sh
Executable file
3
tests/interp/unit-conversion/test.sh
Executable file
@@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
rs274 -g test.ngc | awk '{$1=""; print}' | sed 's/-0\.0000/0.0000/g'
|
||||
exit "${PIPESTATUS[0]}"
|
||||
Reference in New Issue
Block a user