Complete 3axis tutorial native and Web/WASM parity tools

This commit is contained in:
2026-08-24 14:01:30 +08:00
parent 938654b19d
commit 7e90142b63
147 changed files with 17639 additions and 557 deletions

View File

@@ -4,6 +4,7 @@ import { SIM_CASE_CATALOG } from "../workspace/sim-case-catalog.mjs";
import { loadSimulationCase } from "../workspace/sim-case-loader.mjs";
import { WorkspaceRuntime } from "../workspace/runtime.mjs";
import { startConfiguration } from "../workspace/configuration-startup.mjs";
import { classifyMissingResources } from "../workspace/linuxcnc-source-semantics.mjs";
const fetchImpl = async (url) => {
try {
@@ -25,7 +26,7 @@ async function matrixRun() {
}
const first = startup?.diagnostics?.[0] ?? null;
const classification = bundle.status !== "ready"
? "BLOCKED_RESOURCE"
? classifyMissingResources(bundle.missing)
: startup.status === "ready"
? "TASK_READY"
: first?.code === "startup_hal_blocked"
@@ -59,7 +60,9 @@ async function matrixRun() {
const first = await matrixRun();
const second = await matrixRun();
assert.equal(first.case_count, 235);
assert.deepEqual(first.counts, { BLOCKED_HAL: 106, BLOCKED_INI: 19, BLOCKED_RESOURCE: 12, BLOCKED_STARTUP: 3, TASK_READY: 95 });
// LinuxCNC treats DISPLAY/OPEN_FILE as an optional AXIS startup hint. Missing
// HALFILEs remain BLOCKED_HAL, while genuine absent resources remain blocked.
assert.deepEqual(first.counts, { BLOCKED_HAL: 106, BLOCKED_INI: 19, BLOCKED_RESOURCE: 11, BLOCKED_STARTUP: 3, TASK_READY: 96 });
assert.deepEqual(first, second);
for (const path of [
"linuxcnc/configs/sim/axis/minimal_xyz.ini",
@@ -67,6 +70,7 @@ for (const path of [
"linuxcnc/configs/sim/axis/corexy/corexy_by_hal.ini",
"linuxcnc/configs/sim/axis/ja_tests/xz/xz.ini",
]) assert.equal(first.cases.find((row) => row.path === path).classification, "TASK_READY");
assert.equal(first.cases.find((row) => row.path.endsWith("anglejog.ini")).classification, "BLOCKED_HAL");
assert.equal(first.cases.find((row) => row.path.endsWith("histogram_demo.ini")).classification, "BLOCKED_INI");
assert.equal(first.cases.find((row) => row.path.endsWith("anglejog.ini")).classification, "BLOCKED_HAL");
assert.equal(first.cases.find((row) => row.path.endsWith("histogram_demo.ini")).classification, "BLOCKED_INI");
assert.equal(first.cases.find((row) => row.path.endsWith("craftsmancnc-axis.ini")).classification, "BLOCKED_HAL");
console.log(JSON.stringify(first));