diff --git a/src/plugins/grblplugin.cpp b/src/plugins/grblplugin.cpp --- a/src/plugins/grblplugin.cpp +++ b/src/plugins/grblplugin.cpp @@ -53,7 +53,10 @@ QByteArray GrblPlugin::translate(const QString &command) { + static bool isInRelativeMode = false; + QString temp = command; + //Match all G and M commands followed by one or more digits up to and include the space, //if thats followed by a letter capture any non G or M starting text //else just grab the digits that follow. @@ -72,6 +75,18 @@ temp.append(QStringLiteral("\r\n")); } } + } else if (command == QStringLiteral("G91")) { + isInRelativeMode = true; + temp = QString(); + } else if (command == QStringLiteral("G90")) { + isInRelativeMode = false; + temp = QString(); + } else if (command.contains(QStringLiteral("G1 "))) { + if (isInRelativeMode) { + temp = temp.replace(QStringLiteral("G1 "), QStringLiteral("G91 ")); + } + } else if (command.contains(QStringLiteral("M84"))) { + temp = QStringLiteral("M3 S0"); } return temp.toLocal8Bit(); } diff --git a/src/widgets/axiscontrol.cpp b/src/widgets/axiscontrol.cpp --- a/src/widgets/axiscontrol.cpp +++ b/src/widgets/axiscontrol.cpp @@ -28,7 +28,7 @@ setRect(QRect(QPoint(size * -1, size * -1), QPoint(size, size))); setZValue(size * -1); setAcceptHoverEvents(true); - setToolTip(tr("Move the hotend to the %1 by %2 units").arg(axis).arg(value)); + setToolTip(tr("Move the hotend/spindle to the %1 by %2 units").arg(axis).arg(value)); } void PieButton::setPalette(QPalette palette)