Align pause resume and abort lifecycle

This commit is contained in:
2026-09-01 21:12:52 +08:00
parent 3dcd2d681f
commit 1342cff3f0
5 changed files with 56 additions and 28 deletions

View File

@@ -50,6 +50,13 @@ for (const [kind, payload, reason] of [["HOME", { all: true }, "xyzac_interp_run
assert.equal(blocked.payload.gate_reason, reason, kind);
}
assert.equal(send("PROGRAM_PAUSE").payload.task.state, "PAUSED");
const abortedWhilePaused = send("PROGRAM_ABORT");
assert.equal(abortedWhilePaused.payload.task.state, "STOPPED");
assert.equal(abortedWhilePaused.payload.task.program_status, "aborted");
assert.equal(abortedWhilePaused.payload.wasm_motion.state.queue_depth, 0);
assert.equal(send("PROGRAM_RESTART").payload.task.program_status, "loaded");
assert.equal(send("PROGRAM_RUN").payload.task.state, "RUNNING");
assert.equal(send("PROGRAM_PAUSE").payload.task.state, "PAUSED");
assert.equal(send("PROGRAM_RESUME").payload.task.state, "RUNNING");
assert.equal(send("POWER", { active: false }).payload.task.state, "STOPPED");
assert.equal(send("POWER", { active: true }).payload.panel_snapshot.axis_state.machine_state, "ON");