Axis:
{["x", "y", "z", "a", "b", "c", "u", "v", "w"].map((axis) =>
)}
@@ -53,17 +53,17 @@ function MdiControl({ action, ready }: { action: Action; ready: boolean }) {
const [command, setCommand] = useState("G0 X0");
const [history, setHistory] = useState
([]);
const submit = () => { if (!command.trim()) return; action("MDI_EXECUTE", { block: command }); setHistory((items) => [command, ...items].slice(0, 20)); };
- return ;
+ return ;
}
function DroView({ axes, state }: { axes: number[]; state: typeof INITIAL_STATE }) {
const labels = ["X", "Y", "Z", "A", "B", "C", "U", "V", "W"];
- return PositionMachineRelativeDistance to Go
{labels.slice(0, Math.max(3, axes.length)).map((label, index) => { const value = Number(axes[index] ?? 0); return
{label}
; })}
Units: mmTick: {state.tick}Hash: {state.snapshot?.state_hash?.slice(0, 12) || "-"}
;
+ return PositionMachineRelativeDistance to Go
{labels.slice(0, Math.max(3, axes.length)).map((label, index) => { const value = Number(axes[index] ?? 0); return
{label}
; })}
Units: mmTick: {state.tick}Hash: {state.snapshot?.state_hash?.slice(0, 12) || "-"}
;
}
function ProgramPane({ text, setText, activeGcodes, onLoad, onRun, onStep, ready }: { text: string; setText: (text: string) => void; activeGcodes: string; onLoad: () => void; onRun: () => void; onStep: () => void; ready: boolean }) {
const lines = text.split("\n");
- return {lines.map((_, index) => {index + 1})}
;
+ return {lines.map((_, index) => {index + 1})}
;
}
export function App() {
@@ -97,14 +97,14 @@ export function App() {
const taskState = String(state.task?.state ?? state.status).toUpperCase();
const toolNumber = String((state.devices as Record | null)?.tool?.current ?? state.snapshot?.tool?.current ?? 0);
const position = `X${Number(axes[0] ?? 0).toFixed(3)} Y${Number(axes[1] ?? 0).toFixed(3)} Z${Number(axes[2] ?? 0).toFixed(3)}`;
- return
-
AXISLinuxCNC Web/WASM {state.status.toUpperCase()}
-
- execute("ESTOP", { active: true })} pressed={state.status === "blocked"} /> execute("IO_RECOVER")} /> setProgramText(DEFAULT_PROGRAM)} /> execute("PROGRAM_STEP")} /> execute(state.status === "paused" ? "PROGRAM_RESUME" : "PROGRAM_PAUSE")} /> setBlockDelete((value) => !value)} /> setOptionalStop((value) => !value)} /> setZoom((value) => Math.min(2, value + .2))} /> setZoom((value) => Math.max(.5, value - .2))} /> { setView("z"); setRightTab("preview"); }} /> { setView("z2"); setRightTab("preview"); }} /> { setView("x"); setRightTab("preview"); }} /> { setView("y"); setRightTab("preview"); }} /> { setView("y2"); setRightTab("preview"); }} /> { setView("p"); setRightTab("preview"); }} /> setRotateMode((value) => !value)} /> setCommandStatus("Live plot cleared")} />
- Load case{caseStatus}{commandStatus}
- {leftTab === "manual" ?
:
}
{rightTab === "preview" ?
:
}
+ return
+
AXISLinuxCNC Web/WASM {state.status.toUpperCase()}
+
+ execute("ESTOP", { active: true })} pressed={state.status === "blocked"} /> execute("IO_RECOVER")} /> setProgramText(DEFAULT_PROGRAM)} /> execute("PROGRAM_STEP")} /> execute(state.status === "paused" ? "PROGRAM_RESUME" : "PROGRAM_PAUSE")} /> setBlockDelete((value) => !value)} /> setOptionalStop((value) => !value)} /> setZoom((value) => Math.min(2, value + .2))} /> setZoom((value) => Math.max(.5, value - .2))} /> { setView("z"); setRightTab("preview"); }} /> { setView("z2"); setRightTab("preview"); }} /> { setView("x"); setRightTab("preview"); }} /> { setView("y"); setRightTab("preview"); }} /> { setView("y2"); setRightTab("preview"); }} /> { setView("p"); setRightTab("preview"); }} /> setRotateMode((value) => !value)} /> setCommandStatus("Live plot cleared")} />
+ Load case{caseStatus}{commandStatus}
+
execute("PROGRAM_LOAD", { source: programText, path: "main.ngc" })} onRun={runProgram} onStep={() => execute("PROGRAM_STEP")} ready={ready} />
-
+
;
}