char gcodeLine[25];
for (const auto &instr : gcode)
{
if (instr.command == "M7" || instr.command == "M8" || instr.command == "M2" || instr.command == "G21" || instr.command == "G90" || instr.command == "F1250")
{
snprintf(gcodeLine, sizeof(gcodeLine), "%s", instr.command.c_str());
}
else
{
snprintf(gcodeLine, sizeof(gcodeLine), "%s X%.2f Y%.2f", instr.command.c_str(), instr.x, instr.y);
}
// weil Du ja auch keine leere Line pushen willst
if (gcodeLine[0] != '\0')
{
gcodeQueue.push(gcodeLine);
}
}
So also?