提交 xyzbc-trt 界面与验证更新

This commit is contained in:
mes123456
2026-07-02 20:25:37 -04:00
parent 68ecd05353
commit 370c344b96
868 changed files with 275426 additions and 39640 deletions

View File

@@ -18,6 +18,7 @@ import { getFiveAxisProfile } from "../../app/src/profiles/index.js";
import { createSimulationStore } from "../../app/src/state/store.js";
import { createLinuxCncTaskHalSdk } from "../../../wasm-port/runtime/sdk/src/linuxcnc-task-hal.js";
import { buildVismachModelState, XYZBC_TRT_VISMACH_PINS } from "../../app/src/runtime/vismach-model-state.js";
import { AXIS_BUTTON_PARITY } from "../../app/src/ui/axis-shell.js";
import {
applyToolCommandSequence,
createToolRuntimeState,
@@ -222,6 +223,66 @@ assert.equal(stagedState.machineFileStaging.profileId, "xyzbc-trt");
assert.ok(stagedState.machineProject.projectRoot.startsWith("web-rtcp-5axis-xyzbc-trt-sim-plan/machines/xyzbc-trt"));
assert.ok(stagedState.machineFileStaging.gcodeSources.some((source) => source.filename === "xyzbc_switchkins.ngc"));
assert.equal(AXIS_BUTTON_PARITY.length >= 50, true);
for (const action of [
"estop",
"power",
"run-ready",
"run",
"pause",
"resume",
"step",
"stop",
"home-all",
"jog-plus",
"jog-minus",
"kins-identity",
"kins-tcp",
"kins-userk",
"clear-preview",
]) {
assert.ok(AXIS_BUTTON_PARITY.some((item) => item.action === action && item.sourceSymbol && item.sourceLines && item.expected), action);
}
const buttonStore = createSimulationStore();
buttonStore.dispatch({ type: "ESTOP" });
assert.equal(buttonStore.getState().machine.estopActive, true);
buttonStore.dispatch({ type: "RESET" });
assert.equal(buttonStore.getState().machine.taskState, "estop-reset");
buttonStore.dispatch({ type: "TOGGLE_POWER" });
assert.equal(buttonStore.getState().machine.powerOn, true);
buttonStore.dispatch({ type: "HOME" });
assert.equal(buttonStore.getState().machine.allHomed, true);
buttonStore.dispatch({ type: "SET_MODE", mode: "mdi" });
buttonStore.dispatch({ type: "RUN_MDI", command: "M428" });
assert.equal(buttonStore.getState().kinsType, "tcp-xyzbc");
buttonStore.dispatch({ type: "RUN_MDI", command: "M429" });
assert.equal(buttonStore.getState().kinsType, "identity");
buttonStore.dispatch({ type: "RUN_MDI", command: "M430" });
assert.equal(buttonStore.getState().kinsType, "userk");
buttonStore.dispatch({ type: "SET_MODE", mode: "manual" });
buttonStore.dispatch({ type: "SET_ACTIVE_JOINT", joint: 4 });
const cBeforeJog = buttonStore.getState().axisPose.c;
buttonStore.dispatch({ type: "JOG", axis: "c", direction: 1, increment: 1 });
assert.equal(buttonStore.getState().axisPose.c, cBeforeJog + 1);
const feedBefore = buttonStore.getState().feed.feedOverride;
buttonStore.dispatch({ type: "ADJUST_OVERRIDE", target: "feed", delta: 10 });
assert.equal(buttonStore.getState().feed.feedOverride, feedBefore + 10);
buttonStore.dispatch({ type: "SET_SPINDLE_DIRECTION", direction: "forward" });
assert.equal(buttonStore.getState().spindle.direction, "forward");
buttonStore.dispatch({ type: "TOGGLE_COOLANT", kind: "flood" });
assert.equal(buttonStore.getState().coolant.flood, true);
buttonStore.dispatch({ type: "SET_BLOCK_DELETE", enabled: true });
assert.equal(buttonStore.getState().gmoccapyGui.optionalBlocks, true);
buttonStore.dispatch({ type: "SET_OPTIONAL_STOP", enabled: true });
assert.equal(buttonStore.getState().gmoccapyGui.optionalStop, true);
buttonStore.dispatch({ type: "SET_IGNORE_LIMITS", enabled: true });
assert.equal(buttonStore.getState().gmoccapyGui.ignoreLimits, true);
buttonStore.dispatch({ type: "SET_VIEW", view: "x" });
assert.equal(buttonStore.getState().preview.selectedView, "x");
buttonStore.dispatch({ type: "CLEAR_PREVIEW" });
assert.equal(buttonStore.getState().preview.pathPoints, 0);
const stagingPlan = await createMachineFileStagingPlan({ profile });
assert.equal(stagingPlan.summary.remapFileCount >= 3, true);
assert.equal(stagingPlan.files.some((file) => file.sourceRel.endsWith("xyzbc.var")), true);