|
@ -89,20 +89,18 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { |
|
|
disp_extru_amount(); |
|
|
disp_extru_amount(); |
|
|
break; |
|
|
break; |
|
|
case ID_E_STEP: |
|
|
case ID_E_STEP: |
|
|
switch (ABS(uiCfg.extruStep)) { |
|
|
switch (uiCfg.extruStep) { |
|
|
case 1: uiCfg.extruStep = 5; break; |
|
|
case uiCfg.eStepMin: uiCfg.extruStep = uiCfg.eStepMed; break; |
|
|
case 5: uiCfg.extruStep = 10; break; |
|
|
case uiCfg.eStepMed: uiCfg.extruStep = uiCfg.eStepMax; break; |
|
|
case 10: uiCfg.extruStep = 1; break; |
|
|
case uiCfg.eStepMax: uiCfg.extruStep = uiCfg.eStepMin; break; |
|
|
default: break; |
|
|
|
|
|
} |
|
|
} |
|
|
disp_ext_step(); |
|
|
disp_ext_step(); |
|
|
break; |
|
|
break; |
|
|
case ID_E_SPEED: |
|
|
case ID_E_SPEED: |
|
|
switch (uiCfg.extruSpeed) { |
|
|
switch (uiCfg.extruSpeed) { |
|
|
case 1: uiCfg.extruSpeed = 10; break; |
|
|
case uiCfg.eSpeedL: uiCfg.extruSpeed = uiCfg.eSpeedN; break; |
|
|
case 10: uiCfg.extruSpeed = 20; break; |
|
|
case uiCfg.eSpeedN: uiCfg.extruSpeed = uiCfg.eSpeedH; break; |
|
|
case 20: uiCfg.extruSpeed = 1; break; |
|
|
case uiCfg.eSpeedH: uiCfg.extruSpeed = uiCfg.eSpeedL; break; |
|
|
default: break; |
|
|
|
|
|
} |
|
|
} |
|
|
disp_ext_speed(); |
|
|
disp_ext_speed(); |
|
|
break; |
|
|
break; |
|
@ -155,41 +153,30 @@ void lv_draw_extrusion() { |
|
|
void disp_ext_type() { |
|
|
void disp_ext_type() { |
|
|
if (uiCfg.extruderIndex == 1) { |
|
|
if (uiCfg.extruderIndex == 1) { |
|
|
lv_imgbtn_set_src_both(buttonType, "F:/bmp_extru2.bin"); |
|
|
lv_imgbtn_set_src_both(buttonType, "F:/bmp_extru2.bin"); |
|
|
if (gCfgItems.multiple_language) { |
|
|
if (gCfgItems.multiple_language) lv_label_set_text(labelType, extrude_menu.ext2); |
|
|
lv_label_set_text(labelType, extrude_menu.ext2); |
|
|
|
|
|
lv_obj_align(labelType, buttonType, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
else { |
|
|
else { |
|
|
lv_imgbtn_set_src_both(buttonType, "F:/bmp_extru1.bin"); |
|
|
lv_imgbtn_set_src_both(buttonType, "F:/bmp_extru1.bin"); |
|
|
if (gCfgItems.multiple_language) { |
|
|
if (gCfgItems.multiple_language) lv_label_set_text(labelType, extrude_menu.ext1); |
|
|
lv_label_set_text(labelType, extrude_menu.ext1); |
|
|
|
|
|
lv_obj_align(labelType, buttonType, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
if (gCfgItems.multiple_language) |
|
|
|
|
|
lv_obj_align(labelType, buttonType, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void disp_ext_speed() { |
|
|
void disp_ext_speed() { |
|
|
if (uiCfg.extruSpeed == 20) |
|
|
switch (uiCfg.extruSpeed) { |
|
|
lv_imgbtn_set_src_both(buttonSpeed, "F:/bmp_speed_high.bin"); |
|
|
case uiCfg.eSpeedH: lv_imgbtn_set_src_both(buttonSpeed, "F:/bmp_speed_high.bin"); break; |
|
|
else if (uiCfg.extruSpeed == 1) |
|
|
case uiCfg.eSpeedL: lv_imgbtn_set_src_both(buttonSpeed, "F:/bmp_speed_slow.bin"); break; |
|
|
lv_imgbtn_set_src_both(buttonSpeed, "F:/bmp_speed_slow.bin"); |
|
|
case uiCfg.eSpeedN: lv_imgbtn_set_src_both(buttonSpeed, "F:/bmp_speed_normal.bin"); break; |
|
|
else |
|
|
} |
|
|
lv_imgbtn_set_src_both(buttonSpeed, "F:/bmp_speed_normal.bin"); |
|
|
|
|
|
|
|
|
|
|
|
if (gCfgItems.multiple_language) { |
|
|
if (gCfgItems.multiple_language) { |
|
|
if (uiCfg.extruSpeed == 20) { |
|
|
switch (uiCfg.extruSpeed) { |
|
|
lv_label_set_text(labelSpeed, extrude_menu.high); |
|
|
case uiCfg.eSpeedH: lv_label_set_text(labelSpeed, extrude_menu.high); break; |
|
|
lv_obj_align(labelSpeed, buttonSpeed, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); |
|
|
case uiCfg.eSpeedL: lv_label_set_text(labelSpeed, extrude_menu.low); break; |
|
|
} |
|
|
case uiCfg.eSpeedN: lv_label_set_text(labelSpeed, extrude_menu.normal); break; |
|
|
else if (uiCfg.extruSpeed == 1) { |
|
|
|
|
|
lv_label_set_text(labelSpeed, extrude_menu.low); |
|
|
|
|
|
lv_obj_align(labelSpeed, buttonSpeed, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); |
|
|
|
|
|
} |
|
|
|
|
|
else { |
|
|
|
|
|
lv_label_set_text(labelSpeed, extrude_menu.normal); |
|
|
|
|
|
lv_obj_align(labelSpeed, buttonSpeed, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
lv_obj_align(labelSpeed, buttonSpeed, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -221,33 +208,28 @@ void disp_extru_amount() { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void disp_ext_step() { |
|
|
void disp_ext_step() { |
|
|
if (uiCfg.extruStep == 1) |
|
|
char buf3[12]; |
|
|
lv_imgbtn_set_src_both(buttonStep, "F:/bmp_step1_mm.bin"); |
|
|
sprintf_P(buf3, PSTR("%dmm"), uiCfg.extruStep); |
|
|
else if (uiCfg.extruStep == 5) |
|
|
|
|
|
lv_imgbtn_set_src_both(buttonStep, "F:/bmp_step5_mm.bin"); |
|
|
switch (uiCfg.extruStep) { |
|
|
else if (uiCfg.extruStep == 10) |
|
|
case uiCfg.eStepMin: lv_imgbtn_set_src_both(buttonStep, "F:/bmp_step1_mm.bin"); break; |
|
|
lv_imgbtn_set_src_both(buttonStep, "F:/bmp_step10_mm.bin"); |
|
|
case uiCfg.eStepMed: lv_imgbtn_set_src_both(buttonStep, "F:/bmp_step5_mm.bin"); break; |
|
|
|
|
|
case uiCfg.eStepMax: lv_imgbtn_set_src_both(buttonStep, "F:/bmp_step10_mm.bin"); break; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if (gCfgItems.multiple_language) { |
|
|
if (gCfgItems.multiple_language) { |
|
|
if (uiCfg.extruStep == 1) { |
|
|
switch (uiCfg.extruStep) { |
|
|
lv_label_set_text(labelStep, extrude_menu.step_1mm); |
|
|
case uiCfg.eStepMin: lv_label_set_text(labelStep, buf3); break; |
|
|
lv_obj_align(labelStep, buttonStep, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); |
|
|
case uiCfg.eStepMed: lv_label_set_text(labelStep, buf3); break; |
|
|
} |
|
|
case uiCfg.eStepMax: lv_label_set_text(labelStep, buf3); break; |
|
|
else if (uiCfg.extruStep == 5) { |
|
|
|
|
|
lv_label_set_text(labelStep, extrude_menu.step_5mm); |
|
|
|
|
|
lv_obj_align(labelStep, buttonStep, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); |
|
|
|
|
|
} |
|
|
|
|
|
else if (uiCfg.extruStep == 10) { |
|
|
|
|
|
lv_label_set_text(labelStep, extrude_menu.step_10mm); |
|
|
|
|
|
lv_obj_align(labelStep, buttonStep, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
lv_obj_align(labelStep, buttonStep, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void lv_clear_extrusion() { |
|
|
void lv_clear_extrusion() { |
|
|
#if HAS_ROTARY_ENCODER |
|
|
if (TERN0(HAS_ROTARY_ENCODER, gCfgItems.encoder_enable)) |
|
|
if (gCfgItems.encoder_enable) lv_group_remove_all_objs(g); |
|
|
lv_group_remove_all_objs(g); |
|
|
#endif |
|
|
|
|
|
lv_obj_del(scr); |
|
|
lv_obj_del(scr); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|