Changeset View
Changeset View
Standalone View
Standalone View
src/gcodecommands.cpp
Show First 20 Lines • Show All 503 Lines • ▼ Show 20 Line(s) | 126 | { | |||
---|---|---|---|---|---|
504 | 504 | | |||
505 | } | 505 | } | ||
506 | } | 506 | } | ||
507 | 507 | | |||
508 | QString GCode::toCommand(MCommands gcode, const QString &value1, const QString &value2) | 508 | QString GCode::toCommand(MCommands gcode, const QString &value1, const QString &value2) | ||
509 | { | 509 | { | ||
510 | 510 | | |||
511 | switch (gcode) { | 511 | switch (gcode) { | ||
512 | case M84: { | ||||
513 | if (!value1.isEmpty()) { | ||||
514 | return QStringLiteral("M84 S%1").arg(value1); | ||||
515 | } | ||||
patrickelectric: don't need this else. | |||||
Unfortunately sending M84 S0 causes the firmware to not disable the hold. I Did test first without it but had to add it after testing. rizzitello: Unfortunately sending M84 S0 causes the firmware to not disable the hold. I Did test first… | |||||
patrickelectric: If you return in the first if, you'll not need a else.. | |||||
rizzitello: Sorry I misunderstood what you ment by that. | |||||
516 | return QStringLiteral("M84"); | ||||
517 | } | ||||
512 | case M104: { | 518 | case M104: { | ||
513 | if (!value2.isEmpty()) { | 519 | if (!value2.isEmpty()) { | ||
514 | return QStringLiteral("M104 P%1 S%2").arg(value1).arg(value2); | 520 | return QStringLiteral("M104 P%1 S%2").arg(value1).arg(value2); | ||
515 | } else if (!value1.isEmpty()) { | 521 | } else if (!value1.isEmpty()) { | ||
516 | return QStringLiteral("M104 S%1").arg(value1); | 522 | return QStringLiteral("M104 S%1").arg(value1); | ||
517 | } else { | 523 | } else { | ||
518 | return QObject::tr("ERROR! M104: It's obligatory to have an argument"); | 524 | return QObject::tr("ERROR! M104: It's obligatory to have an argument"); | ||
519 | } | 525 | } | ||
▲ Show 20 Lines • Show All 70 Lines • Show Last 20 Lines |
don't need this else.