参考所有分组:补 fractional N 行号 source 覆盖,测试通过
This commit is contained in:
@@ -560,6 +560,8 @@ grep -F 'convert_lathe_diameter_mode() scales G7/G8 X words and G76 I/J/K words'
|
|||||||
grep -F 'tests/gcode/linuxcnc_lathe_diameter_mode.ngc' test-native.sh >/dev/null
|
grep -F 'tests/gcode/linuxcnc_lathe_diameter_mode.ngc' test-native.sh >/dev/null
|
||||||
grep -F 'tests/gcode/linuxcnc_lathe_diameter_g76.ngc' test-native.sh >/dev/null
|
grep -F 'tests/gcode/linuxcnc_lathe_diameter_g76.ngc' test-native.sh >/dev/null
|
||||||
grep -F 'tests/gcode/linuxcnc_readonly_named_parameters.ngc' test-native.sh >/dev/null
|
grep -F 'tests/gcode/linuxcnc_readonly_named_parameters.ngc' test-native.sh >/dev/null
|
||||||
|
grep -F 'read_n_number()' test-linuxcnc-source-link.sh >/dev/null
|
||||||
|
grep -F 'tests/gcode/linuxcnc_fractional_linenumbers.ngc' test-linuxcnc-source-link.sh >/dev/null
|
||||||
|
|
||||||
for script in \
|
for script in \
|
||||||
test-native.sh \
|
test-native.sh \
|
||||||
|
|||||||
@@ -1484,6 +1484,13 @@ cp "$base_var_file" "$var_file"
|
|||||||
CNC_SIM_RS274_VAR="$var_file" \
|
CNC_SIM_RS274_VAR="$var_file" \
|
||||||
"$build_dir/linuxcnc_rs274_source_dump" tests/gcode/linuxcnc_g62_xz_nurbs.ngc \
|
"$build_dir/linuxcnc_rs274_source_dump" tests/gcode/linuxcnc_g62_xz_nurbs.ngc \
|
||||||
>"$output_dir/cnc_sim_linuxcnc_source_g62_xz_nurbs.json"
|
>"$output_dir/cnc_sim_linuxcnc_source_g62_xz_nurbs.json"
|
||||||
|
# Source basis: LinuxCNC src/emc/rs274ngc/interp_read.cc read_n_number()
|
||||||
|
# accepts and ignores the fractional suffix after an N word; execute_block()
|
||||||
|
# in src/emc/rs274ngc/interp_execute.cc still tags canon output with the
|
||||||
|
# interpreter sequence number.
|
||||||
|
CNC_SIM_RS274_VAR="$var_file" \
|
||||||
|
"$build_dir/linuxcnc_rs274_source_dump" tests/gcode/linuxcnc_fractional_linenumbers.ngc \
|
||||||
|
>"$output_dir/cnc_sim_linuxcnc_source_fractional_linenumbers.json"
|
||||||
|
|
||||||
CNC_SIM_RS274_SOURCE_OUTPUT_DIR="$output_dir" python3 - <<'PY'
|
CNC_SIM_RS274_SOURCE_OUTPUT_DIR="$output_dir" python3 - <<'PY'
|
||||||
import json
|
import json
|
||||||
@@ -1521,6 +1528,18 @@ required_motion = {
|
|||||||
check_motion("cnc_sim_linuxcnc_source_basic_motion.json", required_motion)
|
check_motion("cnc_sim_linuxcnc_source_basic_motion.json", required_motion)
|
||||||
check_motion("cnc_sim_linuxcnc_source_basic_mill.json", required_motion | {"tool-change"})
|
check_motion("cnc_sim_linuxcnc_source_basic_mill.json", required_motion | {"tool-change"})
|
||||||
|
|
||||||
|
fractional_linenumbers = load("cnc_sim_linuxcnc_source_fractional_linenumbers.json")
|
||||||
|
fractional_spindle_states = [
|
||||||
|
(event["line"], event["spindle"])
|
||||||
|
for event in fractional_linenumbers
|
||||||
|
if event["type"] == "set-spindle"
|
||||||
|
]
|
||||||
|
if fractional_spindle_states[:3] != [(1, 300), (2, 600), (3, 1200)]:
|
||||||
|
raise SystemExit(
|
||||||
|
"unexpected source-linked fractional N-word spindle sequence: "
|
||||||
|
f"{fractional_spindle_states!r}"
|
||||||
|
)
|
||||||
|
|
||||||
block_delete_off = load("cnc_sim_linuxcnc_source_block_delete_off.json")
|
block_delete_off = load("cnc_sim_linuxcnc_source_block_delete_off.json")
|
||||||
if not any(
|
if not any(
|
||||||
event["type"] == "linear-feed" and event["line"] == 2 and event["end"]["x"] == 5
|
event["type"] == "linear-feed" and event["line"] == 2 and event["end"]["x"] == 5
|
||||||
@@ -3407,3 +3426,4 @@ echo "dumped $output_dir/cnc_sim_linuxcnc_source_g92_restore.json"
|
|||||||
echo "dumped $output_dir/cnc_sim_linuxcnc_source_g52_offset.json"
|
echo "dumped $output_dir/cnc_sim_linuxcnc_source_g52_offset.json"
|
||||||
echo "dumped $output_dir/cnc_sim_linuxcnc_source_g52_xz_nurbs.json"
|
echo "dumped $output_dir/cnc_sim_linuxcnc_source_g52_xz_nurbs.json"
|
||||||
echo "dumped $output_dir/cnc_sim_linuxcnc_source_g62_xz_nurbs.json"
|
echo "dumped $output_dir/cnc_sim_linuxcnc_source_g62_xz_nurbs.json"
|
||||||
|
echo "dumped $output_dir/cnc_sim_linuxcnc_source_fractional_linenumbers.json"
|
||||||
|
|||||||
4
tests/gcode/linuxcnc_fractional_linenumbers.ngc
Normal file
4
tests/gcode/linuxcnc_fractional_linenumbers.ngc
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
S300
|
||||||
|
N1234 S600
|
||||||
|
N4567.789 S1200
|
||||||
|
M2
|
||||||
Reference in New Issue
Block a user