按建议,继续完成后续工作

结论:tool_table_setup 已通过专用 rs274 -t 工具表和毫米单位 INI 纳入 upstream side-by-side baseline,完整 native probes 验证通过。
This commit is contained in:
2026-06-07 23:32:35 +08:00
parent 389a9db0e3
commit 742bae7f09
3 changed files with 58 additions and 16 deletions

View File

@@ -31,6 +31,7 @@ FIXTURES=(
spindle_orient
state_tag_motion
threading_sync
tool_table_setup
tool_reload
)
@@ -41,6 +42,16 @@ fi
TMP_DIR="$(mktemp -d)"
trap 'rm -rf "$TMP_DIR"' EXIT
TOOL_TABLE_BASELINE="$TMP_DIR/tool_table_setup.tbl"
cat > "$TOOL_TABLE_BASELINE" <<'TOOL_TABLE'
T0 P0 ; no tool
T2 P2 Z1.25 D0.25 ; standalone fixture tool 2
TOOL_TABLE
TOOL_TABLE_INI="$TMP_DIR/tool_table_setup.ini"
cat > "$TOOL_TABLE_INI" <<'TOOL_INI'
[TRAJ]
LINEAR_UNITS = mm
TOOL_INI
normalize_standalone_events() {
awk '
@@ -250,6 +261,19 @@ normalize_standalone_events() {
next
}
if (line ~ /^SET_TOOL_TABLE_ENTRY /) {
split(line, fields, /[[:space:]]+/)
for (i in fields) {
split(fields[i], pair, "=")
values[pair[1]] = pair[2]
}
print "SET_TOOL_TABLE_ENTRY|" values["toolno"] "|" norm(values["x"]) "|" \
norm(values["y"]) "|" norm(values["z"]) "|" \
norm(values["frontangle"]) "|" norm(values["backangle"]) "|" values["orientation"]
delete values
next
}
if (line ~ /^START_SPEED_FEED_SYNCH /) {
split(line, fields, /[[:space:]]+/)
for (i in fields) {
@@ -571,6 +595,17 @@ normalize_upstream_rs274_output() {
next
}
if (line ~ /^SET_TOOL_TABLE_ENTRY\(/) {
args = args_of(line)
split(args, values, ",")
gsub(/[[:space:]]+/, " ", values[3])
split(trim(values[3]), offset, " ")
print "SET_TOOL_TABLE_ENTRY|" trim(values[2]) "|" norm(offset[1]) "|" \
norm(offset[2]) "|" norm(offset[3]) "|" \
norm(values[4]) "|" norm(values[5]) "|" trim(values[6])
next
}
if (line ~ /^START_SPEED_FEED_SYNC\(/) {
args = args_of(line)
split(args, values, ",")
@@ -725,7 +760,11 @@ for name in "${FIXTURES[@]}"; do
fi
set +e
"$UPSTREAM_RS274" -g "$gcode_file" > "$native_raw" 2>&1
if [[ "$name" == "tool_table_setup" ]]; then
"$UPSTREAM_RS274" -g -i "$TOOL_TABLE_INI" -t "$TOOL_TABLE_BASELINE" "$gcode_file" > "$native_raw" 2>&1
else
"$UPSTREAM_RS274" -g "$gcode_file" > "$native_raw" 2>&1
fi
rs274_rc=$?
set -e