diff --git a/src/core/atcore.h b/src/core/atcore.h --- a/src/core/atcore.h +++ b/src/core/atcore.h @@ -382,15 +382,15 @@ * @param arg the distance to move the axis or the place to move to depending on printer mode * @sa home(), home(uchar axis), move(QLatin1Char axis, int arg) */ - Q_INVOKABLE void move(AtCore::AXES axis, int arg); + Q_INVOKABLE void move(AtCore::AXES axis, double arg); /** * @brief move an axis of the printer * @param axis the axis to move AXES (X Y Z E ) * @param arg the distance to move the axis or the place to move to depending on printer mode * @sa home(), home(uchar axis), move(AtCore::AXES, int arg) */ - Q_INVOKABLE void move(QLatin1Char axis, int arg); + Q_INVOKABLE void move(QLatin1Char axis, double arg); /** * @brief Set the bed temperature diff --git a/src/core/atcore.cpp b/src/core/atcore.cpp --- a/src/core/atcore.cpp +++ b/src/core/atcore.cpp @@ -615,15 +615,18 @@ pushCommand(GCode::toCommand(GCode::M221, QString::number(speed))); } -void AtCore::move(AtCore::AXES axis, int arg) +void AtCore::move(AtCore::AXES axis, double arg) { const auto axisAsString = QMetaEnum::fromType().valueToKey(axis); move(QLatin1Char(axisAsString[0]), arg); } -void AtCore::move(QLatin1Char axis, int arg) +void AtCore::move(QLatin1Char axis, double arg) { - pushCommand(GCode::toCommand(GCode::G1, QStringLiteral("%1 %2").arg(axis).arg(QString::number(arg)))); + //Using QString::number(double, format, precision) + //f = 'format as [-]9.9' + //3 = use 3 decimal precision + pushCommand(GCode::toCommand(GCode::G1, QStringLiteral("%1 %2").arg(axis).arg(QString::number(arg, 'f', 3)))); } int AtCore::extruderCount() const