fix: verify run path with 50ms screenshots

This commit is contained in:
wangdequan
2026-07-03 17:04:33 -04:00
parent 7a30e5f0e9
commit ed9eb3ec17
3304 changed files with 237409 additions and 80 deletions

View File

@@ -24,6 +24,7 @@ export const AXIS_BUTTON_PARITY = [
{ id: "menu-audit", action: "audit", sourceSymbol: "web parity audit", sourceLines: "collect-web-xyzbc-trt-evidence.mjs", expected: "request native/Web parity audit" },
{ id: "toolbar-estop", action: "estop", sourceSymbol: "commands.estop_clicked", sourceLines: "axis.py:2223-2229", expected: "toggle ESTOP/ESTOP_RESET" },
{ id: "toolbar-power", action: "power", sourceSymbol: "commands.onoff_clicked", sourceLines: "axis.py:2231-2241", expected: "toggle machine power" },
{ id: "toolbar-auto-manual", action: "toggle-auto-manual", sourceSymbol: "commands.ensure_manual / commands.task_mode_auto", sourceLines: "axis.py:2308-2320,2520-2531", expected: "toggle task mode between AUTO and MANUAL" },
{ id: "toolbar-load", action: "open", sourceSymbol: "commands.open_file", sourceLines: "axis.py:2243-2262", expected: "open local G-code" },
{ id: "toolbar-reload", action: "reload", sourceSymbol: "commands.reload_file", sourceLines: "axis.py:2296-2297", expected: "reload active program" },
{ id: "toolbar-run", action: "run", sourceSymbol: "commands.task_run", sourceLines: "axis.py:2308-2320", expected: "start AUTO run" },
@@ -169,6 +170,7 @@ function renderToolbar(element, state, dispatch) {
<input type="file" class="axis-file-input" data-action="OPEN_FILE" accept=".ngc,.nc,.tap,.gcode,.txt" />
${toolButton("tbtn_estop", "estop", "Emergency stop", state.machine.estopActive)}
${toolButton("tbtn_on", "power", "Machine power", state.machine.powerOn)}
${modeToggleTool(state)}
${toolButton("btn_load", "open", "Open program")}
${toolButton("btn_reload", "reload", "Reload program")}
${toolButton("btn_run", "run", "Run program")}
@@ -560,6 +562,21 @@ function smallTextTool(label, action, title) {
return `<button type="button" class="axis-tool-button axis-text-tool" data-action="${action}" title="${escapeHtml(title)}">${escapeHtml(label)}</button>`;
}
function modeToggleTool(state) {
const autoMode = state.machine?.mode === "auto";
const label = autoMode ? "MAN" : "AUTO";
const title = autoMode ? "Switch to Manual mode" : "Switch to Auto mode";
return `
<button
type="button"
class="axis-tool-button axis-mode-toggle"
data-action="toggle-auto-manual"
data-mode="${autoMode ? "auto" : "manual"}"
title="${escapeHtml(title)}"
>${label}</button>
`;
}
function menuButton(label, entries) {
return `
<div class="axis-menu">
@@ -642,8 +659,9 @@ function runAxisCommand(command, state, dispatch, root) {
const actionMap = {
estop: () => dispatch({ type: state.machine?.estopActive || state.machine?.taskState === "estop" ? "RESET" : "ESTOP" }),
power: () => dispatch({ type: "TOGGLE_POWER" }),
"toggle-auto-manual": () => dispatch({ type: "SET_MODE", mode: state.machine?.mode === "auto" ? "manual" : "auto" }),
reload: () => dispatch({ type: "RELOAD_PROGRAM" }),
run: () => dispatch({ type: "RUN" }),
run: () => dispatch({ type: "RUN_FROM_OPERATOR" }),
pause: () => dispatch({ type: "PAUSE" }),
resume: () => dispatch({ type: "RESUME" }),
step: () => dispatch({ type: "STEP" }),
@@ -652,8 +670,8 @@ function runAxisCommand(command, state, dispatch, root) {
"home-all": () => dispatch({ type: "HOME" }),
"jog-minus": () => dispatch({ type: "JOG", axis: selectedAxis, direction: -1, increment: Number(state.machine?.jogIncrement ?? 1) || 1 }),
"jog-plus": () => dispatch({ type: "JOG", axis: selectedAxis, direction: 1, increment: Number(state.machine?.jogIncrement ?? 1) || 1 }),
"touch-off": () => dispatch({ type: "RUN_MDI", command: `G10 L20 P0 ${selectedAxis.toUpperCase()}0` }),
"tool-touch-off": () => dispatch({ type: "RUN_MDI", command: "G43" }),
"touch-off": () => dispatch({ type: "RUN_MDI", command: `G10 L20 P0 ${selectedAxis.toUpperCase()}0`, manualTouchOff: true }),
"tool-touch-off": () => dispatch({ type: "RUN_MDI", command: "G43", manualTouchOff: true }),
"spindle-stop": () => dispatch({ type: "SET_SPINDLE_DIRECTION", direction: "stop" }),
"spindle-forward": () => dispatch({ type: "SET_SPINDLE_DIRECTION", direction: "forward" }),
"spindle-reverse": () => dispatch({ type: "SET_SPINDLE_DIRECTION", direction: "reverse" }),