diff --git a/src/widgets/plotwidget.h b/src/widgets/plotwidget.h --- a/src/widgets/plotwidget.h +++ b/src/widgets/plotwidget.h @@ -66,7 +66,7 @@ * @brief set The Maximum Number of points per series the plot widget stores * @param newMax: new maximum Number (default:120) */ - void setMaximumPoints(const uint newMax); + void setMaximumPoints(const int newMax); /** * @brief set the maximum temperature shown on the plot diff --git a/src/widgets/plotwidget.cpp b/src/widgets/plotwidget.cpp --- a/src/widgets/plotwidget.cpp +++ b/src/widgets/plotwidget.cpp @@ -84,9 +84,9 @@ return _plots.keys(); } -void PlotWidget::setMaximumPoints(const uint newMax) +void PlotWidget::setMaximumPoints(const int newMax) { - m_maximumPoints = newMax; + m_maximumPoints = std::max(newMax, 0); } void PlotWidget::setMaximumTemperature(const uint maxTemp) diff --git a/testclient/main.cpp b/testclient/main.cpp --- a/testclient/main.cpp +++ b/testclient/main.cpp @@ -30,7 +30,7 @@ QCoreApplication::setOrganizationName(QStringLiteral("KDE")); QCoreApplication::setOrganizationDomain(QStringLiteral("kde.org")); - QCoreApplication::setApplicationName(QStringLiteral("AtCore - KDE Print Service")); + QCoreApplication::setApplicationName(QStringLiteral("AtCore - Test Client")); MainWindow window; window.show(); diff --git a/testclient/mainwindow.h b/testclient/mainwindow.h --- a/testclient/mainwindow.h +++ b/testclient/mainwindow.h @@ -53,7 +53,7 @@ * @param number : index of sensor * @param temp : temperature */ - void checkTemperature(uint sensorType, uint number, uint temp); + void checkTemperature(uint sensorType, uint number, float temp); private slots: //ButtonEvents diff --git a/testclient/mainwindow.cpp b/testclient/mainwindow.cpp --- a/testclient/mainwindow.cpp +++ b/testclient/mainwindow.cpp @@ -154,11 +154,13 @@ connect(printWidget, &PrintWidget::fanSpeedChanged, core, &AtCore::setFanSpeed); connect(printWidget, &PrintWidget::printSpeedChanged, this, [this](const int speed) { - core->setPrinterSpeed(speed); + std::max(1, speed); + core->setPrinterSpeed(uint(speed)); }); connect(printWidget, &PrintWidget::flowRateChanged, [this](const int rate) { - core->setFlowRate(rate); + std::max(1, rate); + core->setFlowRate(uint(rate)); }); printDock = new QDockWidget(tr("Print"), this); @@ -370,7 +372,7 @@ } -void MainWindow::checkTemperature(uint sensorType, uint number, uint temp) +void MainWindow::checkTemperature(uint sensorType, uint number, float temp) { QString msg; switch (sensorType) { @@ -400,7 +402,7 @@ } msg.append(QString::fromLatin1("[%1] : %2").arg( - QString::number(number), QString::number(temp) + QString::number(number), QString::number(double(temp), 'f', 2) )); logWidget->appendLog(msg);