按建议,继续完成后续工作
结论:arc_semantics 已纳入 upstream rs274 side-by-side fixture baseline,ARC_FEED 几何参数按 LinuxCNC rs274 输出精度标准化,完整 native probes 验证通过。
This commit is contained in:
@@ -109,14 +109,14 @@ machine-session validation remain future work.
|
||||
|
||||
The current fixture expectations validate standalone behavior against both the
|
||||
vendored LinuxCNC source path and an upstream `rs274` side-by-side baseline for
|
||||
parser/conversion, offsets, feed-control, comment/logging, numbered-parameter,
|
||||
probing, spindle-orient, file-open reset, file-finish, tool-reload, and O-word
|
||||
subroutine fixtures, plus threading/rigid tap, NURBS dispatch boundaries, and
|
||||
the comparable canonical runtime edge and program-end cleanup calls. Fixtures
|
||||
that depend on standalone-only runtime adapters, HAL/INI/tool table setup,
|
||||
upstream `rs274` output gaps such as `WAIT` or hidden NURBS control-point
|
||||
detail, or richer machine session state still need dedicated native LinuxCNC
|
||||
baselines.
|
||||
parser/conversion, arc geometry, offsets, feed-control, comment/logging,
|
||||
numbered-parameter, probing, spindle-orient, file-open reset, file-finish,
|
||||
tool-reload, and O-word subroutine fixtures, plus threading/rigid tap, NURBS
|
||||
dispatch boundaries, and the comparable canonical runtime edge and program-end
|
||||
cleanup calls. Fixtures that depend on standalone-only runtime adapters,
|
||||
HAL/INI/tool table setup, upstream `rs274` output gaps such as `WAIT` or hidden
|
||||
NURBS control-point detail, or richer machine session state still need
|
||||
dedicated native LinuxCNC baselines.
|
||||
|
||||
The kinematics probes currently cover LinuxCNC identity/trivial kinematics,
|
||||
the switchable `5axiskins` XYZBCW bridge-mill model, and the TRT `xyzac`/`xyzbc`
|
||||
|
||||
@@ -67,11 +67,11 @@ semantic rewrites:
|
||||
source.
|
||||
- Fixture expectations are checked against the standalone vendored source
|
||||
path. The upstream `rs274` side-by-side baseline now covers simple motion,
|
||||
offsets, feed-control, comment/logging, numbered-parameter, probing,
|
||||
spindle-orient, file-open reset, file-finish, tool-reload, and O-word
|
||||
subroutine fixtures; it also covers threading/rigid tap, NURBS dispatch
|
||||
boundaries, and comparable canonical runtime edge and program-end cleanup
|
||||
calls. Adapter-heavy fixtures, standalone modal-state assertions, and
|
||||
arc geometry, offsets, feed-control, comment/logging, numbered-parameter,
|
||||
probing, spindle-orient, file-open reset, file-finish, tool-reload, and
|
||||
O-word subroutine fixtures; it also covers threading/rigid tap, NURBS
|
||||
dispatch boundaries, and comparable canonical runtime edge and program-end
|
||||
cleanup calls. Adapter-heavy fixtures, standalone modal-state assertions, and
|
||||
upstream `rs274` output gaps such as `WAIT` or hidden NURBS control-point
|
||||
detail still need dedicated native LinuxCNC baselines.
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ CANON_FIXTURE_DIR="$ROOT_DIR/tests/fixtures/canon"
|
||||
|
||||
FIXTURES=(
|
||||
minimal_linear
|
||||
arc_semantics
|
||||
canon_runtime_edges
|
||||
comment_logging
|
||||
coordinate_offsets
|
||||
@@ -45,6 +46,14 @@ normalize_standalone_events() {
|
||||
return sprintf("%.12g", value + 0)
|
||||
}
|
||||
|
||||
function norm_arc(value, numeric) {
|
||||
numeric = value + 0
|
||||
if (numeric > -0.00005 && numeric < 0.00005) {
|
||||
numeric = 0
|
||||
}
|
||||
return sprintf("%.4f", numeric)
|
||||
}
|
||||
|
||||
/^canon_event=/ || /^(STRAIGHT_(TRAVERSE|FEED)|SET_FEED_RATE) / {
|
||||
line = $0
|
||||
sub(/^canon_event=/, "", line)
|
||||
@@ -266,6 +275,20 @@ normalize_standalone_events() {
|
||||
next
|
||||
}
|
||||
|
||||
if (line ~ /^ARC_FEED /) {
|
||||
split(line, fields, /[[:space:]]+/)
|
||||
for (i in fields) {
|
||||
split(fields[i], pair, "=")
|
||||
values[pair[1]] = pair[2]
|
||||
}
|
||||
print "ARC_FEED|" norm_arc(values["first_end"]) "|" norm_arc(values["second_end"]) "|" \
|
||||
norm_arc(values["first_axis"]) "|" norm_arc(values["second_axis"]) "|" values["rotation"] "|" \
|
||||
norm_arc(values["axis_end_point"]) "|" norm_arc(values["a"]) "|" norm_arc(values["b"]) "|" \
|
||||
norm_arc(values["c"])
|
||||
delete values
|
||||
next
|
||||
}
|
||||
|
||||
# Upstream rs274 does not emit saicanon WAIT for the M66 case.
|
||||
if (line ~ /^WAIT /) {
|
||||
next
|
||||
@@ -366,6 +389,14 @@ normalize_upstream_rs274_output() {
|
||||
return sprintf("%.12g", value + 0)
|
||||
}
|
||||
|
||||
function norm_arc(value, numeric) {
|
||||
numeric = value + 0
|
||||
if (numeric > -0.00005 && numeric < 0.00005) {
|
||||
numeric = 0
|
||||
}
|
||||
return sprintf("%.4f", numeric)
|
||||
}
|
||||
|
||||
function trim(value) {
|
||||
sub(/^[[:space:]]+/, "", value)
|
||||
sub(/[[:space:]]+$/, "", value)
|
||||
@@ -557,6 +588,15 @@ normalize_upstream_rs274_output() {
|
||||
next
|
||||
}
|
||||
|
||||
if (line ~ /^ARC_FEED\(/) {
|
||||
args = args_of(line)
|
||||
split(args, values, ",")
|
||||
print "ARC_FEED|" norm_arc(values[1]) "|" norm_arc(values[2]) "|" norm_arc(values[3]) "|" \
|
||||
norm_arc(values[4]) "|" trim(values[5]) "|" norm_arc(values[6]) "|" norm_arc(values[7]) "|" \
|
||||
norm_arc(values[8]) "|" norm_arc(values[9])
|
||||
next
|
||||
}
|
||||
|
||||
if (line ~ /^SET_FEED_MODE\(/) {
|
||||
args = args_of(line)
|
||||
split(args, values, ",")
|
||||
@@ -695,6 +735,12 @@ for name in "${FIXTURES[@]}"; do
|
||||
|
||||
normalize_upstream_rs274_output < "$native_raw" > "$native_norm"
|
||||
normalize_standalone_events < "$expected_file" > "$expected_norm"
|
||||
if [[ "$name" == "arc_semantics" ]]; then
|
||||
grep -v '^COMMENT|' "$native_norm" > "$TMP_DIR/$name.rs274.no-comments"
|
||||
grep -v '^COMMENT|' "$expected_norm" > "$TMP_DIR/$name.expected.no-comments"
|
||||
mv "$TMP_DIR/$name.rs274.no-comments" "$native_norm"
|
||||
mv "$TMP_DIR/$name.expected.no-comments" "$expected_norm"
|
||||
fi
|
||||
if grep -Eq '^STRAIGHT_(TRAVERSE|FEED)$' "$expected_norm"; then
|
||||
sparse_ops_file="$TMP_DIR/$name.sparse_ops"
|
||||
grep -E '^STRAIGHT_(TRAVERSE|FEED)$' "$expected_norm" > "$sparse_ops_file"
|
||||
|
||||
Reference in New Issue
Block a user