参考所有分组:补 G76 和 NURBS native 覆盖,测试通过
This commit is contained in:
@@ -459,6 +459,7 @@ CNC_SIM_RS274_VAR="$var_file" "$build_dir/linuxcnc_rs274_dump" tests/gcode/linux
|
||||
# #<_lathe_radius_mode>.
|
||||
CNC_SIM_RS274_FILE_MODE=1 CNC_SIM_RS274_VAR="$var_file" "$build_dir/linuxcnc_rs274_dump" tests/gcode/linuxcnc_lathe_diameter_mode.ngc >"$output_dir/cnc_sim_linuxcnc_lathe_diameter_mode.json"
|
||||
CNC_SIM_RS274_FILE_MODE=1 CNC_SIM_RS274_VAR="$var_file" "$build_dir/linuxcnc_rs274_dump" tests/gcode/linuxcnc_lathe_diameter_g76.ngc >"$output_dir/cnc_sim_linuxcnc_lathe_diameter_g76.json"
|
||||
CNC_SIM_RS274_FILE_MODE=1 CNC_SIM_RS274_VAR="$var_file" "$build_dir/linuxcnc_rs274_dump" tests/gcode/linuxcnc_g76only.ngc >"$output_dir/cnc_sim_linuxcnc_g76only.json"
|
||||
CNC_SIM_RS274_VAR="$var_file" "$build_dir/linuxcnc_rs274_dump" tests/gcode/linuxcnc_tool_number.ngc >"$output_dir/cnc_sim_linuxcnc_tool_number.json"
|
||||
# Source basis: LinuxCNC src/emc/rs274ngc/interp_convert.cc
|
||||
# convert_tool_select() and convert_m() M61 both route through
|
||||
@@ -563,6 +564,7 @@ grep -Fq "Cannot put an a in canned cycle" \
|
||||
"$output_dir/cnc_sim_linuxcnc_canned_cycle_reject_rotary_followup.err"
|
||||
CNC_SIM_RS274_VAR="$var_file" "$build_dir/linuxcnc_rs274_dump" tests/gcode/linuxcnc_canned_cycles_extended.ngc >"$output_dir/cnc_sim_linuxcnc_canned_cycles_extended.json"
|
||||
CNC_SIM_RS274_VAR="$var_file" "$build_dir/linuxcnc_rs274_dump" tests/gcode/linuxcnc_canned_cycle_planes.ngc >"$output_dir/cnc_sim_linuxcnc_canned_cycle_planes.json"
|
||||
CNC_SIM_RS274_VAR="$var_file" "$build_dir/linuxcnc_rs274_dump" tests/gcode/linuxcnc_extended_plane_cycle.ngc >"$output_dir/cnc_sim_linuxcnc_extended_plane_cycle.json"
|
||||
CNC_SIM_RS274_VAR="$var_file" "$build_dir/linuxcnc_rs274_dump" tests/gcode/linuxcnc_arc_planes.ngc >"$output_dir/cnc_sim_linuxcnc_arc_planes.json"
|
||||
CNC_SIM_RS274_VAR="$var_file" "$build_dir/linuxcnc_rs274_dump" tests/gcode/linuxcnc_arc_distance_modes.ngc >"$output_dir/cnc_sim_linuxcnc_arc_distance_modes.json"
|
||||
# Source basis: LinuxCNC src/emc/rs274ngc/interp_convert.cc convert_arc()
|
||||
@@ -916,6 +918,8 @@ cp "$base_var_file" "$var_file"
|
||||
CNC_SIM_RS274_VAR="$var_file" "$build_dir/linuxcnc_rs274_dump" tests/gcode/linuxcnc_g92_restore.ngc >"$output_dir/cnc_sim_linuxcnc_g92_restore.json"
|
||||
cp "$base_var_file" "$var_file"
|
||||
CNC_SIM_RS274_VAR="$var_file" "$build_dir/linuxcnc_rs274_dump" tests/gcode/linuxcnc_g52_offset.ngc >"$output_dir/cnc_sim_linuxcnc_g52_offset.json"
|
||||
CNC_SIM_RS274_FILE_MODE=1 CNC_SIM_RS274_VAR="$var_file" "$build_dir/linuxcnc_rs274_dump" tests/gcode/linuxcnc_g52_xz_nurbs.ngc >"$output_dir/cnc_sim_linuxcnc_g52_xz_nurbs.json"
|
||||
CNC_SIM_RS274_FILE_MODE=1 CNC_SIM_RS274_VAR="$var_file" "$build_dir/linuxcnc_rs274_dump" tests/gcode/linuxcnc_g62_xz_nurbs.ngc >"$output_dir/cnc_sim_linuxcnc_g62_xz_nurbs.json"
|
||||
CNC_SIM_RS274_NATIVE_OUTPUT_DIR="$output_dir" python3 - <<'PY'
|
||||
import json
|
||||
import os
|
||||
@@ -1198,6 +1202,21 @@ if not any(
|
||||
):
|
||||
raise SystemExit("missing G7 diameter-mode G76 taper sync pitch")
|
||||
|
||||
g76only = load("cnc_sim_linuxcnc_g76only.json")
|
||||
if not any(
|
||||
event["type"] == "comment" and
|
||||
event["line"] == 8 and
|
||||
event["reserved"] == 3301
|
||||
for event in g76only
|
||||
):
|
||||
raise SystemExit("missing native G76 speed-feed sync start in g76only fixture")
|
||||
if not any(
|
||||
event["type"] == "program-end" and
|
||||
event["line"] == 13
|
||||
for event in g76only
|
||||
):
|
||||
raise SystemExit("missing native G76-only program end")
|
||||
|
||||
tool_number = load("cnc_sim_linuxcnc_tool_number.json")
|
||||
if not any(
|
||||
event["type"] == "tool-change" and
|
||||
@@ -1442,6 +1461,31 @@ expected_plane_g87_sequence = [
|
||||
if plane_g87_sequence != expected_plane_g87_sequence:
|
||||
raise SystemExit(f"unexpected G19 G87 plane sequence: {plane_g87_sequence!r}")
|
||||
|
||||
extended_plane_cycle = load("cnc_sim_linuxcnc_extended_plane_cycle.json")
|
||||
if not any(
|
||||
event["type"] == "linear-feed" and
|
||||
event["line"] == 3 and
|
||||
event["end"]["u"] == 1 and
|
||||
event["end"]["v"] == 2 and
|
||||
event["end"]["w"] == -1
|
||||
for event in extended_plane_cycle
|
||||
):
|
||||
raise SystemExit("missing native G17.1 G81 feed along W depth axis")
|
||||
if not any(
|
||||
event["type"] == "rapid" and
|
||||
event["line"] == 3 and
|
||||
event["end"]["u"] == 1 and
|
||||
event["end"]["v"] == 2 and
|
||||
event["end"]["w"] == 1
|
||||
for event in extended_plane_cycle
|
||||
):
|
||||
raise SystemExit("missing native G17.1 G81 retract to W R plane")
|
||||
if not any(
|
||||
event["type"] == "set-plane" and event["line"] == 7 and event["plane"] == 171
|
||||
for event in extended_plane_cycle
|
||||
):
|
||||
raise SystemExit("missing native cutter-comp-active G17.1 plane selection")
|
||||
|
||||
extended_cycle = load("cnc_sim_linuxcnc_canned_cycles_extended.json")
|
||||
if not any(
|
||||
event["type"] == "linear-feed" and
|
||||
@@ -2434,6 +2478,30 @@ if g52_states != expected_g52_states:
|
||||
raise SystemExit(f"unexpected G52 shared offset sequence: {g52_states!r}")
|
||||
if not any(event["type"] == "program-end" and event["line"] == 7 for event in g52_offset):
|
||||
raise SystemExit("missing G52 offset program end line number")
|
||||
|
||||
g52_xz_nurbs = load("cnc_sim_linuxcnc_g52_xz_nurbs.json")
|
||||
if not any(
|
||||
event["type"] == "linear-feed" and
|
||||
event["line"] == 6 and
|
||||
event["plane"] == 18 and
|
||||
event["end"]["x"] == 3 and
|
||||
event["end"]["y"] == 0 and
|
||||
event["end"]["z"] == 3
|
||||
for event in g52_xz_nurbs
|
||||
):
|
||||
raise SystemExit("missing native G18/XZ NURBS endpoint mapped to X/Z axes")
|
||||
|
||||
g62_xz_nurbs = load("cnc_sim_linuxcnc_g62_xz_nurbs.json")
|
||||
if not any(
|
||||
event["type"] == "linear-feed" and
|
||||
event["line"] == 16 and
|
||||
event["plane"] == 18 and
|
||||
event["end"]["x"] == 100 and
|
||||
event["end"]["y"] == 0 and
|
||||
event["end"]["z"] == 10
|
||||
for event in g62_xz_nurbs
|
||||
):
|
||||
raise SystemExit("missing native G18/XZ G6.2 NURBS point mapped to X/Z axes")
|
||||
PY
|
||||
|
||||
echo "linuxcnc rs274 native smoke passed"
|
||||
@@ -2454,6 +2522,7 @@ echo "dumped $output_dir/cnc_sim_linuxcnc_threading_sync.json"
|
||||
echo "dumped $output_dir/cnc_sim_linuxcnc_threading_cycle.json"
|
||||
echo "dumped $output_dir/cnc_sim_linuxcnc_lathe_diameter_mode.json"
|
||||
echo "dumped $output_dir/cnc_sim_linuxcnc_lathe_diameter_g76.json"
|
||||
echo "dumped $output_dir/cnc_sim_linuxcnc_g76only.json"
|
||||
echo "dumped $output_dir/cnc_sim_linuxcnc_tool_number.json"
|
||||
echo "dumped $output_dir/cnc_sim_linuxcnc_program_stops.json"
|
||||
echo "dumped $output_dir/cnc_sim_linuxcnc_coolant.json"
|
||||
@@ -2464,6 +2533,7 @@ echo "dumped $output_dir/cnc_sim_linuxcnc_dynamic_tool_length.json"
|
||||
echo "dumped $output_dir/cnc_sim_linuxcnc_canned_cycle.json"
|
||||
echo "dumped $output_dir/cnc_sim_linuxcnc_canned_cycles_extended.json"
|
||||
echo "dumped $output_dir/cnc_sim_linuxcnc_canned_cycle_planes.json"
|
||||
echo "dumped $output_dir/cnc_sim_linuxcnc_extended_plane_cycle.json"
|
||||
echo "dumped $output_dir/cnc_sim_linuxcnc_arc_planes.json"
|
||||
echo "dumped $output_dir/cnc_sim_linuxcnc_arc_distance_modes.json"
|
||||
echo "dumped $output_dir/cnc_sim_linuxcnc_arc_center_tolerance_good_imperial.json"
|
||||
@@ -2514,3 +2584,5 @@ echo "dumped $output_dir/cnc_sim_linuxcnc_coordinate_p0.json"
|
||||
echo "dumped $output_dir/cnc_sim_linuxcnc_coordinate_select_all.json"
|
||||
echo "dumped $output_dir/cnc_sim_linuxcnc_g92_restore.json"
|
||||
echo "dumped $output_dir/cnc_sim_linuxcnc_g52_offset.json"
|
||||
echo "dumped $output_dir/cnc_sim_linuxcnc_g52_xz_nurbs.json"
|
||||
echo "dumped $output_dir/cnc_sim_linuxcnc_g62_xz_nurbs.json"
|
||||
|
||||
Reference in New Issue
Block a user