|
@@ -89,20 +89,18 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) {
|
89
|
89
|
disp_extru_amount();
|
90
|
90
|
break;
|
91
|
91
|
case ID_E_STEP:
|
92
|
|
- switch (ABS(uiCfg.extruStep)) {
|
93
|
|
- case 1: uiCfg.extruStep = 5; break;
|
94
|
|
- case 5: uiCfg.extruStep = 10; break;
|
95
|
|
- case 10: uiCfg.extruStep = 1; break;
|
96
|
|
- default: break;
|
|
92
|
+ switch (uiCfg.extruStep) {
|
|
93
|
+ case uiCfg.eStepMin: uiCfg.extruStep = uiCfg.eStepMed; break;
|
|
94
|
+ case uiCfg.eStepMed: uiCfg.extruStep = uiCfg.eStepMax; break;
|
|
95
|
+ case uiCfg.eStepMax: uiCfg.extruStep = uiCfg.eStepMin; break;
|
97
|
96
|
}
|
98
|
97
|
disp_ext_step();
|
99
|
98
|
break;
|
100
|
99
|
case ID_E_SPEED:
|
101
|
100
|
switch (uiCfg.extruSpeed) {
|
102
|
|
- case 1: uiCfg.extruSpeed = 10; break;
|
103
|
|
- case 10: uiCfg.extruSpeed = 20; break;
|
104
|
|
- case 20: uiCfg.extruSpeed = 1; break;
|
105
|
|
- default: break;
|
|
101
|
+ case uiCfg.eSpeedL: uiCfg.extruSpeed = uiCfg.eSpeedN; break;
|
|
102
|
+ case uiCfg.eSpeedN: uiCfg.extruSpeed = uiCfg.eSpeedH; break;
|
|
103
|
+ case uiCfg.eSpeedH: uiCfg.extruSpeed = uiCfg.eSpeedL; break;
|
106
|
104
|
}
|
107
|
105
|
disp_ext_speed();
|
108
|
106
|
break;
|
|
@@ -155,41 +153,30 @@ void lv_draw_extrusion() {
|
155
|
153
|
void disp_ext_type() {
|
156
|
154
|
if (uiCfg.extruderIndex == 1) {
|
157
|
155
|
lv_imgbtn_set_src_both(buttonType, "F:/bmp_extru2.bin");
|
158
|
|
- if (gCfgItems.multiple_language) {
|
159
|
|
- lv_label_set_text(labelType, extrude_menu.ext2);
|
160
|
|
- lv_obj_align(labelType, buttonType, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET);
|
161
|
|
- }
|
|
156
|
+ if (gCfgItems.multiple_language) lv_label_set_text(labelType, extrude_menu.ext2);
|
162
|
157
|
}
|
163
|
158
|
else {
|
164
|
159
|
lv_imgbtn_set_src_both(buttonType, "F:/bmp_extru1.bin");
|
165
|
|
- if (gCfgItems.multiple_language) {
|
166
|
|
- lv_label_set_text(labelType, extrude_menu.ext1);
|
167
|
|
- lv_obj_align(labelType, buttonType, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET);
|
168
|
|
- }
|
|
160
|
+ if (gCfgItems.multiple_language) lv_label_set_text(labelType, extrude_menu.ext1);
|
169
|
161
|
}
|
|
162
|
+ if (gCfgItems.multiple_language)
|
|
163
|
+ lv_obj_align(labelType, buttonType, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET);
|
170
|
164
|
}
|
171
|
165
|
|
172
|
166
|
void disp_ext_speed() {
|
173
|
|
- if (uiCfg.extruSpeed == 20)
|
174
|
|
- lv_imgbtn_set_src_both(buttonSpeed, "F:/bmp_speed_high.bin");
|
175
|
|
- else if (uiCfg.extruSpeed == 1)
|
176
|
|
- lv_imgbtn_set_src_both(buttonSpeed, "F:/bmp_speed_slow.bin");
|
177
|
|
- else
|
178
|
|
- lv_imgbtn_set_src_both(buttonSpeed, "F:/bmp_speed_normal.bin");
|
|
167
|
+ switch (uiCfg.extruSpeed) {
|
|
168
|
+ case uiCfg.eSpeedH: lv_imgbtn_set_src_both(buttonSpeed, "F:/bmp_speed_high.bin"); break;
|
|
169
|
+ case uiCfg.eSpeedL: lv_imgbtn_set_src_both(buttonSpeed, "F:/bmp_speed_slow.bin"); break;
|
|
170
|
+ case uiCfg.eSpeedN: lv_imgbtn_set_src_both(buttonSpeed, "F:/bmp_speed_normal.bin"); break;
|
|
171
|
+ }
|
179
|
172
|
|
180
|
173
|
if (gCfgItems.multiple_language) {
|
181
|
|
- if (uiCfg.extruSpeed == 20) {
|
182
|
|
- lv_label_set_text(labelSpeed, extrude_menu.high);
|
183
|
|
- lv_obj_align(labelSpeed, buttonSpeed, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET);
|
184
|
|
- }
|
185
|
|
- else if (uiCfg.extruSpeed == 1) {
|
186
|
|
- lv_label_set_text(labelSpeed, extrude_menu.low);
|
187
|
|
- lv_obj_align(labelSpeed, buttonSpeed, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET);
|
188
|
|
- }
|
189
|
|
- else {
|
190
|
|
- lv_label_set_text(labelSpeed, extrude_menu.normal);
|
191
|
|
- lv_obj_align(labelSpeed, buttonSpeed, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET);
|
|
174
|
+ switch (uiCfg.extruSpeed) {
|
|
175
|
+ case uiCfg.eSpeedH: lv_label_set_text(labelSpeed, extrude_menu.high); break;
|
|
176
|
+ case uiCfg.eSpeedL: lv_label_set_text(labelSpeed, extrude_menu.low); break;
|
|
177
|
+ case uiCfg.eSpeedN: lv_label_set_text(labelSpeed, extrude_menu.normal); break;
|
192
|
178
|
}
|
|
179
|
+ lv_obj_align(labelSpeed, buttonSpeed, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET);
|
193
|
180
|
}
|
194
|
181
|
}
|
195
|
182
|
|
|
@@ -221,33 +208,28 @@ void disp_extru_amount() {
|
221
|
208
|
}
|
222
|
209
|
|
223
|
210
|
void disp_ext_step() {
|
224
|
|
- if (uiCfg.extruStep == 1)
|
225
|
|
- lv_imgbtn_set_src_both(buttonStep, "F:/bmp_step1_mm.bin");
|
226
|
|
- else if (uiCfg.extruStep == 5)
|
227
|
|
- lv_imgbtn_set_src_both(buttonStep, "F:/bmp_step5_mm.bin");
|
228
|
|
- else if (uiCfg.extruStep == 10)
|
229
|
|
- lv_imgbtn_set_src_both(buttonStep, "F:/bmp_step10_mm.bin");
|
|
211
|
+ char buf3[12];
|
|
212
|
+ sprintf_P(buf3, PSTR("%dmm"), uiCfg.extruStep);
|
|
213
|
+
|
|
214
|
+ switch (uiCfg.extruStep) {
|
|
215
|
+ case uiCfg.eStepMin: lv_imgbtn_set_src_both(buttonStep, "F:/bmp_step1_mm.bin"); break;
|
|
216
|
+ case uiCfg.eStepMed: lv_imgbtn_set_src_both(buttonStep, "F:/bmp_step5_mm.bin"); break;
|
|
217
|
+ case uiCfg.eStepMax: lv_imgbtn_set_src_both(buttonStep, "F:/bmp_step10_mm.bin"); break;
|
|
218
|
+ }
|
230
|
219
|
|
231
|
220
|
if (gCfgItems.multiple_language) {
|
232
|
|
- if (uiCfg.extruStep == 1) {
|
233
|
|
- lv_label_set_text(labelStep, extrude_menu.step_1mm);
|
234
|
|
- lv_obj_align(labelStep, buttonStep, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET);
|
235
|
|
- }
|
236
|
|
- else if (uiCfg.extruStep == 5) {
|
237
|
|
- lv_label_set_text(labelStep, extrude_menu.step_5mm);
|
238
|
|
- lv_obj_align(labelStep, buttonStep, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET);
|
239
|
|
- }
|
240
|
|
- else if (uiCfg.extruStep == 10) {
|
241
|
|
- lv_label_set_text(labelStep, extrude_menu.step_10mm);
|
242
|
|
- lv_obj_align(labelStep, buttonStep, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET);
|
|
221
|
+ switch (uiCfg.extruStep) {
|
|
222
|
+ case uiCfg.eStepMin: lv_label_set_text(labelStep, buf3); break;
|
|
223
|
+ case uiCfg.eStepMed: lv_label_set_text(labelStep, buf3); break;
|
|
224
|
+ case uiCfg.eStepMax: lv_label_set_text(labelStep, buf3); break;
|
243
|
225
|
}
|
|
226
|
+ lv_obj_align(labelStep, buttonStep, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET);
|
244
|
227
|
}
|
245
|
228
|
}
|
246
|
229
|
|
247
|
230
|
void lv_clear_extrusion() {
|
248
|
|
- #if HAS_ROTARY_ENCODER
|
249
|
|
- if (gCfgItems.encoder_enable) lv_group_remove_all_objs(g);
|
250
|
|
- #endif
|
|
231
|
+ if (TERN0(HAS_ROTARY_ENCODER, gCfgItems.encoder_enable))
|
|
232
|
+ lv_group_remove_all_objs(g);
|
251
|
233
|
lv_obj_del(scr);
|
252
|
234
|
}
|
253
|
235
|
|