Changeset View
Changeset View
Standalone View
Standalone View
src/widgets/statuswidget.h
Show All 12 Lines | 1 | /* AtCore Test Client | |||
---|---|---|---|---|---|
13 | GNU General Public License for more details. | 13 | GNU General Public License for more details. | ||
14 | 14 | | |||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License | ||
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
17 | */ | 17 | */ | ||
18 | #pragma once | 18 | #pragma once | ||
19 | #include <QLabel> | 19 | #include <QLabel> | ||
20 | #include <QProgressBar> | 20 | #include <QProgressBar> | ||
21 | #include <QSpacerItem> | ||||
21 | #include <QTimer> | 22 | #include <QTimer> | ||
22 | #include <QWidget> | 23 | #include <QWidget> | ||
23 | 24 | | |||
24 | #include "atcorewidgets_export.h" | 25 | #include "atcorewidgets_export.h" | ||
25 | /* Usage: | 26 | /* Usage: | ||
26 | * | 27 | * | ||
27 | * Create a instance of the status widget. | 28 | * Create a instance of the status widget. | ||
28 | */ | 29 | */ | ||
29 | 30 | | |||
30 | class ATCOREWIDGETS_EXPORT StatusWidget : public QWidget | 31 | class ATCOREWIDGETS_EXPORT StatusWidget : public QWidget | ||
31 | { | 32 | { | ||
32 | Q_OBJECT | 33 | Q_OBJECT | ||
33 | public: | 34 | public: | ||
34 | StatusWidget(QWidget *parent = nullptr); | 35 | /** | ||
35 | 36 | * @brief Make A new Status widget | |||
37 | * @param showStop: Set False if your client has the print job stop in another widget. | ||||
38 | * @param parent: parent of this widget. | ||||
39 | */ | ||||
40 | StatusWidget(bool showStop = true, QWidget *parent = nullptr); | ||||
41 | /** | ||||
42 | * @brief Set if the status area should show SD card inserted. | ||||
43 | * @param hasSd | ||||
44 | */ | ||||
36 | void setSD(bool hasSd); | 45 | void setSD(bool hasSd); | ||
46 | /** | ||||
47 | * @brief Set the State String | ||||
48 | * @param state: String to be shown | ||||
49 | */ | ||||
37 | void setState(const QString &state); | 50 | void setState(const QString &state); | ||
51 | /** | ||||
52 | * @brief Show or hide the Print progress and time | ||||
53 | * @param visible : true for show | ||||
54 | */ | ||||
38 | void showPrintArea(bool visible); | 55 | void showPrintArea(bool visible); | ||
56 | /** | ||||
57 | * @brief Update the progres to the new progress | ||||
58 | * @param progress: new progress. | ||||
59 | */ | ||||
39 | void updatePrintProgress(const float &progress); | 60 | void updatePrintProgress(const float &progress); | ||
40 | 61 | | |||
41 | signals: | 62 | signals: | ||
42 | void stopPressed(); | 63 | void stopPressed(); | ||
43 | 64 | | |||
44 | private slots: | 65 | private slots: | ||
45 | void updatePrintTime(); | 66 | void updatePrintTime(); | ||
46 | 67 | | |||
47 | private: | 68 | private: | ||
48 | QLabel *lblState = nullptr; | 69 | QLabel *lblState = nullptr; | ||
49 | QLabel *lblSd = nullptr; | 70 | QLabel *lblSd = nullptr; | ||
50 | QLabel *lblTime = nullptr; | 71 | QLabel *lblTime = nullptr; | ||
51 | QLabel *lblTimeLeft = nullptr; | 72 | QLabel *lblTimeLeft = nullptr; | ||
52 | QTime *printTime = nullptr; | 73 | QTime *printTime = nullptr; | ||
53 | QTimer *printTimer = nullptr; | 74 | QTimer *printTimer = nullptr; | ||
75 | QSpacerItem *spacer = nullptr; | ||||
54 | QProgressBar *printingProgress = nullptr; | 76 | QProgressBar *printingProgress = nullptr; | ||
55 | QWidget *printProgressWidget = nullptr; | 77 | QWidget *printProgressWidget = nullptr; | ||
56 | }; | 78 | }; |