|
@@ -42,10 +42,6 @@
|
42
|
42
|
#define JUST_BABYSTEP 1
|
43
|
43
|
#endif
|
44
|
44
|
|
45
|
|
-#include <WString.h>
|
46
|
|
-#include <stdio.h>
|
47
|
|
-#include <string.h>
|
48
|
|
-
|
49
|
45
|
#include "../../fontutils.h"
|
50
|
46
|
#include "../../marlinui.h"
|
51
|
47
|
|
|
@@ -85,6 +81,10 @@
|
85
|
81
|
#include "../../../feature/powerloss.h"
|
86
|
82
|
#endif
|
87
|
83
|
|
|
84
|
+#include <WString.h>
|
|
85
|
+#include <stdio.h>
|
|
86
|
+#include <string.h>
|
|
87
|
+
|
88
|
88
|
#ifndef MACHINE_SIZE
|
89
|
89
|
#define MACHINE_SIZE STRINGIFY(X_BED_SIZE) "x" STRINGIFY(Y_BED_SIZE) "x" STRINGIFY(Z_MAX_POS)
|
90
|
90
|
#endif
|
|
@@ -97,10 +97,6 @@
|
97
|
97
|
#define USE_STRING_HEADINGS
|
98
|
98
|
//#define USE_STRING_TITLES
|
99
|
99
|
|
100
|
|
-#define DWIN_FONT_MENU font8x16
|
101
|
|
-#define DWIN_FONT_STAT font10x20
|
102
|
|
-#define DWIN_FONT_HEAD font10x20
|
103
|
|
-
|
104
|
100
|
#define MENU_CHAR_LIMIT 24
|
105
|
101
|
#define STATUS_Y 360
|
106
|
102
|
|
|
@@ -135,6 +131,9 @@ constexpr uint16_t TROWS = 6, MROWS = TROWS - 1, // Total rows, and other
|
135
|
131
|
|
136
|
132
|
#define BABY_Z_VAR TERN(HAS_BED_PROBE, probe.offset.z, dwin_zoffset)
|
137
|
133
|
|
|
134
|
+#define DWIN_BOTTOM (DWIN_HEIGHT-1)
|
|
135
|
+#define DWIN_RIGHT (DWIN_WIDTH-1)
|
|
136
|
+
|
138
|
137
|
/* Value Init */
|
139
|
138
|
HMI_value_t HMI_ValueStruct;
|
140
|
139
|
HMI_Flag_t HMI_flag{0};
|
|
@@ -220,11 +219,11 @@ void HMI_ToggleLanguage() {
|
220
|
219
|
|
221
|
220
|
void DWIN_Draw_Signed_Float(uint8_t size, uint16_t bColor, uint8_t iNum, uint8_t fNum, uint16_t x, uint16_t y, long value) {
|
222
|
221
|
if (value < 0) {
|
223
|
|
- DWIN_Draw_String(false, true, size, Color_White, bColor, x - 6, y, F("-"));
|
|
222
|
+ DWIN_Draw_String(true, size, Color_White, bColor, x - 6, y, F("-"));
|
224
|
223
|
DWIN_Draw_FloatValue(true, true, 0, size, Color_White, bColor, iNum, fNum, x, y, -value);
|
225
|
224
|
}
|
226
|
225
|
else {
|
227
|
|
- DWIN_Draw_String(false, true, size, Color_White, bColor, x - 6, y, F(" "));
|
|
226
|
+ DWIN_Draw_String(true, size, Color_White, bColor, x - 6, y, F(" "));
|
228
|
227
|
DWIN_Draw_FloatValue(true, true, 0, size, Color_White, bColor, iNum, fNum, x, y, value);
|
229
|
228
|
}
|
230
|
229
|
}
|
|
@@ -391,20 +390,20 @@ void ICON_Stop() {
|
391
|
390
|
}
|
392
|
391
|
}
|
393
|
392
|
|
394
|
|
-void Clear_Title_Bar() {
|
395
|
|
- DWIN_Draw_Rectangle(1, Color_Bg_Blue, 0, 0, DWIN_WIDTH, 30);
|
|
393
|
+inline void Clear_Title_Bar() {
|
|
394
|
+ DWIN_Draw_Box(1, Color_Bg_Blue, 0, 0, DWIN_WIDTH, TITLE_HEIGHT);
|
396
|
395
|
}
|
397
|
396
|
|
398
|
397
|
void Draw_Title(const char * const title) {
|
399
|
|
- DWIN_Draw_String(false, false, DWIN_FONT_HEAD, Color_White, Color_Bg_Blue, 14, 4, (char*)title);
|
|
398
|
+ DWIN_Draw_String(false, DWIN_FONT_HEAD, Color_White, Color_Bg_Blue, 14, 4, (char*)title);
|
400
|
399
|
}
|
401
|
400
|
|
402
|
401
|
void Draw_Title(const __FlashStringHelper * title) {
|
403
|
|
- DWIN_Draw_String(false, false, DWIN_FONT_HEAD, Color_White, Color_Bg_Blue, 14, 4, (char*)title);
|
|
402
|
+ DWIN_Draw_String(false, DWIN_FONT_HEAD, Color_White, Color_Bg_Blue, 14, 4, (char*)title);
|
404
|
403
|
}
|
405
|
404
|
|
406
|
|
-void Clear_Menu_Area() {
|
407
|
|
- DWIN_Draw_Rectangle(1, Color_Bg_Black, 0, 31, DWIN_WIDTH, STATUS_Y - 1);
|
|
405
|
+inline void Clear_Menu_Area() {
|
|
406
|
+ DWIN_Draw_Box(1, Color_Bg_Black, 0, TITLE_HEIGHT, DWIN_WIDTH, STATUS_Y - TITLE_HEIGHT);
|
408
|
407
|
}
|
409
|
408
|
|
410
|
409
|
void Clear_Main_Window() {
|
|
@@ -465,7 +464,7 @@ void Erase_Menu_Text(const uint8_t line) {
|
465
|
464
|
}
|
466
|
465
|
|
467
|
466
|
void Draw_Menu_Item(const uint8_t line, const uint8_t icon=0, const char * const label=nullptr, bool more=false) {
|
468
|
|
- if (label) DWIN_Draw_String(false, false, font8x16, Color_White, Color_Bg_Black, LBLX, MBASE(line) - 1, (char*)label);
|
|
467
|
+ if (label) DWIN_Draw_String(false, font8x16, Color_White, Color_Bg_Black, LBLX, MBASE(line) - 1, (char*)label);
|
469
|
468
|
if (icon) Draw_Menu_Icon(line, icon);
|
470
|
469
|
if (more) Draw_More_Icon(line);
|
471
|
470
|
}
|
|
@@ -494,7 +493,8 @@ void Draw_Back_First(const bool is_sel=true) {
|
494
|
493
|
if (is_sel) Draw_Menu_Cursor(0);
|
495
|
494
|
}
|
496
|
495
|
|
497
|
|
-inline bool Apply_Encoder(const ENCODER_DiffState &encoder_diffState, auto &valref) {
|
|
496
|
+template <typename T>
|
|
497
|
+inline bool Apply_Encoder(const ENCODER_DiffState &encoder_diffState, T &valref) {
|
498
|
498
|
if (encoder_diffState == ENCODER_DIFF_CW)
|
499
|
499
|
valref += EncoderRate.encoderMoveValue;
|
500
|
500
|
else if (encoder_diffState == ENCODER_DIFF_CCW)
|
|
@@ -563,7 +563,7 @@ inline bool Apply_Encoder(const ENCODER_DiffState &encoder_diffState, auto &valr
|
563
|
563
|
//
|
564
|
564
|
|
565
|
565
|
void DWIN_Draw_Label(const uint16_t y, char *string) {
|
566
|
|
- DWIN_Draw_String(false, true, font8x16, Color_White, Color_Bg_Black, LBLX, y, string);
|
|
566
|
+ DWIN_Draw_String(true, font8x16, Color_White, Color_Bg_Black, LBLX, y, string);
|
567
|
567
|
}
|
568
|
568
|
void DWIN_Draw_Label(const uint16_t y, const __FlashStringHelper *title) {
|
569
|
569
|
DWIN_Draw_Label(y, (char*)title);
|
|
@@ -577,7 +577,9 @@ void draw_move_en(const uint16_t line) {
|
577
|
577
|
#endif
|
578
|
578
|
}
|
579
|
579
|
|
580
|
|
-void DWIN_Frame_TitleCopy(uint8_t id, uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2) { DWIN_Frame_AreaCopy(id, x1, y1, x2, y2, 14, 8); }
|
|
580
|
+inline void DWIN_Frame_TitleCopy(uint8_t id, uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2) {
|
|
581
|
+ DWIN_Frame_AreaCopy(id, x1, y1, x2, y2, 14, 8);
|
|
582
|
+}
|
581
|
583
|
|
582
|
584
|
void Item_Prepare_Move(const uint8_t row) {
|
583
|
585
|
if (HMI_IsChinese())
|
|
@@ -703,7 +705,7 @@ void Item_Prepare_Lang(const uint8_t row) {
|
703
|
705
|
DWIN_Frame_AreaCopy(1, 0, 194, 121, 207, LBLX, MBASE(row)); // "Language selection"
|
704
|
706
|
#endif
|
705
|
707
|
}
|
706
|
|
- DWIN_Draw_String(false, false, font8x16, Color_White, Color_Bg_Black, 226, MBASE(row), HMI_IsChinese() ? F("CN") : F("EN"));
|
|
708
|
+ DWIN_Draw_String(false, font8x16, Color_White, Color_Bg_Black, 226, MBASE(row), HMI_IsChinese() ? F("CN") : F("EN"));
|
707
|
709
|
Draw_Menu_Icon(row, ICON_Language);
|
708
|
710
|
}
|
709
|
711
|
|
|
@@ -849,7 +851,7 @@ void Draw_Tune_Menu() {
|
849
|
851
|
Clear_Main_Window();
|
850
|
852
|
|
851
|
853
|
if (HMI_IsChinese()) {
|
852
|
|
- DWIN_Frame_AreaCopy(1, 73, 2, 100, 13, 14, 9);
|
|
854
|
+ DWIN_Frame_TitleCopy(1, 73, 2, 100, 13);
|
853
|
855
|
DWIN_Frame_AreaCopy(1, 116, 164, 171, 176, LBLX, MBASE(TUNE_CASE_SPEED));
|
854
|
856
|
#if HAS_HOTEND
|
855
|
857
|
DWIN_Frame_AreaCopy(1, 1, 134, 56, 146, LBLX, MBASE(TUNE_CASE_TEMP));
|
|
@@ -883,6 +885,7 @@ void Draw_Tune_Menu() {
|
883
|
885
|
#endif
|
884
|
886
|
DWIN_Draw_Label(MBASE(TUNE_CASE_ZOFF), GET_TEXT_F(MSG_ZPROBE_ZOFFSET));
|
885
|
887
|
#else
|
|
888
|
+ DWIN_Frame_TitleCopy(1, 94, 2, 126, 12);
|
886
|
889
|
DWIN_Frame_AreaCopy(1, 1, 179, 92, 190, LBLX, MBASE(TUNE_CASE_SPEED)); // Print speed
|
887
|
890
|
#if HAS_HOTEND
|
888
|
891
|
DWIN_Frame_AreaCopy(1, 197, 104, 238, 114, LBLX, MBASE(TUNE_CASE_TEMP)); // Hotend...
|
|
@@ -1008,6 +1011,7 @@ void Draw_Motion_Menu() {
|
1008
|
1011
|
//
|
1009
|
1012
|
// Draw Popup Windows
|
1010
|
1013
|
//
|
|
1014
|
+
|
1011
|
1015
|
#if HAS_HOTEND || HAS_HEATED_BED
|
1012
|
1016
|
|
1013
|
1017
|
void DWIN_Popup_Temperature(const bool toohigh) {
|
|
@@ -1021,8 +1025,8 @@ void Draw_Motion_Menu() {
|
1021
|
1025
|
DWIN_Frame_AreaCopy(1, 189, 389, 271, 402, 95, 310);
|
1022
|
1026
|
}
|
1023
|
1027
|
else {
|
1024
|
|
- DWIN_Draw_String(false, true, font8x16, Popup_Text_Color, Color_Bg_Window, 36, 300, F("Nozzle or Bed temperature"));
|
1025
|
|
- DWIN_Draw_String(false, true, font8x16, Popup_Text_Color, Color_Bg_Window, 92, 300, F("is too high"));
|
|
1028
|
+ DWIN_Draw_String(true, font8x16, Popup_Text_Color, Color_Bg_Window, 36, 300, F("Nozzle or Bed temperature"));
|
|
1029
|
+ DWIN_Draw_String(true, font8x16, Popup_Text_Color, Color_Bg_Window, 92, 300, F("is too high"));
|
1026
|
1030
|
}
|
1027
|
1031
|
}
|
1028
|
1032
|
else {
|
|
@@ -1032,8 +1036,8 @@ void Draw_Motion_Menu() {
|
1032
|
1036
|
DWIN_Frame_AreaCopy(1, 189, 389, 271, 402, 95, 310);
|
1033
|
1037
|
}
|
1034
|
1038
|
else {
|
1035
|
|
- DWIN_Draw_String(false, true, font8x16, Popup_Text_Color, Color_Bg_Window, 36, 300, F("Nozzle or Bed temperature"));
|
1036
|
|
- DWIN_Draw_String(false, true, font8x16, Popup_Text_Color, Color_Bg_Window, 92, 300, F("is too low"));
|
|
1039
|
+ DWIN_Draw_String(true, font8x16, Popup_Text_Color, Color_Bg_Window, 36, 300, F("Nozzle or Bed temperature"));
|
|
1040
|
+ DWIN_Draw_String(true, font8x16, Popup_Text_Color, Color_Bg_Window, 92, 300, F("is too low"));
|
1037
|
1041
|
}
|
1038
|
1042
|
}
|
1039
|
1043
|
}
|
|
@@ -1052,11 +1056,11 @@ void Draw_Popup_Bkgd_60() {
|
1052
|
1056
|
DWIN_ICON_Show(ICON, ICON_TempTooLow, 102, 105);
|
1053
|
1057
|
if (HMI_IsChinese()) {
|
1054
|
1058
|
DWIN_Frame_AreaCopy(1, 103, 371, 136, 386, 69, 240);
|
1055
|
|
- DWIN_Frame_AreaCopy(1, 170, 371, 270, 386, 102, 240);
|
|
1059
|
+ DWIN_Frame_AreaCopy(1, 170, 371, 270, 386, 69 + 33, 240);
|
1056
|
1060
|
DWIN_ICON_Show(ICON, ICON_Confirm_C, 86, 280);
|
1057
|
1061
|
}
|
1058
|
1062
|
else {
|
1059
|
|
- DWIN_Draw_String(false, true, font8x16, Popup_Text_Color, Color_Bg_Window, 20, 235, F("Nozzle is too cold"));
|
|
1063
|
+ DWIN_Draw_String(true, font8x16, Popup_Text_Color, Color_Bg_Window, 20, 235, F("Nozzle is too cold"));
|
1060
|
1064
|
DWIN_ICON_Show(ICON, ICON_Confirm_E, 86, 280);
|
1061
|
1065
|
}
|
1062
|
1066
|
}
|
|
@@ -1073,9 +1077,9 @@ void Popup_Window_Resume() {
|
1073
|
1077
|
DWIN_ICON_Show(ICON, ICON_Continue_C, 146, 307);
|
1074
|
1078
|
}
|
1075
|
1079
|
else {
|
1076
|
|
- DWIN_Draw_String(false, true, font8x16, Popup_Text_Color, Color_Bg_Window, (272 - 8 * 14) / 2, 115, F("Continue Print"));
|
1077
|
|
- DWIN_Draw_String(false, true, font8x16, Popup_Text_Color, Color_Bg_Window, (272 - 8 * 22) / 2, 192, F("It looks like the last"));
|
1078
|
|
- DWIN_Draw_String(false, true, font8x16, Popup_Text_Color, Color_Bg_Window, (272 - 8 * 22) / 2, 212, F("file was interrupted."));
|
|
1080
|
+ DWIN_Draw_String(true, font8x16, Popup_Text_Color, Color_Bg_Window, (272 - 8 * 14) / 2, 115, F("Continue Print"));
|
|
1081
|
+ DWIN_Draw_String(true, font8x16, Popup_Text_Color, Color_Bg_Window, (272 - 8 * 22) / 2, 192, F("It looks like the last"));
|
|
1082
|
+ DWIN_Draw_String(true, font8x16, Popup_Text_Color, Color_Bg_Window, (272 - 8 * 22) / 2, 212, F("file was interrupted."));
|
1079
|
1083
|
DWIN_ICON_Show(ICON, ICON_Cancel_E, 26, 307);
|
1080
|
1084
|
DWIN_ICON_Show(ICON, ICON_Continue_E, 146, 307);
|
1081
|
1085
|
}
|
|
@@ -1091,8 +1095,8 @@ void Popup_Window_Home(const bool parking/*=false*/) {
|
1091
|
1095
|
DWIN_Frame_AreaCopy(1, 0, 389, 150, 402, 61, 280);
|
1092
|
1096
|
}
|
1093
|
1097
|
else {
|
1094
|
|
- DWIN_Draw_String(false, true, font8x16, Popup_Text_Color, Color_Bg_Window, (272 - 8 * (parking ? 7 : 10)) / 2, 230, parking ? F("Parking") : F("Homing XYZ"));
|
1095
|
|
- DWIN_Draw_String(false, true, font8x16, Popup_Text_Color, Color_Bg_Window, (272 - 8 * 23) / 2, 260, F("Please wait until done."));
|
|
1098
|
+ DWIN_Draw_String(true, font8x16, Popup_Text_Color, Color_Bg_Window, (272 - 8 * (parking ? 7 : 10)) / 2, 230, parking ? F("Parking") : F("Homing XYZ"));
|
|
1099
|
+ DWIN_Draw_String(true, font8x16, Popup_Text_Color, Color_Bg_Window, (272 - 8 * 23) / 2, 260, F("Please wait until done."));
|
1096
|
1100
|
}
|
1097
|
1101
|
}
|
1098
|
1102
|
|
|
@@ -1107,8 +1111,8 @@ void Popup_Window_Home(const bool parking/*=false*/) {
|
1107
|
1111
|
DWIN_Frame_AreaCopy(1, 0, 389, 150, 402, 61, 280);
|
1108
|
1112
|
}
|
1109
|
1113
|
else {
|
1110
|
|
- DWIN_Draw_String(false, true, font8x16, Popup_Text_Color, Color_Bg_Window, (272 - 8 * 13) / 2, 230, GET_TEXT_F(MSG_BED_LEVELING));
|
1111
|
|
- DWIN_Draw_String(false, true, font8x16, Popup_Text_Color, Color_Bg_Window, (272 - 8 * 23) / 2, 260, F("Please wait until done."));
|
|
1114
|
+ DWIN_Draw_String(true, font8x16, Popup_Text_Color, Color_Bg_Window, (272 - 8 * 13) / 2, 230, GET_TEXT_F(MSG_BED_LEVELING));
|
|
1115
|
+ DWIN_Draw_String(true, font8x16, Popup_Text_Color, Color_Bg_Window, (272 - 8 * 23) / 2, 260, F("Please wait until done."));
|
1112
|
1116
|
}
|
1113
|
1117
|
}
|
1114
|
1118
|
|
|
@@ -1135,8 +1139,8 @@ void Popup_window_PauseOrStop() {
|
1135
|
1139
|
DWIN_ICON_Show(ICON, ICON_Cancel_C, 146, 280);
|
1136
|
1140
|
}
|
1137
|
1141
|
else {
|
1138
|
|
- if (select_print.now == 1) DWIN_Draw_String(false, true, font8x16, Popup_Text_Color, Color_Bg_Window, (272 - 8 * 11) / 2, 150, GET_TEXT_F(MSG_PAUSE_PRINT));
|
1139
|
|
- else if (select_print.now == 2) DWIN_Draw_String(false, true, font8x16, Popup_Text_Color, Color_Bg_Window, (272 - 8 * 10) / 2, 150, GET_TEXT_F(MSG_STOP_PRINT));
|
|
1142
|
+ if (select_print.now == 1) DWIN_Draw_String(true, font8x16, Popup_Text_Color, Color_Bg_Window, (272 - 8 * 11) / 2, 150, GET_TEXT_F(MSG_PAUSE_PRINT));
|
|
1143
|
+ else if (select_print.now == 2) DWIN_Draw_String(true, font8x16, Popup_Text_Color, Color_Bg_Window, (272 - 8 * 10) / 2, 150, GET_TEXT_F(MSG_STOP_PRINT));
|
1140
|
1144
|
DWIN_ICON_Show(ICON, ICON_Confirm_E, 26, 280);
|
1141
|
1145
|
DWIN_ICON_Show(ICON, ICON_Cancel_E, 146, 280);
|
1142
|
1146
|
}
|
|
@@ -1160,19 +1164,19 @@ void Draw_Print_ProgressBar() {
|
1160
|
1164
|
DWIN_ICON_Show(ICON, ICON_Bar, 15, 93);
|
1161
|
1165
|
DWIN_Draw_Rectangle(1, BarFill_Color, 16 + _card_percent * 240 / 100, 93, 256, 113);
|
1162
|
1166
|
DWIN_Draw_IntValue(true, true, 0, font8x16, Percent_Color, Color_Bg_Black, 2, 117, 133, _card_percent);
|
1163
|
|
- DWIN_Draw_String(false, false, font8x16, Percent_Color, Color_Bg_Black, 133, 133, F("%"));
|
|
1167
|
+ DWIN_Draw_String(false, font8x16, Percent_Color, Color_Bg_Black, 133, 133, F("%"));
|
1164
|
1168
|
}
|
1165
|
1169
|
|
1166
|
1170
|
void Draw_Print_ProgressElapsed() {
|
1167
|
1171
|
duration_t elapsed = print_job_timer.duration(); // print timer
|
1168
|
1172
|
DWIN_Draw_IntValue(true, true, 1, font8x16, Color_White, Color_Bg_Black, 2, 42, 212, elapsed.value / 3600);
|
1169
|
|
- DWIN_Draw_String(false, false, font8x16, Color_White, Color_Bg_Black, 58, 212, F(":"));
|
|
1173
|
+ DWIN_Draw_String(false, font8x16, Color_White, Color_Bg_Black, 58, 212, F(":"));
|
1170
|
1174
|
DWIN_Draw_IntValue(true, true, 1, font8x16, Color_White, Color_Bg_Black, 2, 66, 212, (elapsed.value % 3600) / 60);
|
1171
|
1175
|
}
|
1172
|
1176
|
|
1173
|
1177
|
void Draw_Print_ProgressRemain() {
|
1174
|
1178
|
DWIN_Draw_IntValue(true, true, 1, font8x16, Color_White, Color_Bg_Black, 2, 176, 212, _remain_time / 3600);
|
1175
|
|
- DWIN_Draw_String(false, false, font8x16, Color_White, Color_Bg_Black, 192, 212, F(":"));
|
|
1179
|
+ DWIN_Draw_String(false, font8x16, Color_White, Color_Bg_Black, 192, 212, F(":"));
|
1176
|
1180
|
DWIN_Draw_IntValue(true, true, 1, font8x16, Color_White, Color_Bg_Black, 2, 200, 212, (_remain_time % 3600) / 60);
|
1177
|
1181
|
}
|
1178
|
1182
|
|
|
@@ -1189,7 +1193,7 @@ void Goto_PrintProcess() {
|
1189
|
1193
|
// Copy into filebuf string before entry
|
1190
|
1194
|
char * const name = card.longest_filename();
|
1191
|
1195
|
const int8_t npos = _MAX(0U, DWIN_WIDTH - strlen(name) * MENU_CHR_W) / 2;
|
1192
|
|
- DWIN_Draw_String(false, false, font8x16, Color_White, Color_Bg_Black, npos, 60, name);
|
|
1196
|
+ DWIN_Draw_String(false, font8x16, Color_White, Color_Bg_Black, npos, 60, name);
|
1193
|
1197
|
|
1194
|
1198
|
DWIN_ICON_Show(ICON, ICON_PrintTime, 17, 193);
|
1195
|
1199
|
DWIN_ICON_Show(ICON, ICON_RemainTime, 150, 191);
|
|
@@ -1204,14 +1208,13 @@ void Goto_MainMenu() {
|
1204
|
1208
|
|
1205
|
1209
|
Clear_Main_Window();
|
1206
|
1210
|
|
1207
|
|
- if (HMI_IsChinese()) {
|
1208
|
|
- DWIN_Frame_AreaCopy(1, 2, 2, 27, 14, 14, 9); // "Home"
|
1209
|
|
- }
|
|
1211
|
+ if (HMI_IsChinese())
|
|
1212
|
+ DWIN_Frame_TitleCopy(1, 2, 2, 27, 14); // "Home"
|
1210
|
1213
|
else {
|
1211
|
1214
|
#ifdef USE_STRING_HEADINGS
|
1212
|
1215
|
Draw_Title(GET_TEXT_F(MSG_MAIN));
|
1213
|
1216
|
#else
|
1214
|
|
- DWIN_Frame_AreaCopy(1, 0, 2, 39, 12, 14, 9);
|
|
1217
|
+ DWIN_Frame_TitleCopy(1, 0, 2, 39, 12);
|
1215
|
1218
|
#endif
|
1216
|
1219
|
}
|
1217
|
1220
|
|
|
@@ -1588,9 +1591,9 @@ void _update_axis_value(const AxisEnum axis, const uint16_t x, const uint16_t y,
|
1588
|
1591
|
|
1589
|
1592
|
if (force || changed || draw_qmark || draw_empty) {
|
1590
|
1593
|
if (blink && draw_qmark)
|
1591
|
|
- DWIN_Draw_String(false, true, font8x16, Color_White, Color_Bg_Black, x, y, F("???.?"));
|
|
1594
|
+ DWIN_Draw_String(true, font8x16, Color_White, Color_Bg_Black, x, y, F("???.?"));
|
1592
|
1595
|
else if (blink && draw_empty)
|
1593
|
|
- DWIN_Draw_String(false, true, font8x16, Color_White, Color_Bg_Black, x, y, F(" "));
|
|
1596
|
+ DWIN_Draw_String(true, font8x16, Color_White, Color_Bg_Black, x, y, F(" "));
|
1594
|
1597
|
else
|
1595
|
1598
|
DWIN_Draw_FloatValue(true, true, 0, font8x16, Color_White, Color_Bg_Black, 3, 1, x, y, p * 10);
|
1596
|
1599
|
}
|
|
@@ -1706,11 +1709,11 @@ void update_variable() {
|
1706
|
1709
|
_offset = BABY_Z_VAR;
|
1707
|
1710
|
if (BABY_Z_VAR < 0) {
|
1708
|
1711
|
DWIN_Draw_FloatValue(true, true, 0, DWIN_FONT_STAT, Color_White, Color_Bg_Black, 2, 2, 207, 417, -_offset * 100);
|
1709
|
|
- DWIN_Draw_String(false, true, font8x16, Color_White, Color_Bg_Black, 205, 419, F("-"));
|
|
1712
|
+ DWIN_Draw_String(true, font8x16, Color_White, Color_Bg_Black, 205, 419, F("-"));
|
1710
|
1713
|
}
|
1711
|
1714
|
else {
|
1712
|
1715
|
DWIN_Draw_FloatValue(true, true, 0, DWIN_FONT_STAT, Color_White, Color_Bg_Black, 2, 2, 207, 417, _offset * 100);
|
1713
|
|
- DWIN_Draw_String(false, true, font8x16, Color_White, Color_Bg_Black, 205, 419, F(" "));
|
|
1716
|
+ DWIN_Draw_String(true, font8x16, Color_White, Color_Bg_Black, 205, 419, F(" "));
|
1714
|
1717
|
}
|
1715
|
1718
|
}
|
1716
|
1719
|
|
|
@@ -1853,7 +1856,7 @@ void Redraw_SD_List() {
|
1853
|
1856
|
}
|
1854
|
1857
|
else {
|
1855
|
1858
|
DWIN_Draw_Rectangle(1, Color_Bg_Red, 10, MBASE(3) - 10, DWIN_WIDTH - 10, MBASE(4));
|
1856
|
|
- DWIN_Draw_String(false, false, font16x32, Color_Yellow, Color_Bg_Red, ((DWIN_WIDTH) - 8 * 16) / 2, MBASE(3), F("No Media"));
|
|
1859
|
+ DWIN_Draw_String(false, font16x32, Color_Yellow, Color_Bg_Red, ((DWIN_WIDTH) - 8 * 16) / 2, MBASE(3), F("No Media"));
|
1857
|
1860
|
}
|
1858
|
1861
|
}
|
1859
|
1862
|
|
|
@@ -1911,24 +1914,24 @@ void Draw_Status_Area(const bool with_update) {
|
1911
|
1914
|
#if HAS_HOTEND
|
1912
|
1915
|
DWIN_ICON_Show(ICON, ICON_HotendTemp, 10, 383);
|
1913
|
1916
|
DWIN_Draw_IntValue(true, true, 0, DWIN_FONT_STAT, Color_White, Color_Bg_Black, 3, 28, 384, thermalManager.wholeDegHotend(0));
|
1914
|
|
- DWIN_Draw_String(false, false, DWIN_FONT_STAT, Color_White, Color_Bg_Black, 25 + 3 * STAT_CHR_W + 5, 384, F("/"));
|
|
1917
|
+ DWIN_Draw_String(false, DWIN_FONT_STAT, Color_White, Color_Bg_Black, 25 + 3 * STAT_CHR_W + 5, 384, F("/"));
|
1915
|
1918
|
DWIN_Draw_IntValue(true, true, 0, DWIN_FONT_STAT, Color_White, Color_Bg_Black, 3, 25 + 4 * STAT_CHR_W + 6, 384, thermalManager.degTargetHotend(0));
|
1916
|
1919
|
|
1917
|
1920
|
DWIN_ICON_Show(ICON, ICON_StepE, 112, 417);
|
1918
|
1921
|
DWIN_Draw_IntValue(true, true, 0, DWIN_FONT_STAT, Color_White, Color_Bg_Black, 3, 116 + 2 * STAT_CHR_W, 417, planner.flow_percentage[0]);
|
1919
|
|
- DWIN_Draw_String(false, false, DWIN_FONT_STAT, Color_White, Color_Bg_Black, 116 + 5 * STAT_CHR_W + 2, 417, F("%"));
|
|
1922
|
+ DWIN_Draw_String(false, DWIN_FONT_STAT, Color_White, Color_Bg_Black, 116 + 5 * STAT_CHR_W + 2, 417, F("%"));
|
1920
|
1923
|
#endif
|
1921
|
1924
|
|
1922
|
1925
|
#if HAS_HEATED_BED
|
1923
|
1926
|
DWIN_ICON_Show(ICON, ICON_BedTemp, 10, 416);
|
1924
|
1927
|
DWIN_Draw_IntValue(true, true, 0, DWIN_FONT_STAT, Color_White, Color_Bg_Black, 3, 28, 417, thermalManager.wholeDegBed());
|
1925
|
|
- DWIN_Draw_String(false, false, DWIN_FONT_STAT, Color_White, Color_Bg_Black, 25 + 3 * STAT_CHR_W + 5, 417, F("/"));
|
|
1928
|
+ DWIN_Draw_String(false, DWIN_FONT_STAT, Color_White, Color_Bg_Black, 25 + 3 * STAT_CHR_W + 5, 417, F("/"));
|
1926
|
1929
|
DWIN_Draw_IntValue(true, true, 0, DWIN_FONT_STAT, Color_White, Color_Bg_Black, 3, 25 + 4 * STAT_CHR_W + 6, 417, thermalManager.degTargetBed());
|
1927
|
1930
|
#endif
|
1928
|
1931
|
|
1929
|
1932
|
DWIN_ICON_Show(ICON, ICON_Speed, 113, 383);
|
1930
|
1933
|
DWIN_Draw_IntValue(true, true, 0, DWIN_FONT_STAT, Color_White, Color_Bg_Black, 3, 116 + 2 * STAT_CHR_W, 384, feedrate_percentage);
|
1931
|
|
- DWIN_Draw_String(false, false, DWIN_FONT_STAT, Color_White, Color_Bg_Black, 116 + 5 * STAT_CHR_W + 2, 384, F("%"));
|
|
1934
|
+ DWIN_Draw_String(false, DWIN_FONT_STAT, Color_White, Color_Bg_Black, 116 + 5 * STAT_CHR_W + 2, 384, F("%"));
|
1932
|
1935
|
|
1933
|
1936
|
#if HAS_FAN
|
1934
|
1937
|
DWIN_ICON_Show(ICON, ICON_FanSpeed, 187, 383);
|
|
@@ -1941,11 +1944,11 @@ void Draw_Status_Area(const bool with_update) {
|
1941
|
1944
|
|
1942
|
1945
|
if (BABY_Z_VAR < 0) {
|
1943
|
1946
|
DWIN_Draw_FloatValue(true, true, 0, DWIN_FONT_STAT, Color_White, Color_Bg_Black, 2, 2, 207, 417, -BABY_Z_VAR * 100);
|
1944
|
|
- DWIN_Draw_String(false, true, font8x16, Color_White, Color_Bg_Black, 205, 419, F("-"));
|
|
1947
|
+ DWIN_Draw_String(true, font8x16, Color_White, Color_Bg_Black, 205, 419, F("-"));
|
1945
|
1948
|
}
|
1946
|
1949
|
else {
|
1947
|
1950
|
DWIN_Draw_FloatValue(true, true, 0, DWIN_FONT_STAT, Color_White, Color_Bg_Black, 2, 2, 207, 417, BABY_Z_VAR * 100);
|
1948
|
|
- DWIN_Draw_String(false, true, font8x16, Color_White, Color_Bg_Black, 205, 419, F(" "));
|
|
1951
|
+ DWIN_Draw_String(true, font8x16, Color_White, Color_Bg_Black, 205, 419, F(" "));
|
1949
|
1952
|
}
|
1950
|
1953
|
|
1951
|
1954
|
DWIN_Draw_Rectangle(1, Line_Color, 0, 449, DWIN_WIDTH, 451);
|
|
@@ -1969,8 +1972,8 @@ void HMI_StartFrame(const bool with_update) {
|
1969
|
1972
|
void Draw_Info_Menu() {
|
1970
|
1973
|
Clear_Main_Window();
|
1971
|
1974
|
|
1972
|
|
- DWIN_Draw_String(false, false, font8x16, Color_White, Color_Bg_Black, (DWIN_WIDTH - strlen(MACHINE_SIZE) * MENU_CHR_W) / 2, 122, F(MACHINE_SIZE));
|
1973
|
|
- DWIN_Draw_String(false, false, font8x16, Color_White, Color_Bg_Black, (DWIN_WIDTH - strlen(SHORT_BUILD_VERSION) * MENU_CHR_W) / 2, 195, F(SHORT_BUILD_VERSION));
|
|
1975
|
+ DWIN_Draw_String(false, font8x16, Color_White, Color_Bg_Black, (DWIN_WIDTH - strlen(MACHINE_SIZE) * MENU_CHR_W) / 2, 122, F(MACHINE_SIZE));
|
|
1976
|
+ DWIN_Draw_String(false, font8x16, Color_White, Color_Bg_Black, (DWIN_WIDTH - strlen(SHORT_BUILD_VERSION) * MENU_CHR_W) / 2, 195, F(SHORT_BUILD_VERSION));
|
1974
|
1977
|
|
1975
|
1978
|
if (HMI_IsChinese()) {
|
1976
|
1979
|
DWIN_Frame_TitleCopy(1, 30, 17, 57, 29); // "Info"
|
|
@@ -1990,7 +1993,7 @@ void Draw_Info_Menu() {
|
1990
|
1993
|
DWIN_Frame_AreaCopy(1, 146, 151, 254, 161, 82, 175);
|
1991
|
1994
|
DWIN_Frame_AreaCopy(1, 0, 165, 94, 175, 89, 248);
|
1992
|
1995
|
}
|
1993
|
|
- DWIN_Draw_String(false, false, font8x16, Color_White, Color_Bg_Black, (DWIN_WIDTH - strlen(CORP_WEBSITE) * MENU_CHR_W) / 2, 268, F(CORP_WEBSITE));
|
|
1996
|
+ DWIN_Draw_String(false, font8x16, Color_White, Color_Bg_Black, (DWIN_WIDTH - strlen(CORP_WEBSITE) * MENU_CHR_W) / 2, 268, F(CORP_WEBSITE));
|
1994
|
1997
|
|
1995
|
1998
|
Draw_Back_First();
|
1996
|
1999
|
LOOP_L_N(i, 3) {
|
|
@@ -4007,7 +4010,7 @@ void EachMomentUpdate() {
|
4007
|
4010
|
//(void)recovery.interrupted_file_exists();
|
4008
|
4011
|
char * const name = card.longest_filename();
|
4009
|
4012
|
const int8_t npos = _MAX(0U, DWIN_WIDTH - strlen(name) * (MENU_CHR_W)) / 2;
|
4010
|
|
- DWIN_Draw_String(false, true, font8x16, Popup_Text_Color, Color_Bg_Window, npos, 252, name);
|
|
4013
|
+ DWIN_Draw_String(true, font8x16, Popup_Text_Color, Color_Bg_Window, npos, 252, name);
|
4011
|
4014
|
DWIN_UpdateLCD();
|
4012
|
4015
|
|
4013
|
4016
|
while (recovery_flag) {
|
|
@@ -4033,7 +4036,7 @@ void EachMomentUpdate() {
|
4033
|
4036
|
Goto_PrintProcess();
|
4034
|
4037
|
Draw_Status_Area(true);
|
4035
|
4038
|
}
|
4036
|
|
- #endif
|
|
4039
|
+ #endif // POWER_LOSS_RECOVERY
|
4037
|
4040
|
|
4038
|
4041
|
DWIN_UpdateLCD();
|
4039
|
4042
|
}
|
|
@@ -4124,7 +4127,7 @@ void DWIN_CompletedLeveling() {
|
4124
|
4127
|
void DWIN_StatusChanged(const char *text) {
|
4125
|
4128
|
DWIN_Draw_Rectangle(1, Color_Bg_Blue, 0, STATUS_Y, DWIN_WIDTH, STATUS_Y + 20);
|
4126
|
4129
|
const int8_t x = _MAX(0U, DWIN_WIDTH - strlen_P(text) * MENU_CHR_W) / 2;
|
4127
|
|
- DWIN_Draw_String(false, false, font8x16, Color_White, Color_Bg_Blue, x, STATUS_Y + 2, F(text));
|
|
4130
|
+ DWIN_Draw_String(false, font8x16, Color_White, Color_Bg_Blue, x, STATUS_Y + 2, F(text));
|
4128
|
4131
|
DWIN_UpdateLCD();
|
4129
|
4132
|
}
|
4130
|
4133
|
|
|
@@ -4136,8 +4139,8 @@ void DWIN_StatusChanged_P(PGM_P const pstr) {
|
4136
|
4139
|
|
4137
|
4140
|
// GUI extension
|
4138
|
4141
|
void DWIN_Draw_Checkbox(uint16_t color, uint16_t bcolor, uint16_t x, uint16_t y, bool mode=false) {
|
4139
|
|
- DWIN_Draw_String(false,true,font8x16,Select_Color,bcolor,x+4,y,F(mode ? "x" : " "));
|
4140
|
|
- DWIN_Draw_Rectangle(0,color,x+2,y+2,x+17,y+17);
|
|
4142
|
+ DWIN_Draw_String(true, font8x16, Select_Color, bcolor, x + 4, y, F(mode ? "x" : " "));
|
|
4143
|
+ DWIN_Draw_Rectangle(0, color, x + 2, y + 2, x + 17, y + 17);
|
4141
|
4144
|
}
|
4142
|
4145
|
|
4143
|
4146
|
#endif // DWIN_CREALITY_LCD
|