From b4c025a451580cdc15f9506e923c4ffe5afdde90 Mon Sep 17 00:00:00 2001 From: Sola <42537573+solawc@users.noreply.github.com> Date: Tue, 28 Sep 2021 03:08:29 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=B8=20Fix=20MKS=20LVGL=20UI=20temperat?= =?UTF-8?q?ure=20set=20interface=20(#22848,=20#22842)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/extui/mks_ui/draw_preHeat.cpp | 27 ++++++++++--------- .../src/lcd/extui/mks_ui/draw_ready_print.cpp | 1 + 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/Marlin/src/lcd/extui/mks_ui/draw_preHeat.cpp b/Marlin/src/lcd/extui/mks_ui/draw_preHeat.cpp index 1d804c3b2a4e..6e9c88b60b68 100644 --- a/Marlin/src/lcd/extui/mks_ui/draw_preHeat.cpp +++ b/Marlin/src/lcd/extui/mks_ui/draw_preHeat.cpp @@ -124,24 +124,18 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { else if (uiCfg.extruderIndex == 0) { uiCfg.curTempType = TERN(HAS_HEATED_BED, 1, 0); } + lv_obj_del(btn_pla); + lv_obj_del(btn_abs); } else if (uiCfg.curTempType == 1) { uiCfg.extruderIndex = 0; uiCfg.curTempType = 0; - disp_add_dec(); - disp_ext_heart(); + lv_obj_del(buttonAdd); + lv_obj_del(buttonDec); } + disp_temp_type(); break; - case ID_P_STEP: - switch (uiCfg.stepHeat) { - case 1: uiCfg.stepHeat = 5; break; - case 5: uiCfg.stepHeat = 10; break; - case 10: uiCfg.stepHeat = 1; break; - default: break; - } - disp_step_heat(); - break; case ID_P_OFF: if (uiCfg.curTempType == 0) { thermalManager.setTargetHotend(0, uiCfg.extruderIndex); @@ -160,10 +154,16 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { draw_return_ui(); break; case ID_P_ABS: - thermalManager.setTargetHotend(PREHEAT_2_TEMP_HOTEND, 0); + if (uiCfg.curTempType == 0) + thermalManager.setTargetHotend(PREHEAT_2_TEMP_HOTEND, 0); + else if (uiCfg.curTempType == 1) + thermalManager.setTargetBed(PREHEAT_2_TEMP_BED); break; case ID_P_PLA: - thermalManager.setTargetHotend(PREHEAT_1_TEMP_HOTEND, 0); + if (uiCfg.curTempType == 0) + thermalManager.setTargetHotend(PREHEAT_1_TEMP_HOTEND, 0); + else if (uiCfg.curTempType == 1) + thermalManager.setTargetBed(PREHEAT_1_TEMP_BED); break; } } @@ -184,6 +184,7 @@ void lv_draw_preHeat() { buttonStep = lv_imgbtn_create(scr, nullptr, BTN_X_PIXEL + INTERVAL_V * 2, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_P_STEP); if (uiCfg.curTempType == 0) disp_ext_heart(); + if (uiCfg.curTempType == 1) disp_ext_heart(); #if HAS_ROTARY_ENCODER if (gCfgItems.encoder_enable) { diff --git a/Marlin/src/lcd/extui/mks_ui/draw_ready_print.cpp b/Marlin/src/lcd/extui/mks_ui/draw_ready_print.cpp index a8d8b29ac024..1596944bd899 100644 --- a/Marlin/src/lcd/extui/mks_ui/draw_ready_print.cpp +++ b/Marlin/src/lcd/extui/mks_ui/draw_ready_print.cpp @@ -98,6 +98,7 @@ void disp_det_ok() { lv_obj_set_style(det_info, &det_style); lv_label_set_text(det_info, "det:ok"); } + void disp_det_error() { det_style.text.color.full = 0xF800; lv_obj_set_style(det_info, &det_style);