|
|
|
@ -486,24 +486,31 @@ void Clear_Popup_Area() {
|
|
|
|
|
DWIN_Draw_Rectangle(1, HMI_data.Background_Color, 0, 31, DWIN_WIDTH, DWIN_HEIGHT);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DWIN_Draw_Popup(uint8_t icon=0, const char * const msg1=nullptr, const char * const msg2=nullptr, uint8_t button=0) {
|
|
|
|
|
void DWIN_Draw_Popup1(const uint8_t icon) {
|
|
|
|
|
DWINUI::ClearMenuArea();
|
|
|
|
|
Draw_Popup_Bkgd_60();
|
|
|
|
|
if (icon) DWINUI::Draw_Icon(icon, 101, 105);
|
|
|
|
|
if (msg1) DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 210, msg1);
|
|
|
|
|
if (msg2) DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 240, msg2);
|
|
|
|
|
}
|
|
|
|
|
void DWIN_Draw_Popup2(FSTR_P const fmsg2, uint8_t button) {
|
|
|
|
|
if (fmsg2) DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 240, fmsg2);
|
|
|
|
|
if (button) DWINUI::Draw_Icon(button, 86, 280);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DWIN_Popup_Confirm(uint8_t icon, const char * const msg1, const char * const msg2) {
|
|
|
|
|
HMI_SaveProcessID(WaitResponse);
|
|
|
|
|
DWIN_Draw_Popup(icon, msg1, msg2, ICON_Confirm_E); // Button Confirm
|
|
|
|
|
DWIN_UpdateLCD();
|
|
|
|
|
void DWIN_Draw_Popup(const uint8_t icon, const char * const cmsg1, FSTR_P const fmsg2, uint8_t button) {
|
|
|
|
|
DWIN_Draw_Popup1(icon);
|
|
|
|
|
if (cmsg1) DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 210, cmsg1);
|
|
|
|
|
DWIN_Draw_Popup2(fmsg2, button);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DWIN_Popup_Continue(uint8_t icon, const char * const msg1, const char * const msg2) {
|
|
|
|
|
void DWIN_Draw_Popup(const uint8_t icon, FSTR_P const fmsg1, FSTR_P const fmsg2, uint8_t button) {
|
|
|
|
|
DWIN_Draw_Popup1(icon);
|
|
|
|
|
if (fmsg1) DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 210, fmsg1);
|
|
|
|
|
DWIN_Draw_Popup2(fmsg2, button);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DWIN_Popup_Continue(const uint8_t icon, FSTR_P const fmsg1, FSTR_P const fmsg2) {
|
|
|
|
|
HMI_SaveProcessID(WaitResponse);
|
|
|
|
|
DWIN_Draw_Popup(icon, msg1, msg2, ICON_Continue_E); // Button Continue
|
|
|
|
|
DWIN_Draw_Popup(icon, fmsg1, fmsg2, ICON_Continue_E); // Button Continue
|
|
|
|
|
DWIN_UpdateLCD();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -521,7 +528,7 @@ void DWIN_Popup_Continue(uint8_t icon, const char * const msg1, const char * con
|
|
|
|
|
DWIN_UpdateLCD();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
DWIN_Popup_Confirm(ICON_TempTooLow, "Nozzle is too cold", "Preheat the hotend");
|
|
|
|
|
DWIN_Popup_Confirm(ICON_TempTooLow, F("Nozzle is too cold"), F("Preheat the hotend"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
@ -565,7 +572,7 @@ void Popup_window_PauseOrStop() {
|
|
|
|
|
DWINUI::Draw_Icon(ICON_Cancel_C, 146, 280);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
DWIN_Draw_Popup(ICON_BLTouch, "Please confirm", select_print.now == PRINT_PAUSE_RESUME ? GET_TEXT(MSG_PAUSE_PRINT) : GET_TEXT(MSG_STOP_PRINT));
|
|
|
|
|
DWIN_Draw_Popup(ICON_BLTouch, F("Please confirm"), select_print.now == PRINT_PAUSE_RESUME ? GET_TEXT_F(MSG_PAUSE_PRINT) : GET_TEXT_F(MSG_STOP_PRINT));
|
|
|
|
|
DWINUI::Draw_Icon(ICON_Confirm_E, 26, 280);
|
|
|
|
|
DWINUI::Draw_Icon(ICON_Cancel_E, 146, 280);
|
|
|
|
|
}
|
|
|
|
@ -1386,7 +1393,7 @@ void HMI_PauseOrStop() {
|
|
|
|
|
#ifdef ACTION_ON_CANCEL
|
|
|
|
|
host_action_cancel();
|
|
|
|
|
#endif
|
|
|
|
|
DWIN_Draw_Popup(ICON_BLTouch, "Stopping..." , "Please wait until done.");
|
|
|
|
|
DWIN_Draw_Popup(ICON_BLTouch, F("Stopping...") , F("Please wait until done."));
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
Goto_PrintProcess(); // cancel stop
|
|
|
|
@ -1644,7 +1651,7 @@ void HMI_SaveProcessID(const uint8_t id) {
|
|
|
|
|
void DWIN_StartHoming() {
|
|
|
|
|
HMI_flag.home_flag = true;
|
|
|
|
|
HMI_SaveProcessID(Homing);
|
|
|
|
|
DWIN_Draw_Popup(ICON_BLTouch, "Axis Homing", "Please wait until done.");
|
|
|
|
|
DWIN_Draw_Popup(ICON_BLTouch, F("Axis Homing"), F("Please wait until done."));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DWIN_CompletedHoming() {
|
|
|
|
@ -1659,7 +1666,7 @@ void DWIN_CompletedHoming() {
|
|
|
|
|
void DWIN_MeshLevelingStart() {
|
|
|
|
|
#if HAS_ONESTEP_LEVELING
|
|
|
|
|
HMI_SaveProcessID(Leveling);
|
|
|
|
|
DWIN_Draw_Popup(ICON_AutoLeveling, GET_TEXT(MSG_BED_LEVELING), "Please wait until done.");
|
|
|
|
|
DWIN_Draw_Popup(ICON_AutoLeveling, GET_TEXT_F(MSG_BED_LEVELING), F("Please wait until done."));
|
|
|
|
|
#elif ENABLED(MESH_BED_LEVELING)
|
|
|
|
|
Draw_ManualMesh_Menu();
|
|
|
|
|
#endif
|
|
|
|
@ -1682,27 +1689,27 @@ void DWIN_PidTuning(pidresult_t result) {
|
|
|
|
|
switch (result) {
|
|
|
|
|
case PID_BED_START:
|
|
|
|
|
HMI_SaveProcessID(NothingToDo);
|
|
|
|
|
DWIN_Draw_Popup(ICON_TempTooHigh, GET_TEXT(MSG_PID_AUTOTUNE), "for BED is running.");
|
|
|
|
|
DWIN_Draw_Popup(ICON_TempTooHigh, GET_TEXT_F(MSG_PID_AUTOTUNE), F("for BED is running."));
|
|
|
|
|
break;
|
|
|
|
|
case PID_EXTR_START:
|
|
|
|
|
HMI_SaveProcessID(NothingToDo);
|
|
|
|
|
DWIN_Draw_Popup(ICON_TempTooHigh, GET_TEXT(MSG_PID_AUTOTUNE), "for Nozzle is running.");
|
|
|
|
|
DWIN_Draw_Popup(ICON_TempTooHigh, GET_TEXT_F(MSG_PID_AUTOTUNE), F("for Nozzle is running."));
|
|
|
|
|
break;
|
|
|
|
|
case PID_BAD_EXTRUDER_NUM:
|
|
|
|
|
checkkey = last_checkkey;
|
|
|
|
|
DWIN_Popup_Confirm(ICON_TempTooLow, "PID Autotune failed!", "Bad extruder");
|
|
|
|
|
DWIN_Popup_Confirm(ICON_TempTooLow, F("PID Autotune failed!"), F("Bad extruder"));
|
|
|
|
|
break;
|
|
|
|
|
case PID_TUNING_TIMEOUT:
|
|
|
|
|
checkkey = last_checkkey;
|
|
|
|
|
DWIN_Popup_Confirm(ICON_TempTooHigh, "Error", GET_TEXT(MSG_PID_TIMEOUT));
|
|
|
|
|
DWIN_Popup_Confirm(ICON_TempTooHigh, F("Error"), GET_TEXT_F(MSG_PID_TIMEOUT));
|
|
|
|
|
break;
|
|
|
|
|
case PID_TEMP_TOO_HIGH:
|
|
|
|
|
checkkey = last_checkkey;
|
|
|
|
|
DWIN_Popup_Confirm(ICON_TempTooHigh, "PID Autotune failed!", "Temperature too high");
|
|
|
|
|
DWIN_Popup_Confirm(ICON_TempTooHigh, F("PID Autotune failed!"), F("Temperature too high"));
|
|
|
|
|
break;
|
|
|
|
|
case PID_DONE:
|
|
|
|
|
checkkey = last_checkkey;
|
|
|
|
|
DWIN_Popup_Confirm(ICON_TempTooLow, GET_TEXT(MSG_PID_AUTOTUNE), GET_TEXT(MSG_BUTTON_DONE));
|
|
|
|
|
DWIN_Popup_Confirm(ICON_TempTooLow, GET_TEXT_F(MSG_PID_AUTOTUNE), GET_TEXT_F(MSG_BUTTON_DONE));
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
checkkey = last_checkkey;
|
|
|
|
@ -1864,24 +1871,24 @@ void DWIN_Redraw_screen() {
|
|
|
|
|
|
|
|
|
|
#if ENABLED(ADVANCED_PAUSE_FEATURE)
|
|
|
|
|
|
|
|
|
|
void DWIN_Popup_Pause(const char *msg, uint8_t button = 0) {
|
|
|
|
|
void DWIN_Popup_Pause(FSTR_P const fmsg, uint8_t button = 0) {
|
|
|
|
|
HMI_SaveProcessID(button ? WaitResponse : NothingToDo);
|
|
|
|
|
DWIN_Draw_Popup(ICON_BLTouch, "Advanced Pause", msg, button);
|
|
|
|
|
DWIN_Draw_Popup(ICON_BLTouch, F("Advanced Pause"), fmsg, button);
|
|
|
|
|
ui.reset_status(true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MarlinUI::pause_show_message(const PauseMessage message, const PauseMode mode/*=PAUSE_MODE_SAME*/, const uint8_t extruder/*=active_extruder*/) {
|
|
|
|
|
switch (message) {
|
|
|
|
|
case PAUSE_MESSAGE_PARKING: DWIN_Popup_Pause(GET_TEXT(MSG_PAUSE_PRINT_PARKING)); break;
|
|
|
|
|
case PAUSE_MESSAGE_CHANGING: DWIN_Popup_Pause(GET_TEXT(MSG_FILAMENT_CHANGE_INIT)); break;
|
|
|
|
|
case PAUSE_MESSAGE_UNLOAD: DWIN_Popup_Pause(GET_TEXT(MSG_FILAMENT_CHANGE_UNLOAD)); break;
|
|
|
|
|
case PAUSE_MESSAGE_WAITING: DWIN_Popup_Pause(GET_TEXT(MSG_ADVANCED_PAUSE_WAITING), ICON_Continue_E); break;
|
|
|
|
|
case PAUSE_MESSAGE_INSERT: DWIN_Popup_Continue(ICON_BLTouch, "Advanced Pause", GET_TEXT(MSG_FILAMENT_CHANGE_INSERT)); break;
|
|
|
|
|
case PAUSE_MESSAGE_LOAD: DWIN_Popup_Pause(GET_TEXT(MSG_FILAMENT_CHANGE_LOAD)); break;
|
|
|
|
|
case PAUSE_MESSAGE_PURGE: DWIN_Popup_Pause(GET_TEXT(MSG_FILAMENT_CHANGE_PURGE)); break;
|
|
|
|
|
case PAUSE_MESSAGE_PARKING: DWIN_Popup_Pause(GET_TEXT_F(MSG_PAUSE_PRINT_PARKING)); break;
|
|
|
|
|
case PAUSE_MESSAGE_CHANGING: DWIN_Popup_Pause(GET_TEXT_F(MSG_FILAMENT_CHANGE_INIT)); break;
|
|
|
|
|
case PAUSE_MESSAGE_UNLOAD: DWIN_Popup_Pause(GET_TEXT_F(MSG_FILAMENT_CHANGE_UNLOAD)); break;
|
|
|
|
|
case PAUSE_MESSAGE_WAITING: DWIN_Popup_Pause(GET_TEXT_F(MSG_ADVANCED_PAUSE_WAITING), ICON_Continue_E); break;
|
|
|
|
|
case PAUSE_MESSAGE_INSERT: DWIN_Popup_Continue(ICON_BLTouch, F("Advanced Pause"), GET_TEXT_F(MSG_FILAMENT_CHANGE_INSERT)); break;
|
|
|
|
|
case PAUSE_MESSAGE_LOAD: DWIN_Popup_Pause(GET_TEXT_F(MSG_FILAMENT_CHANGE_LOAD)); break;
|
|
|
|
|
case PAUSE_MESSAGE_PURGE: DWIN_Popup_Pause(GET_TEXT_F(MSG_FILAMENT_CHANGE_PURGE)); break;
|
|
|
|
|
case PAUSE_MESSAGE_OPTION: DWIN_Popup_FilamentPurge(); break;
|
|
|
|
|
case PAUSE_MESSAGE_RESUME: DWIN_Popup_Pause(GET_TEXT(MSG_FILAMENT_CHANGE_RESUME)); break;
|
|
|
|
|
case PAUSE_MESSAGE_HEAT: DWIN_Popup_Pause(GET_TEXT(MSG_FILAMENT_CHANGE_HEAT), ICON_Continue_E); break;
|
|
|
|
|
case PAUSE_MESSAGE_RESUME: DWIN_Popup_Pause(GET_TEXT_F(MSG_FILAMENT_CHANGE_RESUME)); break;
|
|
|
|
|
case PAUSE_MESSAGE_HEAT: DWIN_Popup_Pause(GET_TEXT_F(MSG_FILAMENT_CHANGE_HEAT), ICON_Continue_E); break;
|
|
|
|
|
case PAUSE_MESSAGE_HEATING: ui.set_status_P(GET_TEXT(MSG_FILAMENT_CHANGE_HEATING)); break;
|
|
|
|
|
case PAUSE_MESSAGE_STATUS: HMI_ReturnScreen(); break;
|
|
|
|
|
default: break;
|
|
|
|
@ -1889,7 +1896,7 @@ void DWIN_Redraw_screen() {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Draw_Popup_FilamentPurge() {
|
|
|
|
|
DWIN_Draw_Popup(ICON_BLTouch, "Advanced Pause", "Purge or Continue?");
|
|
|
|
|
DWIN_Draw_Popup(ICON_BLTouch, F("Advanced Pause"), F("Purge or Continue?"));
|
|
|
|
|
DWINUI::Draw_Icon(ICON_Confirm_E, 26, 280);
|
|
|
|
|
DWINUI::Draw_Icon(ICON_Continue_E, 146, 280);
|
|
|
|
|
Draw_Select_Highlight(true);
|
|
|
|
@ -1928,7 +1935,7 @@ void DWIN_Redraw_screen() {
|
|
|
|
|
#if HAS_MESH
|
|
|
|
|
void DWIN_MeshViewer() {
|
|
|
|
|
if (!leveling_is_valid())
|
|
|
|
|
DWIN_Popup_Continue(ICON_BLTouch, "Mesh viewer", "No valid mesh");
|
|
|
|
|
DWIN_Popup_Continue(ICON_BLTouch, F("Mesh viewer"), F("No valid mesh"));
|
|
|
|
|
else {
|
|
|
|
|
HMI_SaveProcessID(WaitResponse);
|
|
|
|
|
MeshViewer.Draw();
|
|
|
|
|