参考所有分组:补 G73 G85 G86 G89 source 覆盖,测试通过
This commit is contained in:
@@ -577,6 +577,9 @@ if CNC_SIM_RS274_VAR="$var_file" \
|
||||
exit 1
|
||||
fi
|
||||
grep -q "J word missing with g87" "$output_dir/cnc_sim_linuxcnc_source_canned_cycle_g87_missing_j_error.err"
|
||||
# Source basis: LinuxCNC src/emc/rs274ngc/interp_cycles.cc
|
||||
# convert_cycle_g73()/g85()/g86()/g89() expand peck, feed-out,
|
||||
# stop/restart, dwell, and retract sequences through Canon motion.
|
||||
CNC_SIM_RS274_VAR="$var_file" \
|
||||
"$build_dir/linuxcnc_rs274_source_dump" tests/gcode/linuxcnc_canned_cycles_extended.ngc \
|
||||
>"$output_dir/cnc_sim_linuxcnc_source_canned_cycles_extended.json"
|
||||
@@ -2141,6 +2144,65 @@ expected_g87_sequence = [
|
||||
if g87_sequence != expected_g87_sequence:
|
||||
raise SystemExit(f"unexpected source-linked G87 back-boring sequence: {g87_sequence!r}")
|
||||
|
||||
g73_feed_depths = [
|
||||
event["end"]["z"]
|
||||
for event in extended_cycle
|
||||
if event["type"] == "linear-feed" and event["line"] == 15
|
||||
]
|
||||
if g73_feed_depths != [1, 0, -1, -2, -3]:
|
||||
raise SystemExit(f"unexpected source-linked G73 peck depths: {g73_feed_depths!r}")
|
||||
g73_rapid_depths = [
|
||||
event["end"]["z"]
|
||||
for event in extended_cycle
|
||||
if event["type"] == "rapid" and event["line"] == 15 and event["end"]["x"] == 70
|
||||
]
|
||||
if g73_rapid_depths != [2, 2, 1, 0, -1, 2]:
|
||||
raise SystemExit(f"unexpected source-linked G73 short-retract depths: {g73_rapid_depths!r}")
|
||||
|
||||
g85_sequence = [
|
||||
g84_signature(event)
|
||||
for event in extended_cycle
|
||||
if event["line"] == 16 and event["type"] == "linear-feed"
|
||||
]
|
||||
expected_g85_sequence = [
|
||||
("linear-feed", 80, -2),
|
||||
("linear-feed", 80, 2),
|
||||
]
|
||||
if g85_sequence != expected_g85_sequence:
|
||||
raise SystemExit(f"unexpected source-linked G85 feed-out sequence: {g85_sequence!r}")
|
||||
|
||||
g86_sequence = [
|
||||
g84_signature(event)
|
||||
for event in extended_cycle
|
||||
if event["line"] == 17 and event["type"] in {"linear-feed", "set-spindle", "dwell"}
|
||||
]
|
||||
expected_g86_sequence = [
|
||||
("linear-feed", 90, -2),
|
||||
("dwell", 0.06),
|
||||
("set-spindle", 0, 0),
|
||||
("set-spindle", 800, 1),
|
||||
]
|
||||
if g86_sequence != expected_g86_sequence:
|
||||
raise SystemExit(f"unexpected source-linked G86 stop/restart sequence: {g86_sequence!r}")
|
||||
if not any(
|
||||
event["type"] == "rapid" and event["line"] == 17 and event["end"]["x"] == 90 and event["end"]["z"] == 2
|
||||
for event in extended_cycle
|
||||
):
|
||||
raise SystemExit("missing source-linked G86 rapid retract")
|
||||
|
||||
g89_sequence = [
|
||||
g84_signature(event)
|
||||
for event in extended_cycle
|
||||
if event["line"] == 18 and event["type"] in {"linear-feed", "dwell"}
|
||||
]
|
||||
expected_g89_sequence = [
|
||||
("linear-feed", 100, -2),
|
||||
("dwell", 0.08),
|
||||
("linear-feed", 100, 2),
|
||||
]
|
||||
if g89_sequence != expected_g89_sequence:
|
||||
raise SystemExit(f"unexpected source-linked G89 dwell/feed-out sequence: {g89_sequence!r}")
|
||||
|
||||
arc_planes = json.loads((OUTPUT_DIR / "cnc_sim_linuxcnc_source_arc_planes.json").read_text())
|
||||
if not any(
|
||||
event["type"] == "arc-feed" and
|
||||
|
||||
Reference in New Issue
Block a user