|
@@ -432,7 +432,7 @@ void Draw_Back_First(const bool is_sel=true) {
|
432
|
432
|
//PopUps
|
433
|
433
|
void Popup_window_PauseOrStop() {
|
434
|
434
|
if (HMI_IsChinese()) {
|
435
|
|
- DWINUI::ClearMenuArea();
|
|
435
|
+ DWINUI::ClearMainArea();
|
436
|
436
|
Draw_Popup_Bkgd();
|
437
|
437
|
if (select_print.now == PRINT_PAUSE_RESUME) DWIN_Frame_AreaCopy(1, 237, 338, 269, 356, 98, 150);
|
438
|
438
|
else if (select_print.now == PRINT_STOP) DWIN_Frame_AreaCopy(1, 221, 320, 253, 336, 98, 150);
|
|
@@ -451,7 +451,7 @@ void Popup_window_PauseOrStop() {
|
451
|
451
|
void Popup_Window_ETempTooLow() {
|
452
|
452
|
if (HMI_IsChinese()) {
|
453
|
453
|
HMI_SaveProcessID(WaitResponse);
|
454
|
|
- DWINUI::ClearMenuArea();
|
|
454
|
+ DWINUI::ClearMainArea();
|
455
|
455
|
Draw_Popup_Bkgd();
|
456
|
456
|
DWINUI::Draw_Icon(ICON_TempTooLow, 102, 105);
|
457
|
457
|
DWIN_Frame_AreaCopy(1, 103, 371, 136, 386, 69, 240);
|
|
@@ -469,7 +469,7 @@ void Popup_window_PauseOrStop() {
|
469
|
469
|
void DWIN_Popup_Temperature(const bool toohigh) {
|
470
|
470
|
HMI_SaveProcessID(WaitResponse);
|
471
|
471
|
if (HMI_IsChinese()) {
|
472
|
|
- DWINUI::ClearMenuArea();
|
|
472
|
+ DWINUI::ClearMainArea();
|
473
|
473
|
Draw_Popup_Bkgd();
|
474
|
474
|
if (toohigh) {
|
475
|
475
|
DWINUI::Draw_Icon(ICON_TempTooHigh, 102, 165);
|
|
@@ -579,13 +579,13 @@ void Draw_Print_ProgressBar() {
|
579
|
579
|
void Draw_Print_ProgressElapsed() {
|
580
|
580
|
char buf[10];
|
581
|
581
|
duration_t elapsed = print_job_timer.duration(); // print timer
|
582
|
|
- sprintf_P(buf, PSTR("%02i:%02i"), (uint16_t)(elapsed.value / 3600), ((uint16_t)elapsed.value % 3600) / 60);
|
|
582
|
+ sprintf_P(buf, PSTR("%02i:%02i "), (uint16_t)(elapsed.value / 3600), ((uint16_t)elapsed.value % 3600) / 60);
|
583
|
583
|
DWINUI::Draw_String(HMI_data.Text_Color, HMI_data.Background_Color, 47, 192, buf);
|
584
|
584
|
}
|
585
|
585
|
|
586
|
586
|
void Draw_Print_ProgressRemain() {
|
587
|
587
|
char buf[10];
|
588
|
|
- sprintf_P(buf, PSTR("%02i:%02i"), (uint16_t)(_remain_time / 3600), ((uint16_t)_remain_time % 3600) / 60);
|
|
588
|
+ sprintf_P(buf, PSTR("%02i:%02i "), (uint16_t)(_remain_time / 3600), ((uint16_t)_remain_time % 3600) / 60);
|
589
|
589
|
DWINUI::Draw_String(HMI_data.Text_Color, HMI_data.Background_Color, 181, 192, buf);
|
590
|
590
|
}
|
591
|
591
|
|
|
@@ -612,7 +612,7 @@ void Draw_PrintProcess() {
|
612
|
612
|
Title.FrameCopy(30, 1, 42, 14); // "Printing"
|
613
|
613
|
else
|
614
|
614
|
Title.ShowCaption(GET_TEXT_F(MSG_PRINTING));
|
615
|
|
- DWINUI::ClearMenuArea();
|
|
615
|
+ DWINUI::ClearMainArea();
|
616
|
616
|
DWIN_Print_Header(sdprint ? card.longest_filename() : nullptr);
|
617
|
617
|
Draw_Print_Labels();
|
618
|
618
|
DWINUI::Draw_Icon(ICON_PrintTime, 15, 173);
|
|
@@ -641,7 +641,7 @@ void Draw_PrintDone() {
|
641
|
641
|
_remain_time = 0;
|
642
|
642
|
|
643
|
643
|
Title.ShowCaption(GET_TEXT_F(MSG_PRINT_DONE));
|
644
|
|
- DWINUI::ClearMenuArea();
|
|
644
|
+ DWINUI::ClearMainArea();
|
645
|
645
|
DWIN_Print_Header(nullptr);
|
646
|
646
|
Draw_Print_ProgressBar();
|
647
|
647
|
Draw_Print_Labels();
|
|
@@ -663,7 +663,7 @@ void Goto_PrintDone() {
|
663
|
663
|
}
|
664
|
664
|
|
665
|
665
|
void Draw_Main_Menu() {
|
666
|
|
- DWINUI::ClearMenuArea();
|
|
666
|
+ DWINUI::ClearMainArea();
|
667
|
667
|
if (HMI_IsChinese())
|
668
|
668
|
Title.FrameCopy(2, 2, 26, 13); // "Home" etc
|
669
|
669
|
else
|
|
@@ -933,7 +933,7 @@ void Redraw_SD_List() {
|
933
|
933
|
select_file.reset();
|
934
|
934
|
index_file = MROWS;
|
935
|
935
|
|
936
|
|
- DWINUI::ClearMenuArea(); // Leave title bar unchanged
|
|
936
|
+ DWINUI::ClearMainArea(); // Leave title bar unchanged
|
937
|
937
|
|
938
|
938
|
Draw_Back_First();
|
939
|
939
|
|
|
@@ -1041,7 +1041,7 @@ void DWIN_Draw_Dashboard() {
|
1041
|
1041
|
}
|
1042
|
1042
|
|
1043
|
1043
|
void Draw_Info_Menu() {
|
1044
|
|
- DWINUI::ClearMenuArea();
|
|
1044
|
+ DWINUI::ClearMainArea();
|
1045
|
1045
|
Draw_Back_First();
|
1046
|
1046
|
if (HMI_IsChinese())
|
1047
|
1047
|
Title.FrameCopy(30, 17, 28, 13); // "Info"
|
|
@@ -1107,7 +1107,7 @@ void HMI_MainMenu() {
|
1107
|
1107
|
case PAGE_PRINT:
|
1108
|
1108
|
checkkey = SelectFile;
|
1109
|
1109
|
card.mount();
|
1110
|
|
- delay(300);
|
|
1110
|
+ safe_delay(300);
|
1111
|
1111
|
Draw_Print_File_Menu();
|
1112
|
1112
|
break;
|
1113
|
1113
|
case PAGE_PREPARE: Draw_Prepare_Menu(); break;
|
|
@@ -1349,8 +1349,8 @@ void HMI_Init() {
|
1349
|
1349
|
|
1350
|
1350
|
void EachMomentUpdate() {
|
1351
|
1351
|
static millis_t next_var_update_ms = 0, next_rts_update_ms = 0, next_status_update_ms = 0;
|
1352
|
|
-
|
1353
|
1352
|
const millis_t ms = millis();
|
|
1353
|
+
|
1354
|
1354
|
if (ELAPSED(ms, next_var_update_ms)) {
|
1355
|
1355
|
next_var_update_ms = ms + DWIN_VAR_UPDATE_INTERVAL;
|
1356
|
1356
|
update_variable();
|
|
@@ -1439,7 +1439,7 @@ void EachMomentUpdate() {
|
1439
|
1439
|
|
1440
|
1440
|
#if ENABLED(POWER_LOSS_RECOVERY)
|
1441
|
1441
|
void Popup_PowerLossRecovery() {
|
1442
|
|
- DWINUI::ClearMenuArea();
|
|
1442
|
+ DWINUI::ClearMainArea();
|
1443
|
1443
|
Draw_Popup_Bkgd();
|
1444
|
1444
|
if (HMI_IsChinese()) {
|
1445
|
1445
|
DWIN_Frame_AreaCopy(1, 160, 338, 235, 354, 98, 115);
|
|
@@ -1478,7 +1478,7 @@ void EachMomentUpdate() {
|
1478
|
1478
|
|
1479
|
1479
|
void Goto_PowerLossRecovery() {
|
1480
|
1480
|
recovery.dwin_flag = false;
|
1481
|
|
- LCD_MESSAGE_F(GET_TEXT_F(MSG_CONTINUE_PRINT_JOB));
|
|
1481
|
+ LCD_MESSAGE(MSG_CONTINUE_PRINT_JOB);
|
1482
|
1482
|
Goto_Popup(Popup_PowerLossRecovery, onClick_PowerLossRecovery);
|
1483
|
1483
|
}
|
1484
|
1484
|
|
|
@@ -1581,15 +1581,15 @@ void DWIN_PidTuning(pidresult_t result) {
|
1581
|
1581
|
break;
|
1582
|
1582
|
case PID_BAD_EXTRUDER_NUM:
|
1583
|
1583
|
checkkey = last_checkkey;
|
1584
|
|
- DWIN_Popup_Confirm(ICON_TempTooLow, F("PID Autotune failed!"), F("Bad extruder"));
|
|
1584
|
+ DWIN_Popup_Confirm(ICON_TempTooLow, GET_TEXT_F(MSG_PID_AUTOTUNE_FAILED), GET_TEXT_F(MSG_BAD_EXTRUDER_NUM));
|
1585
|
1585
|
break;
|
1586
|
1586
|
case PID_TUNING_TIMEOUT:
|
1587
|
1587
|
checkkey = last_checkkey;
|
1588
|
|
- DWIN_Popup_Confirm(ICON_TempTooHigh, F("Error"), GET_TEXT_F(MSG_PID_TIMEOUT));
|
|
1588
|
+ DWIN_Popup_Confirm(ICON_TempTooHigh, GET_TEXT_F(MSG_ERROR), GET_TEXT_F(MSG_PID_TIMEOUT));
|
1589
|
1589
|
break;
|
1590
|
1590
|
case PID_TEMP_TOO_HIGH:
|
1591
|
1591
|
checkkey = last_checkkey;
|
1592
|
|
- DWIN_Popup_Confirm(ICON_TempTooHigh, F("PID Autotune failed!"), F("Temperature too high"));
|
|
1592
|
+ DWIN_Popup_Confirm(ICON_TempTooHigh, GET_TEXT_F(MSG_PID_AUTOTUNE_FAILED), GET_TEXT_F(MSG_TEMP_TOO_HIGH));
|
1593
|
1593
|
break;
|
1594
|
1594
|
case PID_DONE:
|
1595
|
1595
|
checkkey = last_checkkey;
|
|
@@ -1637,7 +1637,7 @@ void DWIN_Print_Finished() {
|
1637
|
1637
|
HMI_flag.pause_flag = false;
|
1638
|
1638
|
wait_for_heatup = false;
|
1639
|
1639
|
planner.finish_and_disable();
|
1640
|
|
- thermalManager.cooldown();
|
|
1640
|
+ thermalManager.cooldown();
|
1641
|
1641
|
Goto_PrintDone();
|
1642
|
1642
|
}
|
1643
|
1643
|
|
|
@@ -1652,8 +1652,8 @@ void DWIN_Print_Aborted() {
|
1652
|
1652
|
}
|
1653
|
1653
|
|
1654
|
1654
|
// Progress Bar update
|
1655
|
|
-void DWIN_Progress_Update() {
|
1656
|
1655
|
if (parser.seenval('P')) _percent_done = parser.byteval('P');
|
|
1656
|
+void DWIN_M73() {
|
1657
|
1657
|
if (parser.seenval('R')) {
|
1658
|
1658
|
_remain_time = parser.ulongval('R') * 60;
|
1659
|
1659
|
HMI_flag.remain_flag = true;
|
|
@@ -1707,11 +1707,11 @@ void DWIN_SetDataDefaults() {
|
1707
|
1707
|
TERN_(BAUD_RATE_GCODE, SetBaud250K());
|
1708
|
1708
|
}
|
1709
|
1709
|
|
1710
|
|
-void DWIN_StoreSettings(char *buff) {
|
|
1710
|
+void DWIN_CopySettingsTo(char * const buff) {
|
1711
|
1711
|
memcpy(buff, &HMI_data, _MIN(sizeof(HMI_data), eeprom_data_size));
|
1712
|
1712
|
}
|
1713
|
1713
|
|
1714
|
|
-void DWIN_LoadSettings(const char *buff) {
|
|
1714
|
+void DWIN_CopySettingsFrom(const char * const buff) {
|
1715
|
1715
|
// (void *)-> Avoid Warning when save data different from uintX_t in HMI_data_t struct
|
1716
|
1716
|
memcpy((void *)&HMI_data, buff, _MIN(sizeof(HMI_data), eeprom_data_size));
|
1717
|
1717
|
dwin_zoffset = TERN0(HAS_BED_PROBE, probe.offset.z);
|
|
@@ -1729,6 +1729,7 @@ void DWIN_LoadSettings(const char *buff) {
|
1729
|
1729
|
// Apply Led Color
|
1730
|
1730
|
leds.set_color(HMI_data.Led_Color);
|
1731
|
1731
|
#endif
|
|
1732
|
+
|
1732
|
1733
|
}
|
1733
|
1734
|
|
1734
|
1735
|
// Initialize or re-initialize the LCD
|
|
@@ -1773,10 +1774,10 @@ void DWIN_RebootScreen() {
|
1773
|
1774
|
DWIN_JPG_ShowAndCache(0);
|
1774
|
1775
|
DWINUI::Draw_CenteredString(Color_White, 220, GET_TEXT_F(MSG_PLEASE_WAIT_REBOOT));
|
1775
|
1776
|
DWIN_UpdateLCD();
|
1776
|
|
- delay(500);
|
|
1777
|
+ safe_delay(500);
|
1777
|
1778
|
}
|
1778
|
1779
|
|
1779
|
|
-void DWIN_Redraw_screen() {
|
|
1780
|
+void DWIN_RedrawScreen() {
|
1780
|
1781
|
Draw_Main_Area();
|
1781
|
1782
|
hash_changed = true;
|
1782
|
1783
|
DWIN_DrawStatusMessage();
|
|
@@ -1898,13 +1899,13 @@ void Goto_ConfirmToPrint() {
|
1898
|
1899
|
|
1899
|
1900
|
void ReadEeprom() {
|
1900
|
1901
|
const bool success = settings.load();
|
1901
|
|
- DWIN_Redraw_screen();
|
|
1902
|
+ DWIN_RedrawScreen();
|
1902
|
1903
|
HMI_AudioFeedback(success);
|
1903
|
1904
|
}
|
1904
|
1905
|
|
1905
|
1906
|
void ResetEeprom() {
|
1906
|
1907
|
settings.reset();
|
1907
|
|
- DWIN_Redraw_screen();
|
|
1908
|
+ DWIN_RedrawScreen();
|
1908
|
1909
|
HMI_AudioFeedback();
|
1909
|
1910
|
}
|
1910
|
1911
|
#endif
|
|
@@ -1947,7 +1948,7 @@ void SetHome() {
|
1947
|
1948
|
}
|
1948
|
1949
|
|
1949
|
1950
|
#if HAS_ZOFFSET_ITEM
|
1950
|
|
- bool printer_busy() { return planner.movesplanned() || printingIsActive(); }
|
|
1951
|
+
|
1951
|
1952
|
void ApplyZOffset() { TERN_(EEPROM_SETTINGS, settings.save()); }
|
1952
|
1953
|
void LiveZOffset() {
|
1953
|
1954
|
last_zoffset = dwin_zoffset;
|
|
@@ -2066,7 +2067,7 @@ void SetPID(celsius_t t, heater_id_t h) {
|
2066
|
2067
|
void ApplyBrightness() { ui.set_brightness(MenuData.Value); }
|
2067
|
2068
|
void LiveBrightness() { DWIN_LCD_Brightness(MenuData.Value); }
|
2068
|
2069
|
void SetBrightness() { SetIntOnClick(LCD_BRIGHTNESS_MIN, LCD_BRIGHTNESS_MAX, ui.brightness, ApplyBrightness, LiveBrightness); }
|
2069
|
|
- void TurnOffBacklight() { HMI_SaveProcessID(WaitResponse); ui.set_brightness(0); DWIN_Redraw_screen(); }
|
|
2070
|
+ void TurnOffBacklight() { HMI_SaveProcessID(WaitResponse); ui.set_brightness(0); DWIN_RedrawScreen(); }
|
2070
|
2071
|
#endif
|
2071
|
2072
|
|
2072
|
2073
|
#if ENABLED(CASE_LIGHT_MENU)
|
|
@@ -2170,7 +2171,7 @@ void SetPID(celsius_t t, heater_id_t h) {
|
2170
|
2171
|
void RestoreDefaultsColors() {
|
2171
|
2172
|
DWIN_SetColorDefaults();
|
2172
|
2173
|
DWINUI::SetColors(HMI_data.Text_Color, HMI_data.Background_Color, HMI_data.StatusBg_Color);
|
2173
|
|
- DWIN_Redraw_screen();
|
|
2174
|
+ DWIN_RedrawScreen();
|
2174
|
2175
|
}
|
2175
|
2176
|
|
2176
|
2177
|
void SelColor() {
|
|
@@ -2981,7 +2982,7 @@ void Draw_Prepare_Menu() {
|
2981
|
2982
|
}
|
2982
|
2983
|
|
2983
|
2984
|
void Draw_Tramming_Menu() {
|
2984
|
|
- DWINUI::ClearMenuArea();
|
|
2985
|
+ DWINUI::ClearMainArea();
|
2985
|
2986
|
checkkey = Menu;
|
2986
|
2987
|
if (!TrammingMenu) TrammingMenu = new MenuClass();
|
2987
|
2988
|
if (CurrentMenu != TrammingMenu) {
|