继续按 align-linuxcnc 约束:补主轴选择和 M19 校验源码覆盖,测试通过

This commit is contained in:
cnc
2026-06-02 19:47:52 +08:00
parent e875496fe0
commit 4d0cf788b1
9 changed files with 34 additions and 4 deletions

View File

@@ -200,9 +200,14 @@ CNC_SIM_RS274_VAR="$var_file" \
"$build_dir/linuxcnc_rs274_source_dump" tests/gcode/linuxcnc_io_controls.ngc \
>"$output_dir/cnc_sim_linuxcnc_source_io_controls.json"
# Source basis: LinuxCNC src/emc/rs274ngc/interp_convert.cc convert_m()
# validates M62-M68 input/output words, M61 Q tool numbers, and M19 Q wait
# values before issuing Canon output/input, tool, or spindle-orient calls.
# validates M62-M68 input/output words, M3/M4/M5/M19 spindle selectors, M61 Q
# tool numbers, and M19 Q wait values before issuing Canon output/input, tool,
# or spindle-orient calls. LinuxCNC src/emc/rs274ngc/interp_check.cc
# check_other_codes() validates M19 P/R words before conversion.
convert_m_error_cases=(
"linuxcnc_m3_spindle_dollar_out_of_range_error|Spindle (\$) number out of range in M3 Command"
"linuxcnc_m4_spindle_dollar_out_of_range_error|Spindle (\$) number out of range in M4 Command"
"linuxcnc_m5_spindle_dollar_out_of_range_error|Spindle (\$) number out of range in M5 Command"
"linuxcnc_m62_missing_p_word_error|No valid P word with M62"
"linuxcnc_m63_missing_p_word_error|No valid P word with M63"
"linuxcnc_m64_missing_p_word_error|No valid P word with M64"
@@ -213,6 +218,10 @@ convert_m_error_cases=(
"linuxcnc_m66_analog_wait_error|Can't select analog input with wait type != immediate return"
"linuxcnc_m67_missing_e_word_error|Invalid analog index with M67"
"linuxcnc_m68_missing_e_word_error|Invalid analog index with M68"
"linuxcnc_m19_spindle_dollar_out_of_range_error|Spindle (\$) number out of range in M19 Command"
"linuxcnc_m19_p_not_integer_error|P value not an integer with M19 G2 or G3"
"linuxcnc_m19_p_out_of_range_error|P value must be 0,1,or 2 with M19"
"linuxcnc_m19_r_out_of_range_error|R value must be within 0..360 with M19"
"linuxcnc_m19_zero_q_error|Q word with M19 requires a value > 0"
"linuxcnc_m61_negative_q_error|Need non-negative Q-word to specify tool number with M61"
)