Lock AXIS panel contract to source behavior
This commit is contained in:
@@ -30,13 +30,14 @@ const loaded = send("PROGRAM_LOAD", { source, path: "live-path.ngc" });
|
||||
assert.equal(loaded.kind, "COMMAND_RESULT");
|
||||
const loadEpoch = epoch(loaded);
|
||||
const previewCount = loaded.payload.panel_snapshot.visual.toolpath.length;
|
||||
assert.ok(loadEpoch > 0 && previewCount > 0);
|
||||
assert.equal(loadEpoch, 0);
|
||||
assert.ok(previewCount > 0);
|
||||
send("POWER", { active: true });
|
||||
send("HOME", { all: true });
|
||||
|
||||
const run = send("PROGRAM_RUN");
|
||||
const runEpoch = epoch(run);
|
||||
assert.equal(runEpoch, loadEpoch + 1);
|
||||
assert.equal(runEpoch, loadEpoch);
|
||||
send("SIM_STEP", { cycles: 5, response: "motion_delta" });
|
||||
const pause = send("PROGRAM_PAUSE");
|
||||
assert.equal(epoch(pause), runEpoch);
|
||||
@@ -55,15 +56,17 @@ assert.equal(epoch(completed), runEpoch);
|
||||
assert.equal(Object.hasOwn(completed.payload.panel_snapshot.visual, "toolpath"), false);
|
||||
|
||||
const rerun = send("PROGRAM_RUN");
|
||||
assert.equal(epoch(rerun), runEpoch + 1);
|
||||
assert.equal(epoch(rerun), runEpoch);
|
||||
const abort = send("PROGRAM_ABORT");
|
||||
assert.equal(epoch(abort), runEpoch + 1);
|
||||
assert.equal(epoch(abort), runEpoch);
|
||||
|
||||
const replacement = send("PROGRAM_LOAD", { source: "G21\nG90\nG1 X1 Y1 Z1 F300\nM2\n", path: "replacement-live-path.ngc" });
|
||||
assert.equal(epoch(replacement), runEpoch + 2);
|
||||
assert.equal(epoch(replacement), runEpoch);
|
||||
assert.equal(replacement.payload.panel_snapshot.visual.toolpath.length, 1);
|
||||
const restart = send("PROGRAM_RESTART");
|
||||
assert.equal(epoch(restart), runEpoch);
|
||||
const clear = send("VISUAL_CLEAR");
|
||||
assert.equal(epoch(clear), runEpoch + 3);
|
||||
assert.equal(epoch(clear), runEpoch + 1);
|
||||
assert.equal(clear.payload.panel_snapshot.visual.toolpath.length, 1);
|
||||
assert.equal(session.previewState.segments.length, 1);
|
||||
|
||||
@@ -71,6 +74,6 @@ console.log(JSON.stringify({
|
||||
schema: "xyzac-live-path-lifecycle.v1",
|
||||
status: "verified",
|
||||
source: "axis.py:LivePlotter/clear_live_plot/task_pause/task_resume/task_stop",
|
||||
epochs: { load: loadEpoch, run: runEpoch, pause: epoch(pause), resume: epoch(resume), completed: epoch(completed), rerun: epoch(rerun), abort: epoch(abort), replacement: epoch(replacement), clear: epoch(clear) },
|
||||
epochs: { load: loadEpoch, run: runEpoch, pause: epoch(pause), resume: epoch(resume), completed: epoch(completed), rerun: epoch(rerun), abort: epoch(abort), replacement: epoch(replacement), restart: epoch(restart), clear: epoch(clear) },
|
||||
static_preview: { initial_segments: previewCount, clear_plot_segments: clear.payload.panel_snapshot.visual.toolpath.length },
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user