GCode - BufferType

This commit is contained in:
ChK
2026-04-04 07:57:24 +02:00
parent 8ea33bd8df
commit ef490f1812
6 changed files with 1250 additions and 6 deletions

View File

@@ -90,7 +90,7 @@ class GCode{
if(g == undefined) return;
//console.log("GCode: Empfange GCode: " + g);
g = g.toString("utf8");
var multipleCommands = g.split(" G");
var doProcessRest = false;
@@ -98,7 +98,6 @@ class GCode{
doProcessRest = true;
g = multipleCommands[0];
}
//console.log("Command: " + g);
g = g.split(" ");
@@ -203,8 +202,7 @@ class GCode{
if(s.includes("e")){ robot.e = Number(s.substring(1, s.length));}
});
}
if(g[0] == "G92"){ // G92 - Set Position
else if(g[0] == "G92"){ // G92 - Set Position
g.forEach((s) => {
if(s.includes("X")){ robot.xMotor = Number(s.substring(1, s.length));}
if(s.includes("x")){ robot.xMotor = Number(s.substring(1, s.length));}