diff --git a/src/core/atcore.h b/src/core/atcore.h --- a/src/core/atcore.h +++ b/src/core/atcore.h @@ -63,7 +63,7 @@ Q_PROPERTY(QString version READ version) Q_PROPERTY(QStringList availableFirmwarePlugins READ availableFirmwarePlugins) Q_PROPERTY(int extruderCount READ extruderCount WRITE setExtruderCount NOTIFY extruderCountChanged) - Q_PROPERTY(quint16 serialTimerInterval READ serialTimerInterval WRITE setSerialTimerInterval NOTIFY serialTimerIntervalChanged) + Q_PROPERTY(int serialTimerInterval READ serialTimerInterval WRITE setSerialTimerInterval NOTIFY serialTimerIntervalChanged) Q_PROPERTY(QStringList serialPorts READ serialPorts NOTIFY portsChanged) Q_PROPERTY(float percentagePrinted READ percentagePrinted NOTIFY printProgressChanged) Q_PROPERTY(QStringList portSpeeds READ portSpeeds) @@ -216,7 +216,7 @@ /** * @brief Return the amount of miliseconds the serialTimer is set to. 0 = Disabled */ - quint16 serialTimerInterval() const; + int serialTimerInterval() const; /** * @brief Attempt to Mount an sd card @@ -279,7 +279,7 @@ * @brief New interval between serial timer * @sa setSerialTimerInterval() */ - void serialTimerIntervalChanged(const quint16 newTime); + void serialTimerIntervalChanged(const int newTime); /** * @brief The Printer's State Changed @@ -459,9 +459,9 @@ /** * @brief Set the time between checks for new serialPorts (0 is default) - * @param newTime: Milliseconds between checks. 0 will Disable Checks. + * @param newTime: Milliseconds between checks. values <= 0 will Disable Checks. */ - void setSerialTimerInterval(const quint16 &newTime); + void setSerialTimerInterval(int newTime); /** * @brief delete file from sd card diff --git a/src/core/atcore.cpp b/src/core/atcore.cpp --- a/src/core/atcore.cpp +++ b/src/core/atcore.cpp @@ -278,16 +278,19 @@ } } -quint16 AtCore::serialTimerInterval() const +int AtCore::serialTimerInterval() const { if (d->serialTimer != nullptr) { return d->serialTimer->interval(); } return 0; } -void AtCore::setSerialTimerInterval(const quint16 &newTime) +void AtCore::setSerialTimerInterval(int newTime) { + if (newTime < 0) { + newTime = 0; + } if (!d->serialTimer) { //There is no timer. We need to create one. d->serialTimer = new QTimer(); diff --git a/src/core/gcodecommands.h b/src/core/gcodecommands.h --- a/src/core/gcodecommands.h +++ b/src/core/gcodecommands.h @@ -51,7 +51,7 @@ G130 = 130, G131, G132, G133, G161 = 161, G162 }; - Q_ENUM(GCommands); + Q_ENUM(GCommands) /** * @brief The MCommands enum @@ -107,7 +107,7 @@ M928 = 928, M997 = 997, M998, M999 }; - Q_ENUM(MCommands); + Q_ENUM(MCommands) /** * @brief Return Description of command \p gcode diff --git a/src/core/seriallayer.h b/src/core/seriallayer.h --- a/src/core/seriallayer.h +++ b/src/core/seriallayer.h @@ -76,7 +76,7 @@ * @param baud : Baud rate (115200) * @param parent : Parent */ - SerialLayer(const QString &port, uint baud, QObject *parent = nullptr); + SerialLayer(const QString &port, int32_t baud, QObject *parent = nullptr); /** * @brief Add command to be pushed diff --git a/src/core/seriallayer.cpp b/src/core/seriallayer.cpp --- a/src/core/seriallayer.cpp +++ b/src/core/seriallayer.cpp @@ -63,7 +63,7 @@ QVector _sByteCommands; //!< @param _sByteCommand: sent Messages }; -SerialLayer::SerialLayer(const QString &port, uint baud, QObject *parent) : +SerialLayer::SerialLayer(const QString &port, int32_t baud, QObject *parent) : QSerialPort(parent), d(new SerialLayerPrivate()) { setPortName(port); diff --git a/src/widgets/logwidget.cpp b/src/widgets/logwidget.cpp --- a/src/widgets/logwidget.cpp +++ b/src/widgets/logwidget.cpp @@ -72,7 +72,7 @@ helpButton->setChecked(false); helpButton->setIconSize(iconSize); helpButton->setIcon(QIcon::fromTheme(QStringLiteral("help-about"), style()->standardIcon(QStyle::SP_DialogHelpButton))); - connect(helpButton, &QToolButton::clicked, this, [this, mainStack](bool checked) { + connect(helpButton, &QToolButton::clicked, this, [mainStack](bool checked) { mainStack->setCurrentIndex(checked); }); diff --git a/src/widgets/movementwidget.h b/src/widgets/movementwidget.h --- a/src/widgets/movementwidget.h +++ b/src/widgets/movementwidget.h @@ -74,7 +74,7 @@ * @param axis: the axis to move * @param value: where to move */ - void absoluteMove(const QLatin1Char &axis, const double &value); + void absoluteMove(const QLatin1Char &axis, const double value); /** * @brief A relativeMove was requested from the AxisControl @@ -85,7 +85,7 @@ * @param axis: the axis to move. * @param value: the value to move it by. */ - void relativeMove(const QLatin1Char &axis, const double &value); + void relativeMove(const QLatin1Char &axis, const double value); private: QComboBox *comboMoveAxis = nullptr; diff --git a/src/widgets/plotwidget.h b/src/widgets/plotwidget.h --- a/src/widgets/plotwidget.h +++ b/src/widgets/plotwidget.h @@ -64,7 +64,7 @@ /** * @brief set The Maximum Number of points per series the plot widget stores - * @param newMax: new maximum Number (default:24) + * @param newMax: new maximum Number (default:120) */ void setMaximumPoints(const uint newMax); @@ -80,12 +80,12 @@ public: explicit plot() : _series(new QLineSeries()) { - }; + } ~plot() { // Series will be deleted with chart - }; + } void pushPoint(float value) { diff --git a/src/widgets/statuswidget.h b/src/widgets/statuswidget.h --- a/src/widgets/statuswidget.h +++ b/src/widgets/statuswidget.h @@ -55,7 +55,7 @@ * @brief Update the progres to the new progress * @param progress: new progress. */ - void updatePrintProgress(const float &progress); + void updatePrintProgress(const int progress); signals: void stopPressed(); diff --git a/src/widgets/statuswidget.cpp b/src/widgets/statuswidget.cpp --- a/src/widgets/statuswidget.cpp +++ b/src/widgets/statuswidget.cpp @@ -106,7 +106,7 @@ lblTime->setText(temp.addMSecs(printTime->elapsed()).toString(QStringLiteral("hh:mm:ss"))); } -void StatusWidget::updatePrintProgress(const float &progress) +void StatusWidget::updatePrintProgress(const int progress) { printingProgress->setValue(progress); if (progress >= 1) {