diff --git a/src/widgets/CMakeLists.txt b/src/widgets/CMakeLists.txt --- a/src/widgets/CMakeLists.txt +++ b/src/widgets/CMakeLists.txt @@ -5,7 +5,6 @@ gcodeeditorwidget.cpp bedextruderwidget.cpp pushgcodewidget.cpp - ratescontrolwidget.cpp videomonitorwidget.cpp atcoreinstancewidget.cpp thermowidget.cpp diff --git a/src/widgets/atcoreinstancewidget.h b/src/widgets/atcoreinstancewidget.h --- a/src/widgets/atcoreinstancewidget.h +++ b/src/widgets/atcoreinstancewidget.h @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -79,6 +80,7 @@ PlotWidget *m_plotWidget; SdWidget *m_sdWidget; StatusWidget *m_statusWidget; + PrintWidget *m_printWidget; void initConnectsToAtCore(); void printFile(const QUrl& fileName); void pausePrint(); diff --git a/src/widgets/atcoreinstancewidget.cpp b/src/widgets/atcoreinstancewidget.cpp --- a/src/widgets/atcoreinstancewidget.cpp +++ b/src/widgets/atcoreinstancewidget.cpp @@ -42,6 +42,9 @@ m_plotWidget = new PlotWidget(); ui->controlTabLayout->addWidget(m_plotWidget); + m_printWidget = new PrintWidget(false); + ui->advancedTabLayout->insertWidget(0, m_printWidget); + m_logWidget = new LogWidget(new QTemporaryFile(QDir::tempPath() + QStringLiteral("/Atelier_"))); ui->advancedTabLayout->addWidget(m_logWidget); @@ -197,6 +200,8 @@ emit(connectionChanged(profileData["name"].toString())); ui->bedExtWidget->setBedMaxTemperature(profileData["bedTemp"].toInt()); ui->bedExtWidget->setExtruderMaxTemperature(profileData["hotendTemp"].toInt()); + //AddFan Support to profile + m_printWidget->updateFanCount(2); } } else { m_core.closeConnection(); @@ -252,9 +257,9 @@ }); // Fan, Flow and Speed management - connect(ui->ratesControlWidget, &RatesControlWidget::fanSpeedChanged, &m_core, &AtCore::setFanSpeed); - connect(ui->ratesControlWidget, &RatesControlWidget::flowRateChanged, &m_core, &AtCore::setFlowRate); - connect(ui->ratesControlWidget, &RatesControlWidget::printSpeedChanged, &m_core, &AtCore::setPrinterSpeed); + connect(m_printWidget, &PrintWidget::fanSpeedChanged, &m_core, &AtCore::setFanSpeed); + connect(m_printWidget, &PrintWidget::flowRateChanged, &m_core, &AtCore::setFlowRate); + connect(m_printWidget, &PrintWidget::printSpeedChanged, &m_core, &AtCore::setPrinterSpeed); connect(m_axisControl, &AxisControl::clicked, this, &AtCoreInstanceWidget::axisControlClicked); //Sd Card Stuff diff --git a/src/widgets/atcoreinstancewidget.ui b/src/widgets/atcoreinstancewidget.ui --- a/src/widgets/atcoreinstancewidget.ui +++ b/src/widgets/atcoreinstancewidget.ui @@ -41,9 +41,6 @@ Advanced - - - @@ -70,12 +67,6 @@
pushgcodewidget.h
1 - - RatesControlWidget - QWidget -
ratescontrolwidget.h
- 1 -
diff --git a/src/widgets/ratescontrolwidget.h b/src/widgets/ratescontrolwidget.h deleted file mode 100644 --- a/src/widgets/ratescontrolwidget.h +++ /dev/null @@ -1,40 +0,0 @@ -/* Atelier KDE Printer Host for 3D Printing - Copyright (C) <2017> - Author: Lays Rodrigues - laysrodriguessilva@gmail.com - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ -#pragma once - -#include - -namespace Ui { -class RatesControlWidget; -} - -class RatesControlWidget : public QWidget -{ - Q_OBJECT - -public: - explicit RatesControlWidget(QWidget *parent = nullptr); - ~RatesControlWidget(); -signals: - void flowRateChanged(int value); - void printSpeedChanged(int value); - void fanSpeedChanged(int value, uint fan = 0); - -private: - Ui::RatesControlWidget *ui; -}; diff --git a/src/widgets/ratescontrolwidget.cpp b/src/widgets/ratescontrolwidget.cpp deleted file mode 100644 --- a/src/widgets/ratescontrolwidget.cpp +++ /dev/null @@ -1,41 +0,0 @@ -/* Atelier KDE Printer Host for 3D Printing - Copyright (C) <2017> - Author: Lays Rodrigues - laysrodriguessilva@gmail.com - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ -#include "ratescontrolwidget.h" -#include "ui_ratescontrolwidget.h" - -RatesControlWidget::RatesControlWidget(QWidget *parent) : - QWidget(parent), - ui(new Ui::RatesControlWidget) -{ - ui->setupUi(this); - connect(ui->flowRateSB, static_cast(&QDoubleSpinBox::valueChanged), [ this ](float value){ - emit flowRateChanged(value); - }); - connect(ui->fanSpeedSB, static_cast(&QDoubleSpinBox::valueChanged), [ this ](float value){ - emit fanSpeedChanged(value); - }); - connect(ui->printSpeedSB, static_cast(&QDoubleSpinBox::valueChanged), [ this ](float value){ - emit printSpeedChanged(value); - }); - -} - -RatesControlWidget::~RatesControlWidget() -{ - delete ui; -} diff --git a/src/widgets/ratescontrolwidget.ui b/src/widgets/ratescontrolwidget.ui deleted file mode 100644 --- a/src/widgets/ratescontrolwidget.ui +++ /dev/null @@ -1,97 +0,0 @@ - - - RatesControlWidget - - - - 0 - 0 - 154 - 129 - - - - Form - - - - 3 - - - 3 - - - 3 - - - 3 - - - 3 - - - - - Print Speed - - - - - - - % - - - 0 - - - - - - - Flow Rate - - - - - - - % - - - 0 - - - - - - - Fan Speed - - - - - - - % - - - 0 - - - - - - - Rates Control - - - Qt::AlignCenter - - - - - - - -