diff --git a/src/gcodecommands.cpp b/src/gcodecommands.cpp --- a/src/gcodecommands.cpp +++ b/src/gcodecommands.cpp @@ -531,6 +531,12 @@ } case M107: return QStringLiteral("M107"); + case M109: + if (!value1.isEmpty()) { + return QStringLiteral("M109 S%1").arg(value1); + } else { + return QObject::tr("ERROR! M109: It's obligatory to have an argument"); + } case M112: return QStringLiteral("M112"); case M114: @@ -555,6 +561,13 @@ return QObject::tr("ERROR! M140: It's obligatory to have an argument"); } } + case M190: { + if (!value1.isEmpty()) { + return QStringLiteral("M190 S%1").arg(value1); + } else { + return QObject::tr("ERROR! M190: It's obligatory to have an argument"); + } + } case M220: { if (!value1.isEmpty()) { return QStringLiteral("M220 S%1").arg(value1); diff --git a/unittests/gcodetests.h b/unittests/gcodetests.h --- a/unittests/gcodetests.h +++ b/unittests/gcodetests.h @@ -45,13 +45,15 @@ void command_M105(); void command_M106(); void command_M107(); + void command_M109(); void command_M112(); void command_M114(); void command_M115(); void command_M116(); void command_M117(); void command_M119(); void command_M140(); + void command_M190(); void command_M220(); void command_M221(); void command_unsupportedM(); diff --git a/unittests/gcodetests.cpp b/unittests/gcodetests.cpp --- a/unittests/gcodetests.cpp +++ b/unittests/gcodetests.cpp @@ -189,6 +189,12 @@ QVERIFY(GCode::toCommand(GCode::M107) == QStringLiteral("M107")); } +void GCodeTests::command_M109() +{ + QVERIFY(GCode::toCommand(GCode::M109) == QStringLiteral("ERROR! M109: It's obligatory to have an argument")); + QVERIFY(GCode::toCommand(GCode::M109, QStringLiteral("100")) == QStringLiteral("M109 S100")); +} + void GCodeTests::command_M112() { QVERIFY(GCode::toCommand(GCode::M112) == QStringLiteral("M112")); @@ -226,6 +232,12 @@ QVERIFY(GCode::toCommand(GCode::M140, QStringLiteral("100")) == QStringLiteral("M140 S100")); } +void GCodeTests::command_M190() +{ + QVERIFY(GCode::toCommand(GCode::M190) == QStringLiteral("ERROR! M190: It's obligatory to have an argument")); + QVERIFY(GCode::toCommand(GCode::M190, QStringLiteral("100")) == QStringLiteral("M190 S100")); +} + void GCodeTests::command_M220() { QVERIFY(GCode::toCommand(GCode::M220) == QStringLiteral("ERROR! M220: It's obligatory to have an argument"));