This repository has been archived by the owner on Mar 31, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathmaterialctrlpanel.h
151 lines (106 loc) · 3.29 KB
/
materialctrlpanel.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
#ifndef MATERIALCTRLPANEL_H
#define MATERIALCTRLPANEL_H
#include <QDialog>
#include <QNetworkReply>
#include <QSizeF>
#include <QTimer>
extern int DebugFlat ;
extern QSizeF SizePercent;
namespace Ui {
class MaterialCtrlPanel;
class mTimer;
}
class mTimer : public QTimer
{
Q_OBJECT
public:
mTimer(double *_value_,QPushButton *_button_,int _addval_)
{
value=_value_;
button=_button_;
addval=_addval_;
connect(this, &mTimer::timeout, this, [=](){
if(count == 9)
{
addval *= 10;
count++;
}
else
count++;
emit mtimeout();
});
}
//传入变更值,按键以及阈值
double *value;
QPushButton *button;
double addval;
private:
int count = 0;
signals:
void mtimeout();
};
class MaterialCtrlPanel : public QDialog
{
Q_OBJECT
public:
explicit MaterialCtrlPanel(QWidget *parent = nullptr);
~MaterialCtrlPanel();
public:
void longPress(const double *maximumCount);
double Hotend = 0;
double Heatbed = 0;
double Tool = 0;
double Feedrate = 0;
double Flowrate = 0;
double FanSpeed = 0;
const double Hotend_Max = 260;
const double Heatbed_Max = 260;
const double Tool_Max = 0;
const double Feedrate_Max = 100;
const double Flowrate_Max = 100;
const double FanSpeed_Max = 255;
QString Symb_Temp = "℃";
QString Symb_Per = "%";
bool ReplyFlag = false;
private slots:
virtual void on_Btn_back_clicked();
virtual void on_Btn_Save_pressed();
virtual void on_Btn_Save_released();
virtual void on_Btn_Hotend_A_pressed();
virtual void on_Btn_Hotend_D_released();
virtual void on_Btn_Hotend_A_released();
virtual void on_Btn_Hotend_D_pressed();
virtual void on_Btn_Heatbed_A_pressed();
virtual void on_Btn_Heatbed_A_released();
virtual void on_Btn_Heatbed_D_pressed();
virtual void on_Btn_Heatbed_D_released();
virtual void on_Btn_Feedrate_A_pressed();
virtual void on_Btn_Feedrate_A_released();
virtual void on_Btn_Feedrate_D_pressed();
virtual void on_Btn_Feedrate_D_released();
virtual void on_Btn_Flowrate_A_pressed();
virtual void on_Btn_Flowrate_A_released();
virtual void on_Btn_Flowrate_D_pressed();
virtual void on_Btn_Flowrate_D_released();
virtual void TimerTimeOut();
virtual void Reply(QNetworkReply *reply);
private:
double Hotend_Target = 0;
double Heatbed_Target = 0;
double Tool_Target = 0;
double Feedrate_Target = 0;
double Flowrate_Target = 0;
double FanSpeed_Target = 0;
double number = 0;
int SettingStep = 1;
bool timerStartFlag = false;
bool firstClickedFlag = false;
mTimer *timer;
bool SettingFlag = false;
enum ReLoop {E_Temperature};
int ReLoopFlag;
Ui::MaterialCtrlPanel *ui;
QWidget *FUI;
QString StyleSheet_Temp;
};
#endif // MATERIALCTRLPANEL_H