Emit program stop events for LinuxCNC stops
This commit is contained in:
@@ -39,6 +39,7 @@ CNC_SIM_RS274_VAR="$var_file" "$build_dir/linuxcnc_rs274_dump" tests/gcode/basic
|
||||
CNC_SIM_RS274_VAR="$var_file" "$build_dir/linuxcnc_rs274_dump" tests/gcode/linuxcnc_rtcp_controls.ngc >/tmp/cnc_sim_linuxcnc_rtcp_controls.json
|
||||
CNC_SIM_RS274_VAR="$var_file" "$build_dir/linuxcnc_rs274_dump" tests/gcode/linuxcnc_spindle_direction.ngc >/tmp/cnc_sim_linuxcnc_spindle_direction.json
|
||||
CNC_SIM_RS274_VAR="$var_file" "$build_dir/linuxcnc_rs274_dump" tests/gcode/linuxcnc_tool_number.ngc >/tmp/cnc_sim_linuxcnc_tool_number.json
|
||||
CNC_SIM_RS274_VAR="$var_file" "$build_dir/linuxcnc_rs274_dump" tests/gcode/linuxcnc_program_stops.ngc >/tmp/cnc_sim_linuxcnc_program_stops.json
|
||||
CNC_SIM_RS274_VAR="$var_file" "$build_dir/linuxcnc_rs274_dump" tests/gcode/linuxcnc_canned_cycle.ngc >/tmp/cnc_sim_linuxcnc_canned_cycle.json
|
||||
CNC_SIM_RS274_VAR="$var_file" "$build_dir/linuxcnc_rs274_dump" tests/gcode/linuxcnc_comments.ngc >/tmp/cnc_sim_linuxcnc_comments.json
|
||||
CNC_SIM_RS274_VAR="$var_file" "$build_dir/linuxcnc_rs274_dump" tests/gcode/linuxcnc_probe_no_error.ngc >/tmp/cnc_sim_linuxcnc_probe_no_error.json
|
||||
@@ -95,6 +96,16 @@ if not any(
|
||||
):
|
||||
raise SystemExit("missing M61 Q1 tool-number event line")
|
||||
|
||||
stops = json.loads(Path("/tmp/cnc_sim_linuxcnc_program_stops.json").read_text())
|
||||
stop_states = [
|
||||
(event["line"], event["reserved"])
|
||||
for event in stops
|
||||
if event["type"] == "program-end"
|
||||
]
|
||||
for expected in [(2, 1), (3, 2), (4, 3), (4, 1), (5, 0)]:
|
||||
if expected not in stop_states:
|
||||
raise SystemExit(f"missing program stop state {expected!r}")
|
||||
|
||||
cycle = json.loads(Path("/tmp/cnc_sim_linuxcnc_canned_cycle.json").read_text())
|
||||
motions = [event for event in cycle if event["type"] in {"rapid", "linear-feed"}]
|
||||
expected_cycle = [
|
||||
@@ -172,6 +183,7 @@ echo "dumped /tmp/cnc_sim_linuxcnc_basic_mill.json"
|
||||
echo "dumped /tmp/cnc_sim_linuxcnc_rtcp_controls.json"
|
||||
echo "dumped /tmp/cnc_sim_linuxcnc_spindle_direction.json"
|
||||
echo "dumped /tmp/cnc_sim_linuxcnc_tool_number.json"
|
||||
echo "dumped /tmp/cnc_sim_linuxcnc_program_stops.json"
|
||||
echo "dumped /tmp/cnc_sim_linuxcnc_canned_cycle.json"
|
||||
echo "dumped /tmp/cnc_sim_linuxcnc_comments.json"
|
||||
echo "dumped /tmp/cnc_sim_linuxcnc_probe_no_error.json"
|
||||
|
||||
Reference in New Issue
Block a user