GCode Feld

This commit is contained in:
chk
2026-03-09 20:22:16 +01:00
parent f2a675a652
commit 66bce53518
2 changed files with 15 additions and 5 deletions

View File

@@ -1,13 +1,11 @@
module.exports = {
fluidnc: {
host: "fluidncred.local",
port: 80,
host: process.env.FluidNcHost || "fluidncred.local",
port: Number(process.env.FluidNcPort) || 80,
reconnectDelay: 30000
},
server: {
port: 3000
port: Number(process.env.PORT) || 3000
}
};

View File

@@ -69,6 +69,10 @@
<button onclick="jog('Z', -10)">Z -10</button>
</div>
<h2>GCode Eingabe</h2>
<input id="gcodeInput" type="text" placeholder="G0 X10 Z-5" style="width:250px; padding:5px;">
<button onclick="sendGcode()">Senden</button>
<script>
let ws;
@@ -136,6 +140,14 @@
document.getElementById("posX").textContent = x.toFixed(3);
document.getElementById("posZ").textContent = z.toFixed(3);
}
function sendGcode() {
const cmd = document.getElementById("gcodeInput").value.trim();
if (!cmd) return;
ws.send(JSON.stringify({ type: "gcode", cmd }));
}
</script>
</body>