提示词:补齐 G33 多主轴源链接覆盖
结论:新增 [TRAJ] SPINDLES=2 的 source-linked fixture,验证 LinuxCNC interp_convert.cc 中 G33/G33.1 带 会把 active_spindle 传入 START_SPEED_FEED_SYNCH;INI 来源为 rs274ngc_pre.cc init 读取 INI_FILE_NAME。未扩展 smoke 语义。检查通过:./test-linuxcnc-source-link.sh;./test-native.sh。
This commit is contained in:
@@ -174,6 +174,7 @@ var_file="$build_dir/rs274ngc-source.var"
|
||||
base_var_file="$build_dir/rs274ngc-source-base.var"
|
||||
ini_named_parameter_file="$(pwd)/tests/gcode/linuxcnc_ini_named_parameter.ini"
|
||||
multi_spindle_override_file="$(pwd)/tests/gcode/linuxcnc_multi_spindle_override.ini"
|
||||
multi_spindle_threading_file="$(pwd)/tests/gcode/linuxcnc_multi_spindle_threading.ini"
|
||||
output_dir="$build_dir/outputs"
|
||||
mkdir -p "$output_dir"
|
||||
cp "$linuxcnc_root/tests/halui/jogging/sim.var" "$base_var_file"
|
||||
@@ -279,6 +280,12 @@ fi
|
||||
CNC_SIM_RS274_VAR="$var_file" \
|
||||
"$build_dir/linuxcnc_rs274_source_dump" tests/gcode/linuxcnc_threading_sync.ngc \
|
||||
>"$output_dir/cnc_sim_linuxcnc_source_threading_sync.json"
|
||||
# Source basis: LinuxCNC src/emc/rs274ngc/rs274ngc_pre.cc init reads
|
||||
# [TRAJ] SPINDLES from INI_FILE_NAME, and interp_convert.cc G33/G33.1
|
||||
# assign active_spindle from the $ selector before START_SPEED_FEED_SYNCH().
|
||||
INI_FILE_NAME="$multi_spindle_threading_file" CNC_SIM_RS274_VAR="$var_file" \
|
||||
"$build_dir/linuxcnc_rs274_source_dump" tests/gcode/linuxcnc_multi_spindle_threading.ngc \
|
||||
>"$output_dir/cnc_sim_linuxcnc_source_multi_spindle_threading.json"
|
||||
CNC_SIM_RS274_VAR="$var_file" \
|
||||
"$build_dir/linuxcnc_rs274_source_dump" tests/gcode/linuxcnc_threading_cycle.ngc \
|
||||
>"$output_dir/cnc_sim_linuxcnc_source_threading_cycle.json"
|
||||
@@ -1943,6 +1950,29 @@ if not any(
|
||||
):
|
||||
raise SystemExit("missing source-linked G33.1 rigid tap motion line")
|
||||
|
||||
multi_spindle_threading = json.loads((OUTPUT_DIR / "cnc_sim_linuxcnc_source_multi_spindle_threading.json").read_text())
|
||||
multi_spindle_sync_states = [
|
||||
(event["line"], event["reserved"], event["feed"], event["tool"])
|
||||
for event in multi_spindle_threading
|
||||
if event["type"] == "comment" and event["reserved"] in {3300, 3301, 3302}
|
||||
]
|
||||
expected_multi_spindle_sync_states = [
|
||||
(6, 3301, 1, 1),
|
||||
(6, 3300, 0, 0),
|
||||
(8, 3301, 1, 1),
|
||||
(8, 3300, 0, 0),
|
||||
]
|
||||
if multi_spindle_sync_states != expected_multi_spindle_sync_states:
|
||||
raise SystemExit(
|
||||
"unexpected source-linked G33/G33.1 selected-spindle sync states: "
|
||||
f"{multi_spindle_sync_states!r}"
|
||||
)
|
||||
if not any(
|
||||
event["type"] == "linear-feed" and event["line"] == 8 and event["end"]["z"] == 0
|
||||
for event in multi_spindle_threading
|
||||
):
|
||||
raise SystemExit("missing source-linked G33.1 selected-spindle rigid tap motion line")
|
||||
|
||||
threading_cycle = json.loads((OUTPUT_DIR / "cnc_sim_linuxcnc_source_threading_cycle.json").read_text())
|
||||
if not any(
|
||||
event["type"] == "comment" and
|
||||
|
||||
2
tests/gcode/linuxcnc_multi_spindle_threading.ini
Normal file
2
tests/gcode/linuxcnc_multi_spindle_threading.ini
Normal file
@@ -0,0 +1,2 @@
|
||||
[TRAJ]
|
||||
SPINDLES = 2
|
||||
9
tests/gcode/linuxcnc_multi_spindle_threading.ngc
Normal file
9
tests/gcode/linuxcnc_multi_spindle_threading.ngc
Normal file
@@ -0,0 +1,9 @@
|
||||
G21 G90 G17
|
||||
(Source basis: LinuxCNC src/emc/rs274ngc/rs274ngc_pre.cc init reads [TRAJ] SPINDLES from INI_FILE_NAME.)
|
||||
(Source basis: LinuxCNC src/emc/rs274ngc/interp_convert.cc G33/G33.1 with $ selects active_spindle.)
|
||||
S500 M3 $1
|
||||
G0 Z5
|
||||
G33 Z0 K1 $1
|
||||
G0 Z5
|
||||
G33.1 Z0 K1 $1
|
||||
M30
|
||||
Reference in New Issue
Block a user