Remove duplicate preview HUD overlays

This commit is contained in:
2026-09-11 10:20:04 +08:00
parent 07d53a705c
commit 021e688b6e
4 changed files with 4 additions and 18 deletions

View File

@@ -5,8 +5,6 @@ import * as THREE from "three";
import { buildXyzacMachine, buildXyzbcMachine } from "./xyzac-machine-model.ts";
const source = await readFile(new URL("./XyzacMachineView.tsx", import.meta.url), "utf8") + await readFile(new URL("./xyzac-machine-model.ts", import.meta.url), "utf8");
const panelSource = await readFile(new URL("./XyzacTrtPanel.tsx", import.meta.url), "utf8");
const toolSource = await readFile(new URL("./XyzacToolPreview.tsx", import.meta.url), "utf8");
const adapter = await readFile(new URL("./xyzac-visual-adapter.ts", import.meta.url), "utf8");
const snapshot = {
schema: "axis-panel-snapshot.v1",
@@ -47,11 +45,7 @@ assert.deepEqual(XYZAC_MACHINE_GROUPS, ["xyzac-machine", "table-x", "saddle-y",
for (const token of ["table-x", "saddle-y", "spindle-z", "tilt-a", "rotate-c", "tool-offset", "tableX.position.x = -tableXJoint * MM", "saddle.position.z = -saddleYJoint * MM", "zslide.position.y = (200 - spindleZJoint) * MM", "tilt.rotation.x = -tiltAJoint * DEG", "rotate.rotation.y = -rotateCJoint * DEG", "tool.position.y = -state.offsets.tool_offset * MM", "data-xyzac-tick", "data-xyzac-state-hash", "data-xyzac-active-segment", "data-xyzac-joints", "data-xyzac-offsets"]) assert.ok(source.includes(token), token);
for (const forbidden of [/accept\s*\(/, /postMessage\s*\(/, /_sim_/, /_malloc/, /navigator\.storage/, /HAL_SET/, /KINEMATICS_SELECT/]) assert.equal(forbidden.test(source), false, String(forbidden));
assert.ok(adapter.includes("source: \"linuxcnc-wasm-worker\""));
for (const token of ["J0", "J1", "J2", "J3", "J4"]) {
assert.ok(panelSource.includes("J{index}"), "panel joint label template");
assert.ok(toolSource.includes(token), `tool preview ${token}`);
assert.ok(source.includes("J${index}"), "machine preview joint label template");
}
assert.equal(source.includes("axis-preview-hud xyzac-machine-hud"), false, "machine preview HUD must stay empty");
const close = (actual, expected) => assert.ok(Math.abs(actual - expected) < 1e-7, `${actual} != ${expected}`);
const model = buildXyzacMachine();
const xyzbcModel = buildXyzbcMachine();