参考所有分组:补 G4 dwell source 边界覆盖,测试通过
This commit is contained in:
@@ -298,6 +298,12 @@ done
|
||||
CNC_SIM_RS274_VAR="$var_file" \
|
||||
"$build_dir/linuxcnc_rs274_source_dump" tests/gcode/linuxcnc_program_stops.ngc \
|
||||
>"$output_dir/cnc_sim_linuxcnc_source_program_stops.json"
|
||||
# Source basis: LinuxCNC src/emc/rs274ngc/interp_check.cc treats exactly
|
||||
# P-1.0 as a missing G4 dwell P word, while interp_convert.cc convert_dwell()
|
||||
# and interp_queue.cc enqueue_DWELL() pass neighboring values through.
|
||||
CNC_SIM_RS274_VAR="$var_file" \
|
||||
"$build_dir/linuxcnc_rs274_source_dump" tests/gcode/linuxcnc_g4_dwell_boundaries.ngc \
|
||||
>"$output_dir/cnc_sim_linuxcnc_source_g4_dwell_boundaries.json"
|
||||
CNC_SIM_RS274_VAR="$var_file" \
|
||||
"$build_dir/linuxcnc_rs274_source_dump" tests/gcode/linuxcnc_coolant.ngc \
|
||||
>"$output_dir/cnc_sim_linuxcnc_source_coolant.json"
|
||||
@@ -1916,6 +1922,16 @@ for expected in [(2, 1), (3, 2), (4, 3), (4, 1), (5, 0)]:
|
||||
if expected not in stop_states:
|
||||
raise SystemExit(f"missing source-linked program stop state {expected!r}")
|
||||
|
||||
g4_boundaries = load("cnc_sim_linuxcnc_source_g4_dwell_boundaries.json")
|
||||
g4_dwell_states = [
|
||||
(event["line"], event["dwellSeconds"])
|
||||
for event in g4_boundaries
|
||||
if event["type"] == "dwell"
|
||||
]
|
||||
expected_g4_dwell_states = [(4, -1.001), (5, -0.9999), (6, 3)]
|
||||
if g4_dwell_states != expected_g4_dwell_states:
|
||||
raise SystemExit(f"unexpected source-linked G4 dwell boundary states: {g4_dwell_states!r}")
|
||||
|
||||
coolant = json.loads((OUTPUT_DIR / "cnc_sim_linuxcnc_source_coolant.json").read_text())
|
||||
coolant_states = [
|
||||
(event["line"], event["reserved"])
|
||||
|
||||
Reference in New Issue
Block a user