Add LinuxCNC cutter compensation coverage
This commit is contained in:
@@ -106,6 +106,9 @@ CNC_SIM_RS274_VAR="$var_file" \
|
||||
CNC_SIM_RS274_VAR="$var_file" \
|
||||
"$build_dir/linuxcnc_rs274_source_dump" tests/gcode/linuxcnc_canned_cycles_extended.ngc \
|
||||
>/tmp/cnc_sim_linuxcnc_source_canned_cycles_extended.json
|
||||
CNC_SIM_RS274_VAR="$var_file" \
|
||||
"$build_dir/linuxcnc_rs274_source_dump" tests/gcode/linuxcnc_cutter_comp.ngc \
|
||||
>/tmp/cnc_sim_linuxcnc_source_cutter_comp.json
|
||||
CNC_SIM_RS274_FILE_MODE=1 CNC_SIM_RS274_VAR="$var_file" \
|
||||
"$build_dir/linuxcnc_rs274_source_dump" tests/gcode/smoke_oword_subprogram.ngc \
|
||||
>/tmp/cnc_sim_linuxcnc_source_oword_subprogram.json
|
||||
@@ -188,6 +191,28 @@ if not any(
|
||||
):
|
||||
raise SystemExit("missing source-linked G83 final retract to R plane")
|
||||
|
||||
cutter_comp = json.loads(Path("/tmp/cnc_sim_linuxcnc_source_cutter_comp.json").read_text())
|
||||
cutter_comp_motions = [
|
||||
event
|
||||
for event in cutter_comp
|
||||
if event["type"] in {"rapid", "linear-feed", "arc-feed"}
|
||||
]
|
||||
expected_cutter_comp = [
|
||||
("rapid", 2, 0, 0),
|
||||
("linear-feed", 6, 17, 3),
|
||||
("linear-feed", 7, 17, 20),
|
||||
("linear-feed", 8, 0, 0),
|
||||
("linear-feed", 11, 17, -3),
|
||||
("linear-feed", 12, 17, -20),
|
||||
("linear-feed", 13, 0, 0),
|
||||
]
|
||||
actual_cutter_comp = [
|
||||
(event["type"], event["line"], event["end"]["x"], event["end"]["y"])
|
||||
for event in cutter_comp_motions
|
||||
]
|
||||
if actual_cutter_comp != expected_cutter_comp:
|
||||
raise SystemExit(f"unexpected source-linked cutter compensation path: {actual_cutter_comp!r}")
|
||||
|
||||
oword = json.loads(Path("/tmp/cnc_sim_linuxcnc_source_oword_subprogram.json").read_text())
|
||||
if not any(
|
||||
event["type"] == "linear-feed" and
|
||||
@@ -219,4 +244,5 @@ echo "dumped /tmp/cnc_sim_linuxcnc_source_basic_mill.json"
|
||||
echo "dumped /tmp/cnc_sim_linuxcnc_source_rtcp_controls.json"
|
||||
echo "dumped /tmp/cnc_sim_linuxcnc_source_canned_cycle.json"
|
||||
echo "dumped /tmp/cnc_sim_linuxcnc_source_canned_cycles_extended.json"
|
||||
echo "dumped /tmp/cnc_sim_linuxcnc_source_cutter_comp.json"
|
||||
echo "dumped /tmp/cnc_sim_linuxcnc_source_oword_subprogram.json"
|
||||
|
||||
Reference in New Issue
Block a user