port und so

This commit is contained in:
chk
2026-03-10 15:49:53 +01:00
parent 20e2790552
commit ab9b0919fb
7 changed files with 19 additions and 51 deletions

View File

@@ -38,7 +38,6 @@ class FluidNCClient extends EventEmitter {
});
}
// --- BASIC COMMANDS ---
sendLine(cmd) {
if (this.ws && this.ws.readyState === WebSocket.OPEN) {
this.ws.send(cmd + "\n");
@@ -58,10 +57,6 @@ class FluidNCClient extends EventEmitter {
this.sendLine(cmd);
}
setZero() {
this.sendLine("G92 X0 Y0 Z0");
}
onMessage(fn) {
this.on("message", fn);
}

View File

@@ -1,26 +0,0 @@
class StatusParser {
static parse(line){
if(!line.startsWith("<")) return null;
const stateMatch = line.match(/^<([^|]+)/);
const posMatch = line.match(/MPos:([^|]+)/);
if(!posMatch) return null;
const parts = posMatch[1].split(",");
return {
type: "status",
state: stateMatch ? stateMatch[1] : "unknown",
x: parseFloat(parts[0]),
y: parseFloat(parts[1]),
z: parseFloat(parts[2])
};
}
}
module.exports = StatusParser;