diff --git a/src/core/gcodecommands.cpp b/src/core/gcodecommands.cpp --- a/src/core/gcodecommands.cpp +++ b/src/core/gcodecommands.cpp @@ -102,7 +102,7 @@ case G0: case G1: case G28: - code = value1.isEmpty() ? code : code.append(QStringLiteral(" %1").arg(value1.toUpper())); + code = value1.isEmpty() ? code : code.append(QStringLiteral(" %1").arg(value1)); return code; default: diff --git a/src/widgets/commandwidget.cpp b/src/widgets/commandwidget.cpp --- a/src/widgets/commandwidget.cpp +++ b/src/widgets/commandwidget.cpp @@ -39,6 +39,11 @@ connect(newButton, &QPushButton::clicked, this, [this] { if (!lineCommand->text().isEmpty()) { + if (lineCommand->text().startsWith(QStringLiteral("g"))) { + lineCommand->setText(lineCommand->text().replace(0, 1, QStringLiteral("G"))); + } else if (lineCommand->text().startsWith(QStringLiteral("m"))) { + lineCommand->setText(lineCommand->text().replace(0, 1, QStringLiteral("M"))); + } emit commandPressed(lineCommand->text()); lineCommand->clear(); } diff --git a/testclient/mainwindow.cpp b/testclient/mainwindow.cpp --- a/testclient/mainwindow.cpp +++ b/testclient/mainwindow.cpp @@ -129,7 +129,7 @@ commandWidget = new CommandWidget; //Connect the commandPressed signal connect(commandWidget, &CommandWidget::commandPressed, [this](const QString & command) { - core->pushCommand(command.toUpper()); + core->pushCommand(command); }); //Connect the messagePressed signal connect(commandWidget, &CommandWidget::messagePressed, [this](const QString & message) {