|
@@ -47,7 +47,7 @@ static lv_obj_t *scr;
|
47
|
47
|
static lv_obj_t *labelExt1, *labelFan, *labelZpos, *labelTime;
|
48
|
48
|
static lv_obj_t *labelPause, *labelStop, *labelOperat;
|
49
|
49
|
static lv_obj_t *bar1, *bar1ValueText;
|
50
|
|
-static lv_obj_t *buttonPause, *buttonOperat, *buttonStop;
|
|
50
|
+static lv_obj_t *buttonPause, *buttonOperat, *buttonStop, *buttonExt1, *buttonExt2, *buttonBedstate, *buttonFanstate, *buttonZpos;
|
51
|
51
|
|
52
|
52
|
#if ENABLED(HAS_MULTI_EXTRUDER)
|
53
|
53
|
static lv_obj_t *labelExt2;
|
|
@@ -60,7 +60,11 @@ static lv_obj_t *buttonPause, *buttonOperat, *buttonStop;
|
60
|
60
|
enum {
|
61
|
61
|
ID_PAUSE = 1,
|
62
|
62
|
ID_STOP,
|
63
|
|
- ID_OPTION
|
|
63
|
+ ID_OPTION,
|
|
64
|
+ ID_TEMP_EXT,
|
|
65
|
+ ID_TEMP_BED,
|
|
66
|
+ ID_BABYSTEP,
|
|
67
|
+ ID_FAN
|
64
|
68
|
};
|
65
|
69
|
|
66
|
70
|
bool once_flag; // = false
|
|
@@ -100,7 +104,6 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) {
|
100
|
104
|
}
|
101
|
105
|
#endif
|
102
|
106
|
break;
|
103
|
|
-
|
104
|
107
|
case ID_STOP:
|
105
|
108
|
lv_clear_printing();
|
106
|
109
|
lv_draw_dialog(DIALOG_TYPE_STOP);
|
|
@@ -109,6 +112,24 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) {
|
109
|
112
|
lv_clear_printing();
|
110
|
113
|
lv_draw_operation();
|
111
|
114
|
break;
|
|
115
|
+ case ID_TEMP_EXT:
|
|
116
|
+ uiCfg.curTempType = 0;
|
|
117
|
+ lv_clear_printing();
|
|
118
|
+ lv_draw_preHeat();
|
|
119
|
+ break;
|
|
120
|
+ case ID_TEMP_BED:
|
|
121
|
+ uiCfg.curTempType = 1;
|
|
122
|
+ lv_clear_printing();
|
|
123
|
+ lv_draw_preHeat();
|
|
124
|
+ break;
|
|
125
|
+ case ID_BABYSTEP:
|
|
126
|
+ lv_clear_printing();
|
|
127
|
+ lv_draw_baby_stepping();
|
|
128
|
+ break;
|
|
129
|
+ case ID_FAN:
|
|
130
|
+ lv_clear_printing();
|
|
131
|
+ lv_draw_fan();
|
|
132
|
+ break;
|
112
|
133
|
}
|
113
|
134
|
}
|
114
|
135
|
|
|
@@ -118,33 +139,23 @@ void lv_draw_printing() {
|
118
|
139
|
scr = lv_screen_create(PRINTING_UI);
|
119
|
140
|
|
120
|
141
|
// Create image buttons
|
121
|
|
- lv_obj_t *buttonExt1 = lv_img_create(scr, nullptr);
|
122
|
|
- lv_img_set_src(buttonExt1, "F:/bmp_ext1_state.bin");
|
123
|
|
- lv_obj_set_pos(buttonExt1, 205, 136);
|
|
142
|
+ buttonExt1 = lv_imgbtn_create(scr, "F:/bmp_ext1_state.bin", 206, 136, event_handler, ID_TEMP_EXT);
|
124
|
143
|
|
125
|
144
|
#if HAS_MULTI_EXTRUDER
|
126
|
|
- lv_obj_t *buttonExt2 = lv_img_create(scr, nullptr);
|
127
|
|
- lv_img_set_src(buttonExt2, "F:/bmp_ext2_state.bin");
|
128
|
|
- lv_obj_set_pos(buttonExt2, 350, 136);
|
|
145
|
+ buttonExt2 = lv_imgbtn_create(scr, "F:/bmp_ext2_state.bin", 350, 136, event_handler, ID_TEMP_EXT);
|
129
|
146
|
#endif
|
130
|
147
|
|
131
|
148
|
#if HAS_HEATED_BED
|
132
|
|
- lv_obj_t *buttonBedstate = lv_img_create(scr, nullptr);
|
133
|
|
- lv_img_set_src(buttonBedstate, "F:/bmp_bed_state.bin");
|
134
|
|
- lv_obj_set_pos(buttonBedstate, 205, 186);
|
|
149
|
+ buttonBedstate = lv_imgbtn_create(scr, "F:/bmp_bed_state.bin", 206, 186, event_handler, ID_TEMP_BED);
|
135
|
150
|
#endif
|
136
|
151
|
|
137
|
|
- lv_obj_t *buttonFanstate = lv_img_create(scr, nullptr);
|
138
|
|
- lv_img_set_src(buttonFanstate, "F:/bmp_fan_state.bin");
|
139
|
|
- lv_obj_set_pos(buttonFanstate, 350, 186);
|
|
152
|
+ buttonFanstate = lv_imgbtn_create(scr, "F:/bmp_fan_state.bin", 350, 186, event_handler, ID_FAN);
|
140
|
153
|
|
141
|
154
|
lv_obj_t *buttonTime = lv_img_create(scr, nullptr);
|
142
|
155
|
lv_img_set_src(buttonTime, "F:/bmp_time_state.bin");
|
143
|
|
- lv_obj_set_pos(buttonTime, 205, 86);
|
|
156
|
+ lv_obj_set_pos(buttonTime, 206, 86);
|
144
|
157
|
|
145
|
|
- lv_obj_t *buttonZpos = lv_img_create(scr, nullptr);
|
146
|
|
- lv_img_set_src(buttonZpos, "F:/bmp_zpos_state.bin");
|
147
|
|
- lv_obj_set_pos(buttonZpos, 350, 86);
|
|
158
|
+ buttonZpos = lv_imgbtn_create(scr, "F:/bmp_zpos_state.bin", 350, 86, event_handler, ID_BABYSTEP);
|
148
|
159
|
|
149
|
160
|
buttonPause = lv_imgbtn_create(scr, uiCfg.print_state == WORKING ? "F:/bmp_pause.bin" : "F:/bmp_resume.bin", 5, 240, event_handler, ID_PAUSE);
|
150
|
161
|
buttonStop = lv_imgbtn_create(scr, "F:/bmp_stop.bin", 165, 240, event_handler, ID_STOP);
|
|
@@ -155,6 +166,9 @@ void lv_draw_printing() {
|
155
|
166
|
lv_group_add_obj(g, buttonPause);
|
156
|
167
|
lv_group_add_obj(g, buttonStop);
|
157
|
168
|
lv_group_add_obj(g, buttonOperat);
|
|
169
|
+ lv_group_add_obj(g, buttonPause);
|
|
170
|
+ lv_group_add_obj(g, buttonPause);
|
|
171
|
+ lv_group_add_obj(g, buttonPause);
|
158
|
172
|
}
|
159
|
173
|
#endif
|
160
|
174
|
|
|
@@ -205,18 +219,18 @@ void lv_draw_printing() {
|
205
|
219
|
}
|
206
|
220
|
|
207
|
221
|
void disp_ext_temp() {
|
208
|
|
- sprintf(public_buf_l, printing_menu.temp1, (int)thermalManager.degHotend(0), (int)thermalManager.degTargetHotend(0));
|
|
222
|
+ sprintf(public_buf_l, printing_menu.temp1, thermalManager.degHotend(0), thermalManager.degTargetHotend(0));
|
209
|
223
|
lv_label_set_text(labelExt1, public_buf_l);
|
210
|
224
|
|
211
|
225
|
#if HAS_MULTI_EXTRUDER
|
212
|
|
- sprintf(public_buf_l, printing_menu.temp1, (int)thermalManager.degHotend(1), (int)thermalManager.degTargetHotend(1));
|
|
226
|
+ sprintf(public_buf_l, printing_menu.temp1, thermalManager.degHotend(1), thermalManager.degTargetHotend(1));
|
213
|
227
|
lv_label_set_text(labelExt2, public_buf_l);
|
214
|
228
|
#endif
|
215
|
229
|
}
|
216
|
230
|
|
217
|
231
|
void disp_bed_temp() {
|
218
|
232
|
#if HAS_HEATED_BED
|
219
|
|
- sprintf(public_buf_l, printing_menu.bed_temp, (int)thermalManager.temp_bed.celsius, (int)thermalManager.temp_bed.target);
|
|
233
|
+ sprintf(public_buf_l, printing_menu.bed_temp, thermalManager.degBed(), thermalManager.degTargetBed());
|
220
|
234
|
lv_label_set_text(labelBed, public_buf_l);
|
221
|
235
|
#endif
|
222
|
236
|
}
|