|
@ -55,189 +55,162 @@ |
|
|
#include "../../../../feature/pause.h" |
|
|
#include "../../../../feature/pause.h" |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
|
|
|
extern lv_group_t * g; |
|
|
extern lv_group_t *g; |
|
|
static lv_obj_t * scr; |
|
|
static lv_obj_t *scr, *tempText1, *filament_bar; |
|
|
static lv_obj_t * tempText1; |
|
|
|
|
|
static lv_obj_t * filament_bar; |
|
|
|
|
|
|
|
|
|
|
|
extern uint8_t sel_id; |
|
|
extern uint8_t sel_id; |
|
|
extern bool once_flag, gcode_preview_over; |
|
|
extern bool once_flag, gcode_preview_over; |
|
|
extern int upload_result ; |
|
|
extern int upload_result; |
|
|
extern uint32_t upload_time; |
|
|
extern uint32_t upload_time; |
|
|
extern uint32_t upload_size; |
|
|
extern uint32_t upload_size; |
|
|
extern uint8_t temperature_change_frequency; |
|
|
extern bool temps_update_flag; |
|
|
|
|
|
|
|
|
static void btn_ok_event_cb(lv_obj_t * btn, lv_event_t event) { |
|
|
static void btn_ok_event_cb(lv_obj_t *btn, lv_event_t event) { |
|
|
if (event == LV_EVENT_CLICKED) { |
|
|
if (event != LV_EVENT_RELEASED) return; |
|
|
// nothing to do
|
|
|
if (DIALOG_IS(TYPE_PRINT_FILE)) { |
|
|
} |
|
|
#if HAS_GCODE_PREVIEW |
|
|
else if (event == LV_EVENT_RELEASED) { |
|
|
preview_gcode_prehandle(list_file.file_name[sel_id]); |
|
|
if (uiCfg.dialogType == DIALOG_TYPE_PRINT_FILE) { |
|
|
#endif |
|
|
#if HAS_GCODE_PREVIEW |
|
|
reset_print_time(); |
|
|
preview_gcode_prehandle(list_file.file_name[sel_id]); |
|
|
start_print_time(); |
|
|
#endif |
|
|
|
|
|
reset_print_time(); |
|
|
uiCfg.print_state = WORKING; |
|
|
start_print_time(); |
|
|
lv_clear_dialog(); |
|
|
|
|
|
lv_draw_printing(); |
|
|
uiCfg.print_state = WORKING; |
|
|
|
|
|
lv_clear_dialog(); |
|
|
#if ENABLED(SDSUPPORT) |
|
|
lv_draw_printing(); |
|
|
if (!gcode_preview_over) { |
|
|
|
|
|
char *cur_name; |
|
|
#if ENABLED(SDSUPPORT) |
|
|
cur_name = strrchr(list_file.file_name[sel_id], '/'); |
|
|
if (!gcode_preview_over) { |
|
|
|
|
|
char *cur_name; |
|
|
SdFile file, *curDir; |
|
|
cur_name = strrchr(list_file.file_name[sel_id], '/'); |
|
|
card.endFilePrint(); |
|
|
|
|
|
const char * const fname = card.diveToFile(true, curDir, cur_name); |
|
|
SdFile file, *curDir; |
|
|
if (!fname) return; |
|
|
card.endFilePrint(); |
|
|
if (file.open(curDir, fname, O_READ)) { |
|
|
const char * const fname = card.diveToFile(true, curDir, cur_name); |
|
|
gCfgItems.curFilesize = file.fileSize(); |
|
|
if (!fname) return; |
|
|
file.close(); |
|
|
if (file.open(curDir, fname, O_READ)) { |
|
|
update_spi_flash(); |
|
|
gCfgItems.curFilesize = file.fileSize(); |
|
|
} |
|
|
file.close(); |
|
|
card.openFileRead(cur_name); |
|
|
update_spi_flash(); |
|
|
if (card.isFileOpen()) { |
|
|
} |
|
|
feedrate_percentage = 100; |
|
|
card.openFileRead(cur_name); |
|
|
//saved_feedrate_percentage = feedrate_percentage;
|
|
|
if (card.isFileOpen()) { |
|
|
planner.flow_percentage[0] = 100; |
|
|
feedrate_percentage = 100; |
|
|
planner.e_factor[0] = planner.flow_percentage[0] * 0.01f; |
|
|
//saved_feedrate_percentage = feedrate_percentage;
|
|
|
#if HAS_MULTI_EXTRUDER |
|
|
planner.flow_percentage[0] = 100; |
|
|
planner.flow_percentage[1] = 100; |
|
|
planner.e_factor[0] = planner.flow_percentage[0] * 0.01f; |
|
|
planner.e_factor[1] = planner.flow_percentage[1] * 0.01f; |
|
|
#if HAS_MULTI_EXTRUDER |
|
|
#endif |
|
|
planner.flow_percentage[1] = 100; |
|
|
card.startFileprint(); |
|
|
planner.e_factor[1] = planner.flow_percentage[1] * 0.01f; |
|
|
#if ENABLED(POWER_LOSS_RECOVERY) |
|
|
#endif |
|
|
recovery.prepare(); |
|
|
card.startFileprint(); |
|
|
#endif |
|
|
#if ENABLED(POWER_LOSS_RECOVERY) |
|
|
once_flag = false; |
|
|
recovery.prepare(); |
|
|
|
|
|
#endif |
|
|
|
|
|
once_flag = false; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
#endif |
|
|
|
|
|
} |
|
|
|
|
|
else if (uiCfg.dialogType == DIALOG_TYPE_STOP) { |
|
|
|
|
|
wait_for_heatup = false; |
|
|
|
|
|
stop_print_time(); |
|
|
|
|
|
lv_clear_dialog(); |
|
|
|
|
|
lv_draw_ready_print(); |
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(SDSUPPORT) |
|
|
|
|
|
//card.endFilePrint();
|
|
|
|
|
|
//wait_for_heatup = false;
|
|
|
|
|
|
uiCfg.print_state = IDLE; |
|
|
|
|
|
card.flag.abort_sd_printing = true; |
|
|
|
|
|
//queue.clear();
|
|
|
|
|
|
//quickstop_stepper();
|
|
|
|
|
|
//print_job_timer.stop();
|
|
|
|
|
|
//thermalManager.disable_all_heaters();
|
|
|
|
|
|
|
|
|
|
|
|
//#if ENABLED(POWER_LOSS_RECOVERY)
|
|
|
|
|
|
// recovery.purge();
|
|
|
|
|
|
//#endif
|
|
|
|
|
|
//queue.enqueue_now_P(PSTR("G91\nG1 Z10\nG90\nG28 X0 Y0"));
|
|
|
|
|
|
//queue.inject_P(PSTR("G91\nG1 Z10\nG90\nG28 X0 Y0\nM84\nM107"));
|
|
|
|
|
|
#endif |
|
|
|
|
|
} |
|
|
|
|
|
else if (uiCfg.dialogType == DIALOG_TYPE_FINISH_PRINT) { |
|
|
|
|
|
clear_cur_ui(); |
|
|
|
|
|
lv_draw_ready_print(); |
|
|
|
|
|
} |
|
|
|
|
|
#if ENABLED(ADVANCED_PAUSE_FEATURE) |
|
|
|
|
|
else if (uiCfg.dialogType == DIALOG_PAUSE_MESSAGE_WAITING |
|
|
|
|
|
|| uiCfg.dialogType == DIALOG_PAUSE_MESSAGE_INSERT |
|
|
|
|
|
|| uiCfg.dialogType == DIALOG_PAUSE_MESSAGE_HEAT |
|
|
|
|
|
) { |
|
|
|
|
|
wait_for_user = false; |
|
|
|
|
|
} |
|
|
|
|
|
else if (uiCfg.dialogType == DIALOG_PAUSE_MESSAGE_OPTION) { |
|
|
|
|
|
pause_menu_response = PAUSE_RESPONSE_EXTRUDE_MORE; |
|
|
|
|
|
} |
|
|
|
|
|
else if (uiCfg.dialogType == DIALOG_PAUSE_MESSAGE_RESUME) { |
|
|
|
|
|
clear_cur_ui(); |
|
|
|
|
|
draw_return_ui(); |
|
|
|
|
|
} |
|
|
} |
|
|
#endif |
|
|
#endif |
|
|
else if (uiCfg.dialogType == DIALOG_STORE_EEPROM_TIPS) { |
|
|
} |
|
|
TERN_(EEPROM_SETTINGS, (void)settings.save()); |
|
|
else if (DIALOG_IS(TYPE_STOP)) { |
|
|
clear_cur_ui(); |
|
|
wait_for_heatup = false; |
|
|
draw_return_ui(); |
|
|
stop_print_time(); |
|
|
} |
|
|
lv_clear_dialog(); |
|
|
else if (uiCfg.dialogType == DIALOG_READ_EEPROM_TIPS) { |
|
|
lv_draw_ready_print(); |
|
|
TERN_(EEPROM_SETTINGS, (void)settings.load()); |
|
|
|
|
|
clear_cur_ui(); |
|
|
#if ENABLED(SDSUPPORT) |
|
|
draw_return_ui(); |
|
|
//card.endFilePrint();
|
|
|
} |
|
|
//wait_for_heatup = false;
|
|
|
else if (uiCfg.dialogType == DIALOG_REVERT_EEPROM_TIPS) { |
|
|
uiCfg.print_state = IDLE; |
|
|
TERN_(EEPROM_SETTINGS, (void)settings.reset()); |
|
|
card.flag.abort_sd_printing = true; |
|
|
clear_cur_ui(); |
|
|
//queue.clear();
|
|
|
draw_return_ui(); |
|
|
//quickstop_stepper();
|
|
|
} |
|
|
//print_job_timer.stop();
|
|
|
else if (uiCfg.dialogType == DIALOG_WIFI_CONFIG_TIPS) { |
|
|
//thermalManager.disable_all_heaters();
|
|
|
uiCfg.configWifi = 1; |
|
|
|
|
|
clear_cur_ui(); |
|
|
//#if ENABLED(POWER_LOSS_RECOVERY)
|
|
|
draw_return_ui(); |
|
|
// recovery.purge();
|
|
|
} |
|
|
//#endif
|
|
|
else if (uiCfg.dialogType == DIALOG_TYPE_FILAMENT_HEAT_LOAD_COMPLETED) { |
|
|
//queue.enqueue_now_P(PSTR("G91\nG1 Z10\nG90\nG28 X0 Y0"));
|
|
|
uiCfg.filament_heat_completed_load = 1; |
|
|
//queue.inject_P(PSTR("G91\nG1 Z10\nG90\nG28 X0 Y0\nM84\nM107"));
|
|
|
} |
|
|
#endif |
|
|
else if (uiCfg.dialogType == DIALOG_TYPE_FILAMENT_HEAT_UNLOAD_COMPLETED) { |
|
|
} |
|
|
uiCfg.filament_heat_completed_unload = 1; |
|
|
else if (DIALOG_IS(TYPE_FINISH_PRINT)) { |
|
|
} |
|
|
clear_cur_ui(); |
|
|
else if (uiCfg.dialogType == DIALOG_TYPE_FILAMENT_LOAD_COMPLETED |
|
|
lv_draw_ready_print(); |
|
|
|| uiCfg.dialogType == DIALOG_TYPE_FILAMENT_UNLOAD_COMPLETED |
|
|
} |
|
|
) { |
|
|
#if ENABLED(ADVANCED_PAUSE_FEATURE) |
|
|
|
|
|
else if (DIALOG_IS(PAUSE_MESSAGE_WAITING, PAUSE_MESSAGE_INSERT, PAUSE_MESSAGE_HEAT)) |
|
|
|
|
|
wait_for_user = false; |
|
|
|
|
|
else if (DIALOG_IS(PAUSE_MESSAGE_OPTION)) |
|
|
|
|
|
pause_menu_response = PAUSE_RESPONSE_EXTRUDE_MORE; |
|
|
|
|
|
else if (DIALOG_IS(PAUSE_MESSAGE_RESUME)) { |
|
|
clear_cur_ui(); |
|
|
clear_cur_ui(); |
|
|
draw_return_ui(); |
|
|
draw_return_ui(); |
|
|
} |
|
|
} |
|
|
|
|
|
#endif |
|
|
|
|
|
else if (DIALOG_IS(STORE_EEPROM_TIPS)) { |
|
|
|
|
|
TERN_(EEPROM_SETTINGS, (void)settings.save()); |
|
|
|
|
|
clear_cur_ui(); |
|
|
|
|
|
draw_return_ui(); |
|
|
|
|
|
} |
|
|
|
|
|
else if (DIALOG_IS(READ_EEPROM_TIPS)) { |
|
|
|
|
|
TERN_(EEPROM_SETTINGS, (void)settings.load()); |
|
|
|
|
|
clear_cur_ui(); |
|
|
|
|
|
draw_return_ui(); |
|
|
|
|
|
} |
|
|
|
|
|
else if (DIALOG_IS(REVERT_EEPROM_TIPS)) { |
|
|
|
|
|
TERN_(EEPROM_SETTINGS, (void)settings.reset()); |
|
|
|
|
|
clear_cur_ui(); |
|
|
|
|
|
draw_return_ui(); |
|
|
|
|
|
} |
|
|
|
|
|
else if (DIALOG_IS(WIFI_CONFIG_TIPS)) { |
|
|
|
|
|
uiCfg.configWifi = 1; |
|
|
|
|
|
clear_cur_ui(); |
|
|
|
|
|
draw_return_ui(); |
|
|
|
|
|
} |
|
|
|
|
|
else if (DIALOG_IS(TYPE_FILAMENT_HEAT_LOAD_COMPLETED)) |
|
|
|
|
|
uiCfg.filament_heat_completed_load = 1; |
|
|
|
|
|
else if (DIALOG_IS(TYPE_FILAMENT_HEAT_UNLOAD_COMPLETED)) |
|
|
|
|
|
uiCfg.filament_heat_completed_unload = 1; |
|
|
|
|
|
else if (DIALOG_IS(TYPE_FILAMENT_LOAD_COMPLETED, TYPE_FILAMENT_UNLOAD_COMPLETED)) { |
|
|
|
|
|
clear_cur_ui(); |
|
|
|
|
|
draw_return_ui(); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
static void btn_cancel_event_cb(lv_obj_t * btn, lv_event_t event) { |
|
|
static void btn_cancel_event_cb(lv_obj_t *btn, lv_event_t event) { |
|
|
if (event == LV_EVENT_CLICKED) { |
|
|
if (event != LV_EVENT_RELEASED) return; |
|
|
// nothing to do
|
|
|
if (DIALOG_IS(PAUSE_MESSAGE_OPTION)) { |
|
|
|
|
|
#if ENABLED(ADVANCED_PAUSE_FEATURE) |
|
|
|
|
|
pause_menu_response = PAUSE_RESPONSE_RESUME_PRINT; |
|
|
|
|
|
#endif |
|
|
} |
|
|
} |
|
|
else if (event == LV_EVENT_RELEASED) { |
|
|
else if (DIALOG_IS(TYPE_FILAMENT_LOAD_HEAT, TYPE_FILAMENT_UNLOAD_HEAT, TYPE_FILAMENT_HEAT_LOAD_COMPLETED, TYPE_FILAMENT_HEAT_UNLOAD_COMPLETED)) { |
|
|
if (uiCfg.dialogType == DIALOG_PAUSE_MESSAGE_OPTION) { |
|
|
thermalManager.temp_hotend[uiCfg.curSprayerChoose].target= uiCfg.desireSprayerTempBak; |
|
|
#if ENABLED(ADVANCED_PAUSE_FEATURE) |
|
|
clear_cur_ui(); |
|
|
pause_menu_response = PAUSE_RESPONSE_RESUME_PRINT; |
|
|
draw_return_ui(); |
|
|
#endif |
|
|
} |
|
|
} |
|
|
else if (DIALOG_IS(TYPE_FILAMENT_LOADING, TYPE_FILAMENT_UNLOADING)) { |
|
|
else if ((uiCfg.dialogType == DIALOG_TYPE_FILAMENT_LOAD_HEAT) |
|
|
queue.enqueue_one_P(PSTR("M410")); |
|
|
|| (uiCfg.dialogType == DIALOG_TYPE_FILAMENT_UNLOAD_HEAT) |
|
|
uiCfg.filament_rate = 0; |
|
|
|| (uiCfg.dialogType == DIALOG_TYPE_FILAMENT_HEAT_LOAD_COMPLETED) |
|
|
uiCfg.filament_loading_completed = 0; |
|
|
|| (uiCfg.dialogType == DIALOG_TYPE_FILAMENT_HEAT_UNLOAD_COMPLETED) |
|
|
uiCfg.filament_unloading_completed = 0; |
|
|
) { |
|
|
uiCfg.filament_loading_time_flg = 0; |
|
|
thermalManager.temp_hotend[uiCfg.curSprayerChoose].target= uiCfg.desireSprayerTempBak; |
|
|
uiCfg.filament_loading_time_cnt = 0; |
|
|
clear_cur_ui(); |
|
|
uiCfg.filament_unloading_time_flg = 0; |
|
|
draw_return_ui(); |
|
|
uiCfg.filament_unloading_time_cnt = 0; |
|
|
} |
|
|
thermalManager.temp_hotend[uiCfg.curSprayerChoose].target = uiCfg.desireSprayerTempBak; |
|
|
else if ((uiCfg.dialogType == DIALOG_TYPE_FILAMENT_LOADING) |
|
|
clear_cur_ui(); |
|
|
|| (uiCfg.dialogType == DIALOG_TYPE_FILAMENT_UNLOADING) |
|
|
draw_return_ui(); |
|
|
) { |
|
|
} |
|
|
queue.enqueue_one_P(PSTR("M410")); |
|
|
else { |
|
|
uiCfg.filament_rate = 0; |
|
|
clear_cur_ui(); |
|
|
uiCfg.filament_loading_completed = 0; |
|
|
draw_return_ui(); |
|
|
uiCfg.filament_unloading_completed = 0; |
|
|
|
|
|
uiCfg.filament_loading_time_flg = 0; |
|
|
|
|
|
uiCfg.filament_loading_time_cnt = 0; |
|
|
|
|
|
uiCfg.filament_unloading_time_flg = 0; |
|
|
|
|
|
uiCfg.filament_unloading_time_cnt = 0; |
|
|
|
|
|
thermalManager.temp_hotend[uiCfg.curSprayerChoose].target = uiCfg.desireSprayerTempBak; |
|
|
|
|
|
clear_cur_ui(); |
|
|
|
|
|
draw_return_ui(); |
|
|
|
|
|
} |
|
|
|
|
|
else { |
|
|
|
|
|
clear_cur_ui(); |
|
|
|
|
|
draw_return_ui(); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void lv_draw_dialog(uint8_t type) { |
|
|
void lv_draw_dialog(uint8_t type) { |
|
|
|
|
|
lv_obj_t *btnOk = nullptr, *btnCancel = nullptr; |
|
|
lv_obj_t * btnOk = NULL; |
|
|
|
|
|
lv_obj_t * btnCancel = NULL; |
|
|
|
|
|
if (disp_state_stack._disp_state[disp_state_stack._disp_index] != DIALOG_UI) { |
|
|
if (disp_state_stack._disp_state[disp_state_stack._disp_index] != DIALOG_UI) { |
|
|
disp_state_stack._disp_index++; |
|
|
disp_state_stack._disp_index++; |
|
|
disp_state_stack._disp_state[disp_state_stack._disp_index] = DIALOG_UI; |
|
|
disp_state_stack._disp_state[disp_state_stack._disp_index] = DIALOG_UI; |
|
@ -246,153 +219,70 @@ void lv_draw_dialog(uint8_t type) { |
|
|
|
|
|
|
|
|
uiCfg.dialogType = type; |
|
|
uiCfg.dialogType = type; |
|
|
|
|
|
|
|
|
scr = lv_obj_create(NULL, NULL); |
|
|
scr = lv_screen_create(); |
|
|
|
|
|
|
|
|
lv_obj_set_style(scr, &tft_style_scr); |
|
|
|
|
|
lv_scr_load(scr); |
|
|
|
|
|
lv_obj_clean(scr); |
|
|
|
|
|
|
|
|
|
|
|
(void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, creat_title_text()); |
|
|
(void)lv_label_create(scr, TITLE_XPOS, TITLE_YPOS, creat_title_text()); |
|
|
|
|
|
|
|
|
lv_refr_now(lv_refr_get_disp_refreshing()); |
|
|
lv_refr_now(lv_refr_get_disp_refreshing()); |
|
|
|
|
|
|
|
|
static lv_style_t style_btn_rel; // A variable to store the released style
|
|
|
|
|
|
lv_style_copy(&style_btn_rel, &lv_style_plain); // Initialize from a built-in style
|
|
|
|
|
|
style_btn_rel.body.border.color = lv_color_hex3(0x269); |
|
|
|
|
|
style_btn_rel.body.border.width = 1; |
|
|
|
|
|
style_btn_rel.body.main_color = lv_color_hex3(0xADF); |
|
|
|
|
|
style_btn_rel.body.grad_color = lv_color_hex3(0x46B); |
|
|
|
|
|
style_btn_rel.body.shadow.width = 4; |
|
|
|
|
|
style_btn_rel.body.shadow.type = LV_SHADOW_BOTTOM; |
|
|
|
|
|
style_btn_rel.body.radius = LV_RADIUS_CIRCLE; |
|
|
|
|
|
style_btn_rel.text.color = lv_color_hex3(0xDEF); |
|
|
|
|
|
style_btn_rel.text.font = &TERN(HAS_SPI_FLASH_FONT, gb2312_puhui32, lv_font_roboto_22); |
|
|
|
|
|
|
|
|
|
|
|
static lv_style_t style_btn_pr; // A variable to store the pressed style
|
|
|
|
|
|
lv_style_copy(&style_btn_pr, &style_btn_rel); // Initialize from the released style
|
|
|
|
|
|
style_btn_pr.body.border.color = lv_color_hex3(0x46B); |
|
|
|
|
|
style_btn_pr.body.main_color = lv_color_hex3(0x8BD); |
|
|
|
|
|
style_btn_pr.body.grad_color = lv_color_hex3(0x24A); |
|
|
|
|
|
style_btn_pr.body.shadow.width = 2; |
|
|
|
|
|
style_btn_pr.text.color = lv_color_hex3(0xBCD); |
|
|
|
|
|
style_btn_pr.text.font = &TERN(HAS_SPI_FLASH_FONT, gb2312_puhui32, lv_font_roboto_22); |
|
|
|
|
|
|
|
|
|
|
|
// Set button styles for Released and Pressed
|
|
|
|
|
|
auto lv_btn_use_button_style = [&](lv_obj_t *btn) { |
|
|
|
|
|
lv_btn_set_style(btn, LV_BTN_STYLE_REL, &style_btn_rel); |
|
|
|
|
|
lv_btn_set_style(btn, LV_BTN_STYLE_PR, &style_btn_pr); |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
lv_obj_t *labelDialog = lv_label_create_empty(scr); |
|
|
lv_obj_t *labelDialog = lv_label_create_empty(scr); |
|
|
|
|
|
|
|
|
if (uiCfg.dialogType == DIALOG_TYPE_FINISH_PRINT || uiCfg.dialogType == DIALOG_PAUSE_MESSAGE_RESUME) { |
|
|
if (DIALOG_IS(TYPE_FINISH_PRINT, PAUSE_MESSAGE_RESUME)) { |
|
|
btnOk = lv_btn_create(scr, NULL); // Add a button the current screen
|
|
|
btnOk = lv_button_btn_create(scr, BTN_OK_X + 90, BTN_OK_Y, 100, 50, btn_ok_event_cb); |
|
|
lv_obj_set_pos(btnOk, BTN_OK_X + 90, BTN_OK_Y); // Set its position
|
|
|
|
|
|
lv_obj_set_size(btnOk, 100, 50); // Set its size
|
|
|
|
|
|
lv_obj_set_event_cb(btnOk, btn_ok_event_cb); |
|
|
|
|
|
lv_btn_use_button_style(btnOk); |
|
|
|
|
|
lv_obj_t *labelOk = lv_label_create_empty(btnOk); // Add a label to the button
|
|
|
lv_obj_t *labelOk = lv_label_create_empty(btnOk); // Add a label to the button
|
|
|
lv_label_set_text(labelOk, print_file_dialog_menu.confirm); // Set the labels text
|
|
|
lv_label_set_text(labelOk, print_file_dialog_menu.confirm); // Set the labels text
|
|
|
} |
|
|
} |
|
|
else if (uiCfg.dialogType == DIALOG_PAUSE_MESSAGE_WAITING |
|
|
else if (DIALOG_IS(PAUSE_MESSAGE_WAITING, PAUSE_MESSAGE_INSERT, PAUSE_MESSAGE_HEAT)) { |
|
|
|| uiCfg.dialogType == DIALOG_PAUSE_MESSAGE_INSERT |
|
|
btnOk = lv_button_btn_create(scr, BTN_OK_X + 90, BTN_OK_Y, 100, 50, btn_ok_event_cb); |
|
|
|| uiCfg.dialogType == DIALOG_PAUSE_MESSAGE_HEAT |
|
|
|
|
|
) { |
|
|
|
|
|
btnOk = lv_btn_create(scr, NULL); // Add a button the current screen
|
|
|
|
|
|
lv_obj_set_pos(btnOk, BTN_OK_X + 90, BTN_OK_Y); // Set its position
|
|
|
|
|
|
lv_obj_set_size(btnOk, 100, 50); // Set its size
|
|
|
|
|
|
lv_obj_set_event_cb(btnOk, btn_ok_event_cb); |
|
|
|
|
|
lv_btn_use_button_style(btnOk); |
|
|
|
|
|
lv_obj_t *labelOk = lv_label_create_empty(btnOk); // Add a label to the button
|
|
|
lv_obj_t *labelOk = lv_label_create_empty(btnOk); // Add a label to the button
|
|
|
lv_label_set_text(labelOk, print_file_dialog_menu.confirm); // Set the labels text
|
|
|
lv_label_set_text(labelOk, print_file_dialog_menu.confirm); // Set the labels text
|
|
|
} |
|
|
} |
|
|
else if (uiCfg.dialogType == DIALOG_PAUSE_MESSAGE_PAUSING |
|
|
else if (DIALOG_IS(PAUSE_MESSAGE_PAUSING, PAUSE_MESSAGE_CHANGING, PAUSE_MESSAGE_UNLOAD, PAUSE_MESSAGE_LOAD, PAUSE_MESSAGE_PURGE, PAUSE_MESSAGE_RESUME, PAUSE_MESSAGE_HEATING)) { |
|
|
|| uiCfg.dialogType == DIALOG_PAUSE_MESSAGE_CHANGING |
|
|
|
|
|
|| uiCfg.dialogType == DIALOG_PAUSE_MESSAGE_UNLOAD |
|
|
|
|
|
|| uiCfg.dialogType == DIALOG_PAUSE_MESSAGE_LOAD |
|
|
|
|
|
|| uiCfg.dialogType == DIALOG_PAUSE_MESSAGE_PURGE |
|
|
|
|
|
|| uiCfg.dialogType == DIALOG_PAUSE_MESSAGE_RESUME |
|
|
|
|
|
|| uiCfg.dialogType == DIALOG_PAUSE_MESSAGE_HEATING |
|
|
|
|
|
) { |
|
|
|
|
|
// nothing to do
|
|
|
// nothing to do
|
|
|
} |
|
|
} |
|
|
else if (uiCfg.dialogType == WIFI_ENABLE_TIPS) { |
|
|
else if (DIALOG_IS(WIFI_ENABLE_TIPS)) { |
|
|
btnCancel = lv_btn_create(scr, NULL); |
|
|
btnCancel = lv_button_btn_create(scr, BTN_OK_X + 90, BTN_OK_Y, 100, 50, btn_cancel_event_cb); |
|
|
lv_obj_set_pos(btnCancel, BTN_OK_X+90, BTN_OK_Y); |
|
|
|
|
|
lv_obj_set_size(btnCancel, 100, 50); |
|
|
|
|
|
lv_obj_set_event_cb(btnCancel, btn_cancel_event_cb); |
|
|
|
|
|
lv_btn_use_button_style(btnCancel); |
|
|
|
|
|
lv_obj_t *labelCancel = lv_label_create_empty(btnCancel); |
|
|
lv_obj_t *labelCancel = lv_label_create_empty(btnCancel); |
|
|
lv_label_set_text(labelCancel, print_file_dialog_menu.cancle); |
|
|
lv_label_set_text(labelCancel, print_file_dialog_menu.cancle); |
|
|
} |
|
|
} |
|
|
else if (uiCfg.dialogType == DIALOG_TRANSFER_NO_DEVICE) { |
|
|
else if (DIALOG_IS(TRANSFER_NO_DEVICE)) { |
|
|
btnCancel = lv_btn_create(scr, NULL); |
|
|
btnCancel = lv_button_btn_create(scr, BTN_OK_X + 90, BTN_OK_Y, 100, 50, btn_cancel_event_cb); |
|
|
lv_obj_set_pos(btnCancel, BTN_OK_X+90, BTN_OK_Y); |
|
|
|
|
|
lv_obj_set_size(btnCancel, 100, 50); |
|
|
|
|
|
lv_obj_set_event_cb(btnCancel, btn_cancel_event_cb); |
|
|
|
|
|
lv_btn_use_button_style(btnCancel); |
|
|
|
|
|
lv_obj_t *labelCancel = lv_label_create_empty(btnCancel); |
|
|
lv_obj_t *labelCancel = lv_label_create_empty(btnCancel); |
|
|
lv_label_set_text(labelCancel, print_file_dialog_menu.cancle); |
|
|
lv_label_set_text(labelCancel, print_file_dialog_menu.cancle); |
|
|
} |
|
|
} |
|
|
#if ENABLED(USE_WIFI_FUNCTION) |
|
|
#if ENABLED(USE_WIFI_FUNCTION) |
|
|
else if (uiCfg.dialogType == DIALOG_TYPE_UPLOAD_FILE) { |
|
|
else if (DIALOG_IS(TYPE_UPLOAD_FILE)) { |
|
|
if (upload_result == 2) { |
|
|
if (upload_result == 2) { |
|
|
btnCancel = lv_btn_create(scr, NULL); |
|
|
btnCancel = lv_button_btn_create(scr, BTN_OK_X + 90, BTN_OK_Y, 100, 50, btn_cancel_event_cb); |
|
|
lv_obj_set_pos(btnCancel, BTN_OK_X+90, BTN_OK_Y); |
|
|
|
|
|
lv_obj_set_size(btnCancel, 100, 50); |
|
|
|
|
|
lv_obj_set_event_cb(btnCancel, btn_cancel_event_cb); |
|
|
|
|
|
lv_btn_use_button_style(btnCancel); |
|
|
|
|
|
lv_obj_t *labelCancel = lv_label_create_empty(btnCancel); |
|
|
lv_obj_t *labelCancel = lv_label_create_empty(btnCancel); |
|
|
lv_label_set_text(labelCancel, print_file_dialog_menu.cancle); |
|
|
lv_label_set_text(labelCancel, print_file_dialog_menu.cancle); |
|
|
} |
|
|
} |
|
|
else if (upload_result == 3) { |
|
|
else if (upload_result == 3) { |
|
|
btnOk = lv_btn_create(scr, NULL); |
|
|
btnOk = lv_button_btn_create(scr, BTN_OK_X + 90, BTN_OK_Y, 100, 50, btn_ok_event_cb); |
|
|
lv_obj_set_pos(btnOk, BTN_OK_X+90, BTN_OK_Y); |
|
|
|
|
|
lv_obj_set_size(btnOk, 100, 50); |
|
|
|
|
|
lv_obj_set_event_cb(btnOk, btn_ok_event_cb); |
|
|
|
|
|
lv_btn_use_button_style(btnOk); |
|
|
|
|
|
lv_obj_t *labelOk = lv_label_create_empty(btnOk); |
|
|
lv_obj_t *labelOk = lv_label_create_empty(btnOk); |
|
|
lv_label_set_text(labelOk, print_file_dialog_menu.confirm); |
|
|
lv_label_set_text(labelOk, print_file_dialog_menu.confirm); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
#endif //USE_WIFI_FUNCTION
|
|
|
#endif |
|
|
else if (uiCfg.dialogType == DIALOG_TYPE_FILAMENT_LOAD_HEAT |
|
|
else if (DIALOG_IS(TYPE_FILAMENT_LOAD_HEAT, TYPE_FILAMENT_UNLOAD_HEAT)) { |
|
|
|| uiCfg.dialogType == DIALOG_TYPE_FILAMENT_UNLOAD_HEAT |
|
|
btnCancel = lv_button_btn_create(scr, BTN_OK_X+90, BTN_OK_Y, 100, 50, btn_cancel_event_cb); |
|
|
) { |
|
|
|
|
|
btnCancel = lv_btn_create(scr, NULL); |
|
|
|
|
|
lv_obj_set_pos(btnCancel, BTN_OK_X+90, BTN_OK_Y); |
|
|
|
|
|
lv_obj_set_size(btnCancel, 100, 50); |
|
|
|
|
|
lv_obj_set_event_cb(btnCancel, btn_cancel_event_cb); |
|
|
|
|
|
lv_btn_use_button_style(btnCancel); |
|
|
|
|
|
lv_obj_t *labelCancel = lv_label_create_empty(btnCancel); |
|
|
lv_obj_t *labelCancel = lv_label_create_empty(btnCancel); |
|
|
lv_label_set_text(labelCancel, print_file_dialog_menu.cancle); |
|
|
lv_label_set_text(labelCancel, print_file_dialog_menu.cancle); |
|
|
|
|
|
|
|
|
tempText1 = lv_label_create_empty(scr); |
|
|
tempText1 = lv_label_create_empty(scr); |
|
|
filament_sprayer_temp(); |
|
|
filament_sprayer_temp(); |
|
|
} |
|
|
} |
|
|
else if (uiCfg.dialogType == DIALOG_TYPE_FILAMENT_LOAD_COMPLETED |
|
|
else if (DIALOG_IS(TYPE_FILAMENT_LOAD_COMPLETED, TYPE_FILAMENT_UNLOAD_COMPLETED)) { |
|
|
|| uiCfg.dialogType == DIALOG_TYPE_FILAMENT_UNLOAD_COMPLETED |
|
|
btnOk = lv_button_btn_create(scr, BTN_OK_X + 90, BTN_OK_Y, 100, 50, btn_ok_event_cb); |
|
|
) { |
|
|
|
|
|
btnOk = lv_btn_create(scr, NULL); |
|
|
|
|
|
lv_obj_set_pos(btnOk, BTN_OK_X + 90, BTN_OK_Y); |
|
|
|
|
|
lv_obj_set_size(btnOk, 100, 50); |
|
|
|
|
|
lv_obj_set_event_cb(btnOk, btn_ok_event_cb); |
|
|
|
|
|
lv_btn_use_button_style(btnOk); |
|
|
|
|
|
lv_obj_t *labelOk = lv_label_create_empty(btnOk); |
|
|
lv_obj_t *labelOk = lv_label_create_empty(btnOk); |
|
|
lv_label_set_text(labelOk, print_file_dialog_menu.confirm); |
|
|
lv_label_set_text(labelOk, print_file_dialog_menu.confirm); |
|
|
} |
|
|
} |
|
|
else if (uiCfg.dialogType == DIALOG_TYPE_FILAMENT_LOADING |
|
|
else if (DIALOG_IS(TYPE_FILAMENT_LOADING, TYPE_FILAMENT_UNLOADING)) { |
|
|
|| uiCfg.dialogType == DIALOG_TYPE_FILAMENT_UNLOADING |
|
|
btnCancel = lv_button_btn_create(scr, BTN_OK_X + 90, BTN_OK_Y, 100, 50, btn_cancel_event_cb); |
|
|
) { |
|
|
|
|
|
btnCancel = lv_btn_create(scr, NULL); |
|
|
|
|
|
lv_obj_set_pos(btnCancel, BTN_OK_X+90, BTN_OK_Y); |
|
|
|
|
|
lv_obj_set_size(btnCancel, 100, 50); |
|
|
|
|
|
lv_obj_set_event_cb(btnCancel, btn_cancel_event_cb); |
|
|
|
|
|
lv_btn_use_button_style(btnCancel); |
|
|
|
|
|
lv_obj_t *labelCancel = lv_label_create_empty(btnCancel); |
|
|
lv_obj_t *labelCancel = lv_label_create_empty(btnCancel); |
|
|
lv_label_set_text(labelCancel, print_file_dialog_menu.cancle); |
|
|
lv_label_set_text(labelCancel, print_file_dialog_menu.cancle); |
|
|
|
|
|
|
|
|
filament_bar = lv_bar_create(scr, NULL); |
|
|
filament_bar = lv_bar_create(scr, nullptr); |
|
|
lv_obj_set_pos(filament_bar, (TFT_WIDTH-400)/2, ((TFT_HEIGHT - titleHeight)-40)/2); |
|
|
lv_obj_set_pos(filament_bar, (TFT_WIDTH-400)/2, ((TFT_HEIGHT - titleHeight)-40)/2); |
|
|
lv_obj_set_size(filament_bar, 400, 25); |
|
|
lv_obj_set_size(filament_bar, 400, 25); |
|
|
lv_bar_set_style(filament_bar, LV_BAR_STYLE_INDIC, &lv_bar_style_indic); |
|
|
lv_bar_set_style(filament_bar, LV_BAR_STYLE_INDIC, &lv_bar_style_indic); |
|
@ -400,21 +290,13 @@ void lv_draw_dialog(uint8_t type) { |
|
|
lv_bar_set_value(filament_bar, 0, LV_ANIM_ON); |
|
|
lv_bar_set_value(filament_bar, 0, LV_ANIM_ON); |
|
|
} |
|
|
} |
|
|
else { |
|
|
else { |
|
|
btnOk = lv_btn_create(scr, NULL); // Add a button the current screen
|
|
|
btnOk = lv_button_btn_create(scr, BTN_OK_X, BTN_OK_Y, 100, 50, btn_ok_event_cb); |
|
|
lv_obj_set_pos(btnOk, BTN_OK_X, BTN_OK_Y); // Set its position
|
|
|
|
|
|
lv_obj_set_size(btnOk, 100, 50); // Set its size
|
|
|
|
|
|
lv_obj_set_event_cb(btnOk, btn_ok_event_cb); |
|
|
|
|
|
lv_btn_use_button_style(btnOk); |
|
|
|
|
|
lv_obj_t *labelOk = lv_label_create_empty(btnOk); // Add a label to the button
|
|
|
lv_obj_t *labelOk = lv_label_create_empty(btnOk); // Add a label to the button
|
|
|
|
|
|
|
|
|
btnCancel = lv_btn_create(scr, NULL); // Add a button the current screen
|
|
|
btnCancel = lv_button_btn_create(scr, BTN_CANCEL_X, BTN_CANCEL_Y, 100, 50, btn_cancel_event_cb); |
|
|
lv_obj_set_pos(btnCancel, BTN_CANCEL_X, BTN_CANCEL_Y); // Set its position
|
|
|
|
|
|
lv_obj_set_size(btnCancel, 100, 50); // Set its size
|
|
|
|
|
|
lv_obj_set_event_cb(btnCancel, btn_cancel_event_cb); |
|
|
|
|
|
lv_btn_use_button_style(btnCancel); |
|
|
|
|
|
lv_obj_t *labelCancel = lv_label_create_empty(btnCancel); // Add a label to the button
|
|
|
lv_obj_t *labelCancel = lv_label_create_empty(btnCancel); // Add a label to the button
|
|
|
|
|
|
|
|
|
if (uiCfg.dialogType == DIALOG_PAUSE_MESSAGE_OPTION) { |
|
|
if (DIALOG_IS(PAUSE_MESSAGE_OPTION)) { |
|
|
lv_label_set_text(labelOk, pause_msg_menu.purgeMore); // Set the labels text
|
|
|
lv_label_set_text(labelOk, pause_msg_menu.purgeMore); // Set the labels text
|
|
|
lv_label_set_text(labelCancel, pause_msg_menu.continuePrint); |
|
|
lv_label_set_text(labelCancel, pause_msg_menu.continuePrint); |
|
|
} |
|
|
} |
|
@ -423,105 +305,103 @@ void lv_draw_dialog(uint8_t type) { |
|
|
lv_label_set_text(labelCancel, print_file_dialog_menu.cancle); |
|
|
lv_label_set_text(labelCancel, print_file_dialog_menu.cancle); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
if (uiCfg.dialogType == DIALOG_TYPE_PRINT_FILE) { |
|
|
if (DIALOG_IS(TYPE_PRINT_FILE)) { |
|
|
lv_label_set_text(labelDialog, print_file_dialog_menu.print_file); |
|
|
lv_label_set_text(labelDialog, print_file_dialog_menu.print_file); |
|
|
lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); |
|
|
lv_obj_align(labelDialog, nullptr, LV_ALIGN_CENTER, 0, -20); |
|
|
|
|
|
|
|
|
lv_obj_t *labelFile = lv_label_create(scr, list_file.long_name[sel_id]); |
|
|
lv_obj_t *labelFile = lv_label_create(scr, list_file.long_name[sel_id]); |
|
|
lv_obj_align(labelFile, NULL, LV_ALIGN_CENTER, 0, -60); |
|
|
lv_obj_align(labelFile, nullptr, LV_ALIGN_CENTER, 0, -60); |
|
|
} |
|
|
} |
|
|
else if (uiCfg.dialogType == DIALOG_TYPE_STOP) { |
|
|
else if (DIALOG_IS(TYPE_STOP)) { |
|
|
lv_label_set_text(labelDialog, print_file_dialog_menu.cancle_print); |
|
|
lv_label_set_text(labelDialog, print_file_dialog_menu.cancle_print); |
|
|
lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); |
|
|
lv_obj_align(labelDialog, nullptr, LV_ALIGN_CENTER, 0, -20); |
|
|
} |
|
|
} |
|
|
else if (uiCfg.dialogType == DIALOG_TYPE_FINISH_PRINT) { |
|
|
else if (DIALOG_IS(TYPE_FINISH_PRINT)) { |
|
|
lv_label_set_text(labelDialog, print_file_dialog_menu.print_finish); |
|
|
lv_label_set_text(labelDialog, print_file_dialog_menu.print_finish); |
|
|
lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); |
|
|
lv_obj_align(labelDialog, nullptr, LV_ALIGN_CENTER, 0, -20); |
|
|
} |
|
|
} |
|
|
else if (uiCfg.dialogType == DIALOG_PAUSE_MESSAGE_PAUSING) { |
|
|
else if (DIALOG_IS(PAUSE_MESSAGE_PAUSING)) { |
|
|
lv_label_set_text(labelDialog, pause_msg_menu.pausing); |
|
|
lv_label_set_text(labelDialog, pause_msg_menu.pausing); |
|
|
lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); |
|
|
lv_obj_align(labelDialog, nullptr, LV_ALIGN_CENTER, 0, -20); |
|
|
} |
|
|
} |
|
|
else if (uiCfg.dialogType == DIALOG_PAUSE_MESSAGE_CHANGING) { |
|
|
else if (DIALOG_IS(PAUSE_MESSAGE_CHANGING)) { |
|
|
lv_label_set_text(labelDialog, pause_msg_menu.changing); |
|
|
lv_label_set_text(labelDialog, pause_msg_menu.changing); |
|
|
lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); |
|
|
lv_obj_align(labelDialog, nullptr, LV_ALIGN_CENTER, 0, -20); |
|
|
} |
|
|
} |
|
|
else if (uiCfg.dialogType == DIALOG_PAUSE_MESSAGE_UNLOAD) { |
|
|
else if (DIALOG_IS(PAUSE_MESSAGE_UNLOAD)) { |
|
|
lv_label_set_text(labelDialog, pause_msg_menu.unload); |
|
|
lv_label_set_text(labelDialog, pause_msg_menu.unload); |
|
|
lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); |
|
|
lv_obj_align(labelDialog, nullptr, LV_ALIGN_CENTER, 0, -20); |
|
|
} |
|
|
} |
|
|
else if (uiCfg.dialogType == DIALOG_PAUSE_MESSAGE_WAITING) { |
|
|
else if (DIALOG_IS(PAUSE_MESSAGE_WAITING)) { |
|
|
lv_label_set_text(labelDialog, pause_msg_menu.waiting); |
|
|
lv_label_set_text(labelDialog, pause_msg_menu.waiting); |
|
|
lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); |
|
|
lv_obj_align(labelDialog, nullptr, LV_ALIGN_CENTER, 0, -20); |
|
|
} |
|
|
} |
|
|
else if (uiCfg.dialogType == DIALOG_PAUSE_MESSAGE_INSERT) { |
|
|
else if (DIALOG_IS(PAUSE_MESSAGE_INSERT)) { |
|
|
lv_label_set_text(labelDialog, pause_msg_menu.insert); |
|
|
lv_label_set_text(labelDialog, pause_msg_menu.insert); |
|
|
lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); |
|
|
lv_obj_align(labelDialog, nullptr, LV_ALIGN_CENTER, 0, -20); |
|
|
} |
|
|
} |
|
|
else if (uiCfg.dialogType == DIALOG_PAUSE_MESSAGE_LOAD) { |
|
|
else if (DIALOG_IS(PAUSE_MESSAGE_LOAD)) { |
|
|
lv_label_set_text(labelDialog, pause_msg_menu.load); |
|
|
lv_label_set_text(labelDialog, pause_msg_menu.load); |
|
|
lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); |
|
|
lv_obj_align(labelDialog, nullptr, LV_ALIGN_CENTER, 0, -20); |
|
|
} |
|
|
} |
|
|
else if (uiCfg.dialogType == DIALOG_PAUSE_MESSAGE_PURGE) { |
|
|
else if (DIALOG_IS(PAUSE_MESSAGE_PURGE)) { |
|
|
lv_label_set_text(labelDialog, pause_msg_menu.purge); |
|
|
lv_label_set_text(labelDialog, pause_msg_menu.purge); |
|
|
lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); |
|
|
lv_obj_align(labelDialog, nullptr, LV_ALIGN_CENTER, 0, -20); |
|
|
} |
|
|
} |
|
|
else if (uiCfg.dialogType == DIALOG_PAUSE_MESSAGE_RESUME) { |
|
|
else if (DIALOG_IS(PAUSE_MESSAGE_RESUME)) { |
|
|
lv_label_set_text(labelDialog, pause_msg_menu.resume); |
|
|
lv_label_set_text(labelDialog, pause_msg_menu.resume); |
|
|
lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); |
|
|
lv_obj_align(labelDialog, nullptr, LV_ALIGN_CENTER, 0, -20); |
|
|
} |
|
|
} |
|
|
else if (uiCfg.dialogType == DIALOG_PAUSE_MESSAGE_HEAT) { |
|
|
else if (DIALOG_IS(PAUSE_MESSAGE_HEAT)) { |
|
|
lv_label_set_text(labelDialog, pause_msg_menu.heat); |
|
|
lv_label_set_text(labelDialog, pause_msg_menu.heat); |
|
|
lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); |
|
|
lv_obj_align(labelDialog, nullptr, LV_ALIGN_CENTER, 0, -20); |
|
|
} |
|
|
} |
|
|
else if (uiCfg.dialogType == DIALOG_PAUSE_MESSAGE_HEATING) { |
|
|
else if (DIALOG_IS(PAUSE_MESSAGE_HEATING)) { |
|
|
lv_label_set_text(labelDialog, pause_msg_menu.heating); |
|
|
lv_label_set_text(labelDialog, pause_msg_menu.heating); |
|
|
lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); |
|
|
lv_obj_align(labelDialog, nullptr, LV_ALIGN_CENTER, 0, -20); |
|
|
} |
|
|
} |
|
|
else if (uiCfg.dialogType == DIALOG_PAUSE_MESSAGE_OPTION) { |
|
|
else if (DIALOG_IS(PAUSE_MESSAGE_OPTION)) { |
|
|
lv_label_set_text(labelDialog, pause_msg_menu.option); |
|
|
lv_label_set_text(labelDialog, pause_msg_menu.option); |
|
|
lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); |
|
|
lv_obj_align(labelDialog, nullptr, LV_ALIGN_CENTER, 0, -20); |
|
|
} |
|
|
} |
|
|
else if (uiCfg.dialogType == DIALOG_STORE_EEPROM_TIPS) { |
|
|
else if (DIALOG_IS(STORE_EEPROM_TIPS)) { |
|
|
lv_label_set_text(labelDialog, eeprom_menu.storeTips); |
|
|
lv_label_set_text(labelDialog, eeprom_menu.storeTips); |
|
|
lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); |
|
|
lv_obj_align(labelDialog, nullptr, LV_ALIGN_CENTER, 0, -20); |
|
|
} |
|
|
} |
|
|
else if (uiCfg.dialogType == DIALOG_READ_EEPROM_TIPS) { |
|
|
else if (DIALOG_IS(READ_EEPROM_TIPS)) { |
|
|
lv_label_set_text(labelDialog, eeprom_menu.readTips); |
|
|
lv_label_set_text(labelDialog, eeprom_menu.readTips); |
|
|
lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); |
|
|
lv_obj_align(labelDialog, nullptr, LV_ALIGN_CENTER, 0, -20); |
|
|
} |
|
|
} |
|
|
else if (uiCfg.dialogType == DIALOG_REVERT_EEPROM_TIPS) { |
|
|
else if (DIALOG_IS(REVERT_EEPROM_TIPS)) { |
|
|
lv_label_set_text(labelDialog, eeprom_menu.revertTips); |
|
|
lv_label_set_text(labelDialog, eeprom_menu.revertTips); |
|
|
lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); |
|
|
lv_obj_align(labelDialog, nullptr, LV_ALIGN_CENTER, 0, -20); |
|
|
} |
|
|
} |
|
|
else if (uiCfg.dialogType == DIALOG_WIFI_CONFIG_TIPS) { |
|
|
else if (DIALOG_IS(WIFI_CONFIG_TIPS)) { |
|
|
lv_label_set_text(labelDialog, machine_menu.wifiConfigTips); |
|
|
lv_label_set_text(labelDialog, machine_menu.wifiConfigTips); |
|
|
lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); |
|
|
lv_obj_align(labelDialog, nullptr, LV_ALIGN_CENTER, 0, -20); |
|
|
} |
|
|
} |
|
|
else if (uiCfg.dialogType == WIFI_ENABLE_TIPS) { |
|
|
else if (DIALOG_IS(WIFI_ENABLE_TIPS)) { |
|
|
lv_label_set_text(labelDialog, print_file_dialog_menu.wifi_enable_tips); |
|
|
lv_label_set_text(labelDialog, print_file_dialog_menu.wifi_enable_tips); |
|
|
lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); |
|
|
lv_obj_align(labelDialog, nullptr, LV_ALIGN_CENTER, 0, -20); |
|
|
} |
|
|
} |
|
|
else if (uiCfg.dialogType == DIALOG_TRANSFER_NO_DEVICE) { |
|
|
else if (DIALOG_IS(TRANSFER_NO_DEVICE)) { |
|
|
lv_label_set_text(labelDialog, DIALOG_UPDATE_NO_DEVICE_EN); |
|
|
lv_label_set_text(labelDialog, DIALOG_UPDATE_NO_DEVICE_EN); |
|
|
lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); |
|
|
lv_obj_align(labelDialog, nullptr, LV_ALIGN_CENTER, 0, -20); |
|
|
} |
|
|
} |
|
|
#if ENABLED(USE_WIFI_FUNCTION) |
|
|
#if ENABLED(USE_WIFI_FUNCTION) |
|
|
else if (uiCfg.dialogType == DIALOG_TYPE_UPLOAD_FILE) { |
|
|
else if (DIALOG_IS(TYPE_UPLOAD_FILE)) { |
|
|
if (upload_result == 1) { |
|
|
if (upload_result == 1) { |
|
|
lv_label_set_text(labelDialog, DIALOG_UPLOAD_ING_EN); |
|
|
lv_label_set_text(labelDialog, DIALOG_UPLOAD_ING_EN); |
|
|
lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); |
|
|
lv_obj_align(labelDialog, nullptr, LV_ALIGN_CENTER, 0, -20); |
|
|
} |
|
|
} |
|
|
else if (upload_result == 2) { |
|
|
else if (upload_result == 2) { |
|
|
lv_label_set_text(labelDialog, DIALOG_UPLOAD_ERROR_EN); |
|
|
lv_label_set_text(labelDialog, DIALOG_UPLOAD_ERROR_EN); |
|
|
lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); |
|
|
lv_obj_align(labelDialog, nullptr, LV_ALIGN_CENTER, 0, -20); |
|
|
} |
|
|
} |
|
|
else if (upload_result == 3) { |
|
|
else if (upload_result == 3) { |
|
|
char buf[200]; |
|
|
char buf[200]; |
|
|
int _index = 0; |
|
|
int _index = 0; |
|
|
|
|
|
|
|
|
ZERO(buf); |
|
|
|
|
|
|
|
|
|
|
|
strcpy(buf, DIALOG_UPLOAD_FINISH_EN); |
|
|
strcpy(buf, DIALOG_UPLOAD_FINISH_EN); |
|
|
_index = strlen(buf); |
|
|
_index = strlen(buf); |
|
|
buf[_index] = '\n'; |
|
|
buf[_index] = '\n'; |
|
@ -546,41 +426,41 @@ void lv_draw_dialog(uint8_t type) { |
|
|
sprintf(&buf[_index], " %d KBytes/s\n", (int)(upload_size / upload_time / 1024)); |
|
|
sprintf(&buf[_index], " %d KBytes/s\n", (int)(upload_size / upload_time / 1024)); |
|
|
|
|
|
|
|
|
lv_label_set_text(labelDialog, buf); |
|
|
lv_label_set_text(labelDialog, buf); |
|
|
lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); |
|
|
lv_obj_align(labelDialog, nullptr, LV_ALIGN_CENTER, 0, -20); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
#endif //USE_WIFI_FUNCTION
|
|
|
#endif // USE_WIFI_FUNCTION
|
|
|
else if (uiCfg.dialogType == DIALOG_TYPE_FILAMENT_LOAD_HEAT) { |
|
|
else if (DIALOG_IS(TYPE_FILAMENT_LOAD_HEAT)) { |
|
|
lv_label_set_text(labelDialog, filament_menu.filament_dialog_load_heat); |
|
|
lv_label_set_text(labelDialog, filament_menu.filament_dialog_load_heat); |
|
|
lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); |
|
|
lv_obj_align(labelDialog, nullptr, LV_ALIGN_CENTER, 0, -20); |
|
|
} |
|
|
} |
|
|
else if (uiCfg.dialogType == DIALOG_TYPE_FILAMENT_HEAT_LOAD_COMPLETED) { |
|
|
else if (DIALOG_IS(TYPE_FILAMENT_HEAT_LOAD_COMPLETED)) { |
|
|
lv_label_set_text(labelDialog, filament_menu.filament_dialog_load_heat_confirm); |
|
|
lv_label_set_text(labelDialog, filament_menu.filament_dialog_load_heat_confirm); |
|
|
lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); |
|
|
lv_obj_align(labelDialog, nullptr, LV_ALIGN_CENTER, 0, -20); |
|
|
} |
|
|
} |
|
|
else if (uiCfg.dialogType == DIALOG_TYPE_FILAMENT_UNLOAD_HEAT) { |
|
|
else if (DIALOG_IS(TYPE_FILAMENT_UNLOAD_HEAT)) { |
|
|
lv_label_set_text(labelDialog, filament_menu.filament_dialog_unload_heat); |
|
|
lv_label_set_text(labelDialog, filament_menu.filament_dialog_unload_heat); |
|
|
lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); |
|
|
lv_obj_align(labelDialog, nullptr, LV_ALIGN_CENTER, 0, -20); |
|
|
} |
|
|
} |
|
|
else if (uiCfg.dialogType == DIALOG_TYPE_FILAMENT_HEAT_UNLOAD_COMPLETED) { |
|
|
else if (DIALOG_IS(TYPE_FILAMENT_HEAT_UNLOAD_COMPLETED)) { |
|
|
lv_label_set_text(labelDialog, filament_menu.filament_dialog_unload_heat_confirm); |
|
|
lv_label_set_text(labelDialog, filament_menu.filament_dialog_unload_heat_confirm); |
|
|
lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); |
|
|
lv_obj_align(labelDialog, nullptr, LV_ALIGN_CENTER, 0, -20); |
|
|
} |
|
|
} |
|
|
else if (uiCfg.dialogType == DIALOG_TYPE_FILAMENT_LOAD_COMPLETED) { |
|
|
else if (DIALOG_IS(TYPE_FILAMENT_LOAD_COMPLETED)) { |
|
|
lv_label_set_text(labelDialog, filament_menu.filament_dialog_load_completed); |
|
|
lv_label_set_text(labelDialog, filament_menu.filament_dialog_load_completed); |
|
|
lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); |
|
|
lv_obj_align(labelDialog, nullptr, LV_ALIGN_CENTER, 0, -20); |
|
|
} |
|
|
} |
|
|
else if (uiCfg.dialogType == DIALOG_TYPE_FILAMENT_UNLOAD_COMPLETED) { |
|
|
else if (DIALOG_IS(TYPE_FILAMENT_UNLOAD_COMPLETED)) { |
|
|
lv_label_set_text(labelDialog, filament_menu.filament_dialog_unload_completed); |
|
|
lv_label_set_text(labelDialog, filament_menu.filament_dialog_unload_completed); |
|
|
lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -20); |
|
|
lv_obj_align(labelDialog, nullptr, LV_ALIGN_CENTER, 0, -20); |
|
|
} |
|
|
} |
|
|
else if (uiCfg.dialogType == DIALOG_TYPE_FILAMENT_LOADING) { |
|
|
else if (DIALOG_IS(TYPE_FILAMENT_LOADING)) { |
|
|
lv_label_set_text(labelDialog, filament_menu.filament_dialog_loading); |
|
|
lv_label_set_text(labelDialog, filament_menu.filament_dialog_loading); |
|
|
lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -70); |
|
|
lv_obj_align(labelDialog, nullptr, LV_ALIGN_CENTER, 0, -70); |
|
|
} |
|
|
} |
|
|
else if (uiCfg.dialogType == DIALOG_TYPE_FILAMENT_UNLOADING) { |
|
|
else if (DIALOG_IS(TYPE_FILAMENT_UNLOADING)) { |
|
|
lv_label_set_text(labelDialog, filament_menu.filament_dialog_unloading); |
|
|
lv_label_set_text(labelDialog, filament_menu.filament_dialog_unloading); |
|
|
lv_obj_align(labelDialog, NULL, LV_ALIGN_CENTER, 0, -70); |
|
|
lv_obj_align(labelDialog, nullptr, LV_ALIGN_CENTER, 0, -70); |
|
|
} |
|
|
} |
|
|
#if HAS_ROTARY_ENCODER |
|
|
#if HAS_ROTARY_ENCODER |
|
|
if (gCfgItems.encoder_enable) { |
|
|
if (gCfgItems.encoder_enable) { |
|
@ -592,28 +472,19 @@ void lv_draw_dialog(uint8_t type) { |
|
|
|
|
|
|
|
|
void filament_sprayer_temp() { |
|
|
void filament_sprayer_temp() { |
|
|
char buf[20] = {0}; |
|
|
char buf[20] = {0}; |
|
|
|
|
|
sprintf(buf, preheat_menu.value_state, (int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].celsius, (int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].target); |
|
|
|
|
|
|
|
|
public_buf_l[0] = '\0'; |
|
|
strcpy(public_buf_l, uiCfg.curSprayerChoose < 1 ? extrude_menu.ext1 : extrude_menu.ext2); |
|
|
|
|
|
|
|
|
if (uiCfg.curSprayerChoose < 1) |
|
|
|
|
|
strcat(public_buf_l, preheat_menu.ext1); |
|
|
|
|
|
else |
|
|
|
|
|
strcat(public_buf_l, preheat_menu.ext2); |
|
|
|
|
|
sprintf(buf, preheat_menu.value_state, (int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].celsius, (int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].target); |
|
|
|
|
|
|
|
|
|
|
|
strcat_P(public_buf_l, PSTR(": ")); |
|
|
strcat_P(public_buf_l, PSTR(": ")); |
|
|
strcat(public_buf_l, buf); |
|
|
strcat(public_buf_l, buf); |
|
|
lv_label_set_text(tempText1, public_buf_l); |
|
|
lv_label_set_text(tempText1, public_buf_l); |
|
|
lv_obj_align(tempText1, NULL, LV_ALIGN_CENTER, 0, -50); |
|
|
lv_obj_align(tempText1, nullptr, LV_ALIGN_CENTER, 0, -50); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void filament_dialog_handle() { |
|
|
void filament_dialog_handle() { |
|
|
if ((temperature_change_frequency == 1) |
|
|
if (temps_update_flag && (DIALOG_IS(TYPE_FILAMENT_LOAD_HEAT, TYPE_FILAMENT_UNLOAD_HEAT))) { |
|
|
&& ((uiCfg.dialogType == DIALOG_TYPE_FILAMENT_LOAD_HEAT) |
|
|
|
|
|
|| (uiCfg.dialogType == DIALOG_TYPE_FILAMENT_UNLOAD_HEAT)) |
|
|
|
|
|
) { |
|
|
|
|
|
filament_sprayer_temp(); |
|
|
filament_sprayer_temp(); |
|
|
temperature_change_frequency = 0; |
|
|
temps_update_flag = false; |
|
|
} |
|
|
} |
|
|
if (uiCfg.filament_heat_completed_load == 1) { |
|
|
if (uiCfg.filament_heat_completed_load == 1) { |
|
|
uiCfg.filament_heat_completed_load = 0; |
|
|
uiCfg.filament_heat_completed_load = 0; |
|
@ -667,9 +538,8 @@ void filament_dialog_handle() { |
|
|
lv_draw_dialog(DIALOG_TYPE_FILAMENT_UNLOAD_COMPLETED); |
|
|
lv_draw_dialog(DIALOG_TYPE_FILAMENT_UNLOAD_COMPLETED); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if ( uiCfg.dialogType == DIALOG_TYPE_FILAMENT_LOADING |
|
|
if (DIALOG_IS(TYPE_FILAMENT_LOADING, TYPE_FILAMENT_UNLOADING)) |
|
|
|| uiCfg.dialogType == DIALOG_TYPE_FILAMENT_UNLOADING |
|
|
lv_filament_setbar(); |
|
|
) lv_filament_setbar(); |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void lv_filament_setbar() { |
|
|
void lv_filament_setbar() { |
|
|