瀏覽代碼

Clean up CrealityUI and MarlinUI (#22586)

Scott Lahteine 3 年之前
父節點
當前提交
09af42e1af
沒有連結到貢獻者的電子郵件帳戶。

+ 1
- 1
Marlin/Configuration_adv.h 查看文件

1580
  */
1580
  */
1581
 #if HAS_MARLINUI_U8GLIB
1581
 #if HAS_MARLINUI_U8GLIB
1582
   // Show SD percentage next to the progress bar
1582
   // Show SD percentage next to the progress bar
1583
-  //#define DOGM_SD_PERCENT
1583
+  //#define SHOW_SD_PERCENT
1584
 
1584
 
1585
   // Save many cycles by drawing a hollow frame or no frame on the Info Screen
1585
   // Save many cycles by drawing a hollow frame or no frame on the Info Screen
1586
   //#define XYZ_NO_FRAME
1586
   //#define XYZ_NO_FRAME

+ 2
- 0
Marlin/src/inc/SanityCheck.h 查看文件

577
   #error "CUSTOM_USER_MENUS has been replaced by CUSTOM_MENU_MAIN and CUSTOM_MENU_CONFIG."
577
   #error "CUSTOM_USER_MENUS has been replaced by CUSTOM_MENU_MAIN and CUSTOM_MENU_CONFIG."
578
 #elif defined(MKS_LCD12864)
578
 #elif defined(MKS_LCD12864)
579
   #error "MKS_LCD12864 is now MKS_LCD12864A or MKS_LCD12864B."
579
   #error "MKS_LCD12864 is now MKS_LCD12864A or MKS_LCD12864B."
580
+#elif defined(DOGM_SD_PERCENT)
581
+  #error "DOGM_SD_PERCENT is now SHOW_SD_PERCENT."
580
 #elif defined(NEOPIXEL_BKGD_LED_INDEX)
582
 #elif defined(NEOPIXEL_BKGD_LED_INDEX)
581
   #error "NEOPIXEL_BKGD_LED_INDEX is now NEOPIXEL_BKGD_INDEX_FIRST."
583
   #error "NEOPIXEL_BKGD_LED_INDEX is now NEOPIXEL_BKGD_INDEX_FIRST."
582
 #elif defined(TEMP_SENSOR_1_AS_REDUNDANT)
584
 #elif defined(TEMP_SENSOR_1_AS_REDUNDANT)

+ 3
- 4
Marlin/src/lcd/dogm/marlinui_DOGM.cpp 查看文件

354
   #if ENABLED(ADVANCED_PAUSE_FEATURE)
354
   #if ENABLED(ADVANCED_PAUSE_FEATURE)
355
 
355
 
356
     void MarlinUI::draw_hotend_status(const uint8_t row, const uint8_t extruder) {
356
     void MarlinUI::draw_hotend_status(const uint8_t row, const uint8_t extruder) {
357
-      row_y1 = row * (MENU_FONT_HEIGHT) + 1;
358
-      row_y2 = row_y1 + MENU_FONT_HEIGHT - 1;
357
+      u8g_uint_t y1 = row * (MENU_FONT_HEIGHT) + 1, y2 = y1 + MENU_FONT_HEIGHT - 1;
359
 
358
 
360
-      if (!PAGE_CONTAINS(row_y1 + 1, row_y2 + 2)) return;
359
+      if (!PAGE_CONTAINS(y1 + 1, y2 + 2)) return;
361
 
360
 
362
-      lcd_put_wchar(LCD_PIXEL_WIDTH - 11 * (MENU_FONT_WIDTH), row_y2, 'E');
361
+      lcd_put_wchar(LCD_PIXEL_WIDTH - 11 * (MENU_FONT_WIDTH), y2, 'E');
363
       lcd_put_wchar((char)('1' + extruder));
362
       lcd_put_wchar((char)('1' + extruder));
364
       lcd_put_wchar(' ');
363
       lcd_put_wchar(' ');
365
       lcd_put_u8str(i16tostr3rj(thermalManager.wholeDegHotend(extruder)));
364
       lcd_put_u8str(i16tostr3rj(thermalManager.wholeDegHotend(extruder)));

+ 10
- 14
Marlin/src/lcd/dogm/status_screen_DOGM.cpp 查看文件

456
   #endif
456
   #endif
457
 
457
 
458
   #if HAS_PRINT_PROGRESS
458
   #if HAS_PRINT_PROGRESS
459
-    #if DISABLED(DOGM_SD_PERCENT)
459
+    #if DISABLED(SHOW_SD_PERCENT)
460
       #define _SD_INFO_X(len) (PROGRESS_BAR_X + (PROGRESS_BAR_WIDTH) / 2 - (len) * (MENU_FONT_WIDTH) / 2)
460
       #define _SD_INFO_X(len) (PROGRESS_BAR_X + (PROGRESS_BAR_WIDTH) / 2 - (len) * (MENU_FONT_WIDTH) / 2)
461
     #else
461
     #else
462
       #define _SD_INFO_X(len) (LCD_PIXEL_WIDTH - (len) * (MENU_FONT_WIDTH))
462
       #define _SD_INFO_X(len) (LCD_PIXEL_WIDTH - (len) * (MENU_FONT_WIDTH))
463
     #endif
463
     #endif
464
 
464
 
465
-    #if ENABLED(DOGM_SD_PERCENT)
465
+    #if ENABLED(SHOW_SD_PERCENT)
466
       static char progress_string[5];
466
       static char progress_string[5];
467
     #endif
467
     #endif
468
     static uint8_t lastElapsed = 0xFF, lastProgress = 0xFF;
468
     static uint8_t lastElapsed = 0xFF, lastProgress = 0xFF;
471
     #if ENABLED(SHOW_REMAINING_TIME)
471
     #if ENABLED(SHOW_REMAINING_TIME)
472
       static u8g_uint_t estimation_x_pos = 0;
472
       static u8g_uint_t estimation_x_pos = 0;
473
       static char estimation_string[10];
473
       static char estimation_string[10];
474
-      #if BOTH(DOGM_SD_PERCENT, ROTATE_PROGRESS_DISPLAY)
474
+      #if BOTH(SHOW_SD_PERCENT, ROTATE_PROGRESS_DISPLAY)
475
         static u8g_uint_t progress_x_pos = 0;
475
         static u8g_uint_t progress_x_pos = 0;
476
         static uint8_t progress_state = 0;
476
         static uint8_t progress_state = 0;
477
         static bool prev_blink = 0;
477
         static bool prev_blink = 0;
526
 
526
 
527
         progress_bar_solid_width = u8g_uint_t((PROGRESS_BAR_WIDTH - 2) * (progress / (PROGRESS_SCALE)) * 0.01f);
527
         progress_bar_solid_width = u8g_uint_t((PROGRESS_BAR_WIDTH - 2) * (progress / (PROGRESS_SCALE)) * 0.01f);
528
 
528
 
529
-        #if ENABLED(DOGM_SD_PERCENT)
529
+        #if ENABLED(SHOW_SD_PERCENT)
530
           if (progress == 0) {
530
           if (progress == 0) {
531
             progress_string[0] = '\0';
531
             progress_string[0] = '\0';
532
             #if ENABLED(SHOW_REMAINING_TIME)
532
             #if ENABLED(SHOW_REMAINING_TIME)
543
         #endif
543
         #endif
544
       }
544
       }
545
 
545
 
546
-      constexpr bool can_show_days = DISABLED(DOGM_SD_PERCENT) || ENABLED(ROTATE_PROGRESS_DISPLAY);
546
+      constexpr bool can_show_days = DISABLED(SHOW_SD_PERCENT) || ENABLED(ROTATE_PROGRESS_DISPLAY);
547
       if (ev != lastElapsed) {
547
       if (ev != lastElapsed) {
548
         lastElapsed = ev;
548
         lastElapsed = ev;
549
         const uint8_t len = elapsed.toDigital(elapsed_string, can_show_days && elapsed.value >= 60*60*24L);
549
         const uint8_t len = elapsed.toDigital(elapsed_string, can_show_days && elapsed.value >= 60*60*24L);
564
             else {
564
             else {
565
               duration_t estimation = timeval;
565
               duration_t estimation = timeval;
566
               const uint8_t len = estimation.toDigital(estimation_string, can_show_days && estimation.value >= 60*60*24L);
566
               const uint8_t len = estimation.toDigital(estimation_string, can_show_days && estimation.value >= 60*60*24L);
567
-              estimation_x_pos = _SD_INFO_X(len
568
-                #if !BOTH(DOGM_SD_PERCENT, ROTATE_PROGRESS_DISPLAY)
569
-                  + 1
570
-                #endif
571
-              );
567
+              estimation_x_pos = _SD_INFO_X(len + !BOTH(SHOW_SD_PERCENT, ROTATE_PROGRESS_DISPLAY));
572
             }
568
             }
573
           }
569
           }
574
         #endif
570
         #endif
767
 
763
 
768
     if (PAGE_CONTAINS(EXTRAS_BASELINE - INFO_FONT_ASCENT, EXTRAS_BASELINE - 1)) {
764
     if (PAGE_CONTAINS(EXTRAS_BASELINE - INFO_FONT_ASCENT, EXTRAS_BASELINE - 1)) {
769
 
765
 
770
-      #if ALL(DOGM_SD_PERCENT, SHOW_REMAINING_TIME, ROTATE_PROGRESS_DISPLAY)
766
+      #if ALL(SHOW_SD_PERCENT, SHOW_REMAINING_TIME, ROTATE_PROGRESS_DISPLAY)
771
 
767
 
772
         if (prev_blink != blink) {
768
         if (prev_blink != blink) {
773
           prev_blink = blink;
769
           prev_blink = blink;
789
           lcd_put_u8str(elapsed_x_pos, EXTRAS_BASELINE, elapsed_string);
785
           lcd_put_u8str(elapsed_x_pos, EXTRAS_BASELINE, elapsed_string);
790
         }
786
         }
791
 
787
 
792
-      #else // !DOGM_SD_PERCENT || !SHOW_REMAINING_TIME || !ROTATE_PROGRESS_DISPLAY
788
+      #else // !SHOW_SD_PERCENT || !SHOW_REMAINING_TIME || !ROTATE_PROGRESS_DISPLAY
793
 
789
 
794
         //
790
         //
795
         // SD Percent Complete
791
         // SD Percent Complete
796
         //
792
         //
797
 
793
 
798
-        #if ENABLED(DOGM_SD_PERCENT)
794
+        #if ENABLED(SHOW_SD_PERCENT)
799
           if (progress_string[0]) {
795
           if (progress_string[0]) {
800
             lcd_put_u8str(55, EXTRAS_BASELINE, progress_string); // Percent complete
796
             lcd_put_u8str(55, EXTRAS_BASELINE, progress_string); // Percent complete
801
             lcd_put_wchar('%');
797
             lcd_put_wchar('%');
815
         #endif
811
         #endif
816
             lcd_put_u8str(elapsed_x_pos, EXTRAS_BASELINE, elapsed_string);
812
             lcd_put_u8str(elapsed_x_pos, EXTRAS_BASELINE, elapsed_string);
817
 
813
 
818
-      #endif // !DOGM_SD_PERCENT || !SHOW_REMAINING_TIME || !ROTATE_PROGRESS_DISPLAY
814
+      #endif // !SHOW_SD_PERCENT || !SHOW_REMAINING_TIME || !ROTATE_PROGRESS_DISPLAY
819
     }
815
     }
820
 
816
 
821
   #endif // HAS_PRINT_PROGRESS
817
   #endif // HAS_PRINT_PROGRESS

+ 916
- 773
Marlin/src/lcd/e3v2/creality/dwin.cpp
文件差異過大導致無法顯示
查看文件


+ 0
- 13
Marlin/src/lcd/e3v2/creality/dwin.h 查看文件

163
 extern HMI_value_t HMI_ValueStruct;
163
 extern HMI_value_t HMI_ValueStruct;
164
 extern HMI_Flag_t HMI_flag;
164
 extern HMI_Flag_t HMI_flag;
165
 
165
 
166
-// Show ICO
167
-void ICON_Print(bool show);
168
-void ICON_Prepare(bool show);
169
-void ICON_Control(bool show);
170
-void ICON_Leveling(bool show);
171
-void ICON_StartInfo(bool show);
172
-
173
-void ICON_Setting(bool show);
174
-void ICON_Pause(bool show);
175
-void ICON_Continue(bool show);
176
-void ICON_Stop(bool show);
177
-
178
 #if HAS_HOTEND || HAS_HEATED_BED
166
 #if HAS_HOTEND || HAS_HEATED_BED
179
   // Popup message window
167
   // Popup message window
180
   void DWIN_Popup_Temperature(const bool toohigh);
168
   void DWIN_Popup_Temperature(const bool toohigh);
261
 void DWIN_HandleScreen();
249
 void DWIN_HandleScreen();
262
 void DWIN_StatusChanged(const char *text);
250
 void DWIN_StatusChanged(const char *text);
263
 void DWIN_StatusChanged_P(PGM_P const pstr);
251
 void DWIN_StatusChanged_P(PGM_P const pstr);
264
-void DWIN_Draw_Checkbox(uint16_t color, uint16_t bcolor, uint16_t x, uint16_t y, bool mode /* = false*/);
265
 
252
 
266
 inline void DWIN_StartHoming() { HMI_flag.home_flag = true; }
253
 inline void DWIN_StartHoming() { HMI_flag.home_flag = true; }
267
 
254
 

+ 5
- 8
Marlin/src/lcd/e3v2/creality/dwin_lcd.h 查看文件

31
 
31
 
32
 #include <stdint.h>
32
 #include <stdint.h>
33
 
33
 
34
+//#define USE_STRING_HEADINGS
35
+//#define USE_STRING_TITLES
36
+
34
 #define RECEIVED_NO_DATA         0x00
37
 #define RECEIVED_NO_DATA         0x00
35
 #define RECEIVED_SHAKE_HAND_ACK  0x01
38
 #define RECEIVED_SHAKE_HAND_ACK  0x01
36
 
39
 
42
 #define DWIN_WIDTH  272
45
 #define DWIN_WIDTH  272
43
 #define DWIN_HEIGHT 480
46
 #define DWIN_HEIGHT 480
44
 
47
 
45
-// Character matrix width x height
46
-//#define LCD_WIDTH ((DWIN_WIDTH) / 8)
47
-//#define LCD_HEIGHT ((DWIN_HEIGHT) / 12)
48
-
49
 // Picture ID
48
 // Picture ID
50
-#define DWIN_Boot_Screen    0
51
 #define Language_English    1
49
 #define Language_English    1
52
 #define Language_Chinese    2
50
 #define Language_Chinese    2
53
 
51
 
54
 // ICON ID
52
 // ICON ID
55
-#define ICON                      0x09
53
+#define ICON                7 // Icon set file 7.ICO
56
 
54
 
57
 #define ICON_LOGO                  0
55
 #define ICON_LOGO                  0
58
 #define ICON_Print_0               1
56
 #define ICON_Print_0               1
258
 //  color: Rectangle color
256
 //  color: Rectangle color
259
 //  xStart/yStart: upper left point
257
 //  xStart/yStart: upper left point
260
 //  xEnd/yEnd: lower right point
258
 //  xEnd/yEnd: lower right point
261
-void DWIN_Draw_Rectangle(uint8_t mode, uint16_t color,
262
-                         uint16_t xStart, uint16_t yStart, uint16_t xEnd, uint16_t yEnd);
259
+void DWIN_Draw_Rectangle(uint8_t mode, uint16_t color,  uint16_t xStart, uint16_t yStart, uint16_t xEnd, uint16_t yEnd);
263
 
260
 
264
 // Draw a box
261
 // Draw a box
265
 //  mode: 0=frame, 1=fill, 2=XOR fill
262
 //  mode: 0=frame, 1=fill, 2=XOR fill

+ 9
- 9
Marlin/src/lcd/language/language_en.h 查看文件

273
   PROGMEM Language_Str MSG_MOVE_I                          = _UxGT("Move ") LCD_STR_I;
273
   PROGMEM Language_Str MSG_MOVE_I                          = _UxGT("Move ") LCD_STR_I;
274
   PROGMEM Language_Str MSG_MOVE_J                          = _UxGT("Move ") LCD_STR_J;
274
   PROGMEM Language_Str MSG_MOVE_J                          = _UxGT("Move ") LCD_STR_J;
275
   PROGMEM Language_Str MSG_MOVE_K                          = _UxGT("Move ") LCD_STR_K;
275
   PROGMEM Language_Str MSG_MOVE_K                          = _UxGT("Move ") LCD_STR_K;
276
-  PROGMEM Language_Str MSG_MOVE_E                          = _UxGT("Extruder");
277
-  PROGMEM Language_Str MSG_MOVE_EN                         = _UxGT("Extruder *");
276
+  PROGMEM Language_Str MSG_MOVE_E                          = _UxGT("Move Extruder");
277
+  PROGMEM Language_Str MSG_MOVE_EN                         = _UxGT("Move E*");
278
   PROGMEM Language_Str MSG_HOTEND_TOO_COLD                 = _UxGT("Hotend too cold");
278
   PROGMEM Language_Str MSG_HOTEND_TOO_COLD                 = _UxGT("Hotend too cold");
279
   PROGMEM Language_Str MSG_MOVE_N_MM                       = _UxGT("Move %smm");
279
   PROGMEM Language_Str MSG_MOVE_N_MM                       = _UxGT("Move %smm");
280
   PROGMEM Language_Str MSG_MOVE_01MM                       = _UxGT("Move 0.1mm");
280
   PROGMEM Language_Str MSG_MOVE_01MM                       = _UxGT("Move 0.1mm");
336
   PROGMEM Language_Str MSG_SELECT_E                        = _UxGT("Select *");
336
   PROGMEM Language_Str MSG_SELECT_E                        = _UxGT("Select *");
337
   PROGMEM Language_Str MSG_ACC                             = _UxGT("Accel");
337
   PROGMEM Language_Str MSG_ACC                             = _UxGT("Accel");
338
   PROGMEM Language_Str MSG_JERK                            = _UxGT("Jerk");
338
   PROGMEM Language_Str MSG_JERK                            = _UxGT("Jerk");
339
-  PROGMEM Language_Str MSG_VA_JERK                         = _UxGT("V") LCD_STR_A _UxGT("-Jerk");
340
-  PROGMEM Language_Str MSG_VB_JERK                         = _UxGT("V") LCD_STR_B _UxGT("-Jerk");
341
-  PROGMEM Language_Str MSG_VC_JERK                         = _UxGT("V") LCD_STR_C _UxGT("-Jerk");
342
-  PROGMEM Language_Str MSG_VI_JERK                         = _UxGT("V") LCD_STR_I _UxGT("-Jerk");
343
-  PROGMEM Language_Str MSG_VJ_JERK                         = _UxGT("V") LCD_STR_J _UxGT("-Jerk");
344
-  PROGMEM Language_Str MSG_VK_JERK                         = _UxGT("V") LCD_STR_K _UxGT("-Jerk");
345
-  PROGMEM Language_Str MSG_VE_JERK                         = _UxGT("Ve-Jerk");
339
+  PROGMEM Language_Str MSG_VA_JERK                         = _UxGT("Max ") LCD_STR_A _UxGT(" Jerk");
340
+  PROGMEM Language_Str MSG_VB_JERK                         = _UxGT("Max ") LCD_STR_B _UxGT(" Jerk");
341
+  PROGMEM Language_Str MSG_VC_JERK                         = _UxGT("Max ") LCD_STR_C _UxGT(" Jerk");
342
+  PROGMEM Language_Str MSG_VI_JERK                         = _UxGT("Max ") LCD_STR_I _UxGT(" Jerk");
343
+  PROGMEM Language_Str MSG_VJ_JERK                         = _UxGT("Max ") LCD_STR_J _UxGT(" Jerk");
344
+  PROGMEM Language_Str MSG_VK_JERK                         = _UxGT("Max ") LCD_STR_K _UxGT(" Jerk");
345
+  PROGMEM Language_Str MSG_VE_JERK                         = _UxGT("Max E Jerk");
346
   PROGMEM Language_Str MSG_JUNCTION_DEVIATION              = _UxGT("Junction Dev");
346
   PROGMEM Language_Str MSG_JUNCTION_DEVIATION              = _UxGT("Junction Dev");
347
   PROGMEM Language_Str MSG_VELOCITY                        = _UxGT("Velocity");
347
   PROGMEM Language_Str MSG_VELOCITY                        = _UxGT("Velocity");
348
   PROGMEM Language_Str MSG_VMAX_A                          = _UxGT("Vmax ") LCD_STR_A;
348
   PROGMEM Language_Str MSG_VMAX_A                          = _UxGT("Vmax ") LCD_STR_A;

+ 1
- 1
Marlin/src/lcd/menu/menu_media.cpp 查看文件

126
     #endif
126
     #endif
127
   }
127
   }
128
   else if (card.isMounted())
128
   else if (card.isMounted())
129
-    ACTION_ITEM_P(PSTR(LCD_STR_FOLDER ".."), lcd_sd_updir);
129
+    ACTION_ITEM_P(PSTR(LCD_STR_FOLDER " .."), lcd_sd_updir);
130
 
130
 
131
   if (ui.should_draw()) for (uint16_t i = 0; i < fileCnt; i++) {
131
   if (ui.should_draw()) for (uint16_t i = 0; i < fileCnt; i++) {
132
     if (_menuLineNr == _thisItemNr) {
132
     if (_menuLineNr == _thisItemNr) {

+ 1
- 1
buildroot/tests/STM32F103RET6_creality 查看文件

11
 #
11
 #
12
 use_example_configs "Creality/Ender-3 V2/CrealityUI"
12
 use_example_configs "Creality/Ender-3 V2/CrealityUI"
13
 opt_enable MARLIN_DEV_MODE BUFFER_MONITORING
13
 opt_enable MARLIN_DEV_MODE BUFFER_MONITORING
14
-exec_test $1 $2 "Ender 3 v2" "$3"
14
+exec_test $1 $2 "Ender 3 v2 with CrealityUI" "$3"
15
 
15
 
16
 use_example_configs "Creality/Ender-3 V2/CrealityUI"
16
 use_example_configs "Creality/Ender-3 V2/CrealityUI"
17
 opt_disable CLASSIC_JERK
17
 opt_disable CLASSIC_JERK

Loading…
取消
儲存