AtCore  1.0.70
AtCore is a API to manage the serial connection between the computer and 3D Printers.
temperature.h
Go to the documentation of this file.
1 /* AtCore
2  Copyright (C) <2016>
3 
4  Authors:
5  Tomaz Canabrava <tcanabrava@kde.org>
6  Patrick José Pereira <patrickjp@kde.org>
7 
8  This library is free software; you can redistribute it and/or
9  modify it under the terms of the GNU Lesser General Public
10  License as published by the Free Software Foundation; either
11  version 2.1 of the License, or (at your option) version 3, or any
12  later version accepted by the membership of KDE e.V. (or its
13  successor approved by the membership of KDE e.V.), which shall
14  act as a proxy defined in Section 6 of version 3 of the license.
15 
16  This library is distributed in the hope that it will be useful,
17  but WITHOUT ANY WARRANTY; without even the implied warranty of
18  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  Lesser General Public License for more details.
20 
21  You should have received a copy of the GNU Lesser General Public
22  License along with this library. If not, see <http://www.gnu.org/licenses/>.
23 */
24 #pragma once
25 
26 #include <QObject>
27 
28 #include "atcore_export.h"
29 
35 class ATCORE_EXPORT Temperature : public QObject
36 {
37  Q_OBJECT
38  Q_PROPERTY(float bedTemperature READ bedTemperature NOTIFY bedTemperatureChanged)
39  Q_PROPERTY(float bedTargetTemperature READ bedTargetTemperature NOTIFY bedTargetTemperatureChanged)
40  Q_PROPERTY(float extruderTemperature READ extruderTemperature NOTIFY extruderTemperatureChanged)
41  Q_PROPERTY(float extruderTargetTemperature READ extruderTargetTemperature NOTIFY extruderTargetTemperatureChanged)
42 
43  friend class TemperatureTests;
44 
45 public:
50  explicit Temperature(QObject *parent = nullptr);
51 
55  float bedTemperature() const;
56 
60  float bedTargetTemperature() const;
61 
66  void decodeTemp(const QByteArray &msg);
67 
71  float extruderTemperature() const;
72 
76  float extruderTargetTemperature() const;
77 
78 signals:
82  void bedTemperatureChanged();
83 
87  void bedTargetTemperatureChanged();
88 
92  void extruderTemperatureChanged();
93 
97  void extruderTargetTemperatureChanged();
98 
99 protected:
103  void resetData();
104 
105 private:
107  TemperaturePrivate *d;
108 };
The Temperature class.
Definition: temperature.h:35
The TemperaturePrivate class.
Definition: temperature.cpp:35