Skip to content

Commit 7bafbcf

Browse files
committed
add a test that uses remap to introspect about interpreter spindle state
1 parent 8ee16dd commit 7bafbcf

7 files changed

Lines changed: 75 additions & 0 deletions

File tree

tests/remap/spindle/README

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Test remap's ability to introspect about spindles.

tests/remap/spindle/expected

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
executing
2+
1 N..... USE_LENGTH_UNITS(CANON_UNITS_MM)
3+
2 N..... SET_G5X_OFFSET(1, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000)
4+
3 N..... SET_G92_OFFSET(0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000)
5+
4 N..... SET_XY_ROTATION(0.0000)
6+
5 N..... SET_FEED_REFERENCE(CANON_XYZ)
7+
6 N..... ON_RESET()
8+
M500 P0 {
9+
active spindle: 0
10+
spindle speeds: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
11+
}
12+
7 N..... SET_SPINDLE_SPEED(0, 1000.0000)
13+
8 N..... START_SPINDLE_CLOCKWISE(0)
14+
M500 P1 {
15+
active spindle: 0
16+
spindle speeds: [1000.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
17+
}
18+
9 N..... SET_SPINDLE_SPEED(1, 2000.0000)
19+
10 N..... START_SPINDLE_COUNTERCLOCKWISE(1)
20+
M500 P2 {
21+
active spindle: 0
22+
spindle speeds: [1000.0, 2000.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
23+
}
24+
11 N..... SET_G5X_OFFSET(1, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000)
25+
12 N..... SET_XY_ROTATION(0.0000)
26+
13 N..... SET_FEED_MODE(0, 0)
27+
14 N..... SET_FEED_RATE(0.0000)
28+
15 N..... STOP_SPINDLE_TURNING(0)
29+
16 N..... SET_SPINDLE_MODE(0 0.0000)
30+
17 N..... STOP_SPINDLE_TURNING(1)
31+
18 N..... SET_SPINDLE_MODE(1 0.0000)
32+
19 N..... STOP_SPINDLE_TURNING(2)
33+
20 N..... SET_SPINDLE_MODE(2 0.0000)
34+
21 N..... PROGRAM_END()
35+
22 N..... ON_RESET()

tests/remap/spindle/remap.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from __future__ import print_function
2+
3+
def m500(self, **words):
4+
print("M500 P{} {{".format(int(words['p'])))
5+
print(" active spindle: ", self.active_spindle)
6+
print(" spindle speeds: ", list(self.speed))
7+
print("}")

tests/remap/spindle/test.ini

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[EMC]
2+
DEBUG=0
3+
4+
[RS274NGC]
5+
SUBROUTINE_PATH = .
6+
LOG_LEVEL=0
7+
REMAP= M500 py=m500 modalgroup=10 argspec=P
8+
9+
[TRAJ]
10+
SPINDLES=3
11+
12+
[PYTHON]
13+
PATH_PREPEND=.
14+
TOPLEVEL=toplevel.py

tests/remap/spindle/test.ngc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
M500 P0
2+
3+
S1000
4+
M3
5+
6+
M500 P1
7+
8+
S2000 $1
9+
M4 $1
10+
11+
M500 P2
12+
13+
M2

tests/remap/spindle/test.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
rs274 -i test.ini -n 0 -g test.ngc 2>&1
3+
exit $?

tests/remap/spindle/toplevel.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import interpreter
2+
import remap

0 commit comments

Comments
 (0)