瀏覽代碼

♻️ Set Progress without LCD (#24767)

Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
EvilGremlin 2 年之前
父節點
當前提交
f595e40ceb
共有 34 個檔案被更改,包括 627 行新增488 行删除
  1. 1
    0
      .gitignore
  2. 29
    32
      Marlin/Configuration_adv.h
  3. 1
    1
      Marlin/src/MarlinCore.cpp
  4. 2
    2
      Marlin/src/gcode/gcode.cpp
  5. 2
    2
      Marlin/src/gcode/gcode.h
  6. 1
    1
      Marlin/src/gcode/host/M115.cpp
  7. 45
    9
      Marlin/src/gcode/lcd/M73.cpp
  8. 2
    2
      Marlin/src/gcode/sd/M1001.cpp
  9. 1
    1
      Marlin/src/gcode/sd/M23.cpp
  10. 0
    4
      Marlin/src/inc/Conditionals_LCD.h
  11. 7
    1
      Marlin/src/inc/Conditionals_adv.h
  12. 15
    11
      Marlin/src/inc/SanityCheck.h
  13. 61
    62
      Marlin/src/lcd/HD44780/marlinui_HD44780.cpp
  14. 1
    1
      Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp
  15. 95
    129
      Marlin/src/lcd/dogm/status_screen_DOGM.cpp
  16. 194
    133
      Marlin/src/lcd/dogm/status_screen_lite_ST7920.cpp
  17. 14
    3
      Marlin/src/lcd/dogm/status_screen_lite_ST7920.h
  18. 7
    7
      Marlin/src/lcd/e3v2/jyersui/dwin.cpp
  19. 1
    1
      Marlin/src/lcd/e3v2/jyersui/dwin.h
  20. 3
    3
      Marlin/src/lcd/e3v2/marlinui/ui_status_480x272.cpp
  21. 2
    2
      Marlin/src/lcd/e3v2/proui/dwin.cpp
  22. 1
    1
      Marlin/src/lcd/extui/dgus/fysetc/DGUSDisplayDef.cpp
  23. 1
    1
      Marlin/src/lcd/extui/dgus/hiprecy/DGUSDisplayDef.cpp
  24. 1
    1
      Marlin/src/lcd/extui/dgus/mks/DGUSDisplayDef.cpp
  25. 2
    2
      Marlin/src/lcd/extui/mks_ui/draw_printing.cpp
  26. 3
    0
      Marlin/src/lcd/extui/ui_api.h
  27. 41
    17
      Marlin/src/lcd/marlinui.cpp
  28. 26
    6
      Marlin/src/lcd/marlinui.h
  29. 1
    1
      Marlin/src/lcd/menu/menu.cpp
  30. 2
    2
      Marlin/src/libs/numtostr.cpp
  31. 1
    1
      buildroot/tests/SAMD51_grandcentral_m4
  32. 1
    1
      buildroot/tests/STM32F103RE_creality
  33. 62
    47
      buildroot/tests/mega2560
  34. 1
    1
      ini/features.ini

+ 1
- 0
.gitignore 查看文件

@@ -147,6 +147,7 @@ vc-fileutils.settings
147 147
 imgui.ini
148 148
 eeprom.dat
149 149
 spi_flash.bin
150
+fs.img
150 151
 
151 152
 #cmake
152 153
 CMakeLists.txt

+ 29
- 32
Marlin/Configuration_adv.h 查看文件

@@ -1403,9 +1403,6 @@
1403 1403
   // On the Info Screen, display XY with one decimal place when possible
1404 1404
   //#define LCD_DECIMAL_SMALL_XY
1405 1405
 
1406
-  // Add an 'M73' G-code to set the current percentage
1407
-  //#define LCD_SET_PROGRESS_MANUALLY
1408
-
1409 1406
   // Show the E position (filament used) during printing
1410 1407
   //#define LCD_SHOW_E_TOTAL
1411 1408
 
@@ -1426,37 +1423,43 @@
1426 1423
       //#define LED_USER_PRESET_STARTUP       // Have the printer display the user preset color on startup
1427 1424
     #endif
1428 1425
     #if ENABLED(NEO2_COLOR_PRESETS)
1429
-      #define NEO2_USER_PRESET_RED        255  // User defined RED value
1430
-      #define NEO2_USER_PRESET_GREEN      128  // User defined GREEN value
1431
-      #define NEO2_USER_PRESET_BLUE         0  // User defined BLUE value
1432
-      #define NEO2_USER_PRESET_WHITE      255  // User defined WHITE value
1433
-      #define NEO2_USER_PRESET_BRIGHTNESS 255  // User defined intensity
1434
-      //#define NEO2_USER_PRESET_STARTUP       // Have the printer display the user preset color on startup for the second strip
1426
+      #define NEO2_USER_PRESET_RED        255 // User defined RED value
1427
+      #define NEO2_USER_PRESET_GREEN      128 // User defined GREEN value
1428
+      #define NEO2_USER_PRESET_BLUE         0 // User defined BLUE value
1429
+      #define NEO2_USER_PRESET_WHITE      255 // User defined WHITE value
1430
+      #define NEO2_USER_PRESET_BRIGHTNESS 255 // User defined intensity
1431
+      //#define NEO2_USER_PRESET_STARTUP      // Have the printer display the user preset color on startup for the second strip
1435 1432
     #endif
1436 1433
   #endif
1437 1434
 
1438
-#endif
1435
+#endif // HAS_DISPLAY || DWIN_LCD_PROUI
1439 1436
 
1440
-// LCD Print Progress options
1441
-#if EITHER(SDSUPPORT, LCD_SET_PROGRESS_MANUALLY)
1442
-  #if CAN_SHOW_REMAINING_TIME
1443
-    //#define SHOW_REMAINING_TIME         // Display estimated time to completion
1444
-    #if ENABLED(SHOW_REMAINING_TIME)
1445
-      //#define USE_M73_REMAINING_TIME    // Use remaining time from M73 command instead of estimation
1446
-      //#define ROTATE_PROGRESS_DISPLAY   // Display (P)rogress, (E)lapsed, and (R)emaining time
1447
-    #endif
1437
+// Add the G-code 'M73' to set / report the current job progress
1438
+//#define SET_PROGRESS_MANUALLY
1439
+#if ENABLED(SET_PROGRESS_MANUALLY)
1440
+  //#define SET_PROGRESS_PERCENT          // Add 'P' parameter to set percentage done, otherwise use Marlin's estimate
1441
+  //#define SET_REMAINING_TIME            // Add 'R' parameter to set remaining time, otherwise use Marlin's estimate
1442
+  //#define SET_INTERACTION_TIME          // Add 'C' parameter to set time until next filament change or other user interaction
1443
+  #if ENABLED(SET_INTERACTION_TIME)
1444
+    #define SHOW_INTERACTION_TIME         // Display time until next user interaction ('C' = filament change)
1448 1445
   #endif
1446
+  //#define M73_REPORT                    // Report progress to host with 'M73'
1447
+#endif
1449 1448
 
1450
-  #if EITHER(HAS_MARLINUI_U8GLIB, EXTENSIBLE_UI)
1451
-    //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits
1452
-  #endif
1449
+// LCD Print Progress options, multiple can be rotated depending on screen layout
1450
+#if HAS_DISPLAY && EITHER(SDSUPPORT, SET_PROGRESS_MANUALLY)
1451
+  #define SHOW_PROGRESS_PERCENT           // Show print progress percentage (doesn't affect progress bar)
1452
+  #define SHOW_ELAPSED_TIME               // Display elapsed printing time (prefix 'E')
1453
+  //#define SHOW_REMAINING_TIME           // Display estimated time to completion (prefix 'R')
1454
+
1455
+  //#define PRINT_PROGRESS_SHOW_DECIMALS  // Show/report progress with decimal digits, not all UIs support this
1453 1456
 
1454 1457
   #if EITHER(HAS_MARLINUI_HD44780, IS_TFTGLCD_PANEL)
1455 1458
     //#define LCD_PROGRESS_BAR            // Show a progress bar on HD44780 LCDs for SD printing
1456 1459
     #if ENABLED(LCD_PROGRESS_BAR)
1457 1460
       #define PROGRESS_BAR_BAR_TIME 2000  // (ms) Amount of time to show the bar
1458 1461
       #define PROGRESS_BAR_MSG_TIME 3000  // (ms) Amount of time to show the status message
1459
-      #define PROGRESS_MSG_EXPIRE   0     // (ms) Amount of time to retain the status message (0=forever)
1462
+      #define PROGRESS_MSG_EXPIRE      0  // (ms) Amount of time to retain the status message (0=forever)
1460 1463
       //#define PROGRESS_MSG_ONCE         // Show the message for MSG_TIME then clear it
1461 1464
       //#define LCD_PROGRESS_BAR_TEST     // Add a menu item to test the progress bar
1462 1465
     #endif
@@ -1799,14 +1802,8 @@
1799 1802
 #endif // HAS_MARLINUI_U8GLIB
1800 1803
 
1801 1804
 #if HAS_MARLINUI_U8GLIB || IS_DWIN_MARLINUI
1802
-  // Show SD percentage next to the progress bar
1803
-  //#define SHOW_SD_PERCENT
1804
-
1805
-  // Enable to save many cycles by drawing a hollow frame on Menu Screens
1806
-  #define MENU_HOLLOW_FRAME
1807
-
1808
-  // Swap the CW/CCW indicators in the graphics overlay
1809
-  //#define OVERLAY_GFX_REVERSE
1805
+  #define MENU_HOLLOW_FRAME           // Enable to save many cycles by drawing a hollow frame on Menu Screens
1806
+  //#define OVERLAY_GFX_REVERSE       // Swap the CW/CCW indicators in the graphics overlay
1810 1807
 #endif
1811 1808
 
1812 1809
 //
@@ -2064,7 +2061,7 @@
2064 2061
  */
2065 2062
 //#define LIN_ADVANCE
2066 2063
 #if ENABLED(LIN_ADVANCE)
2067
-  //#define EXTRA_LIN_ADVANCE_K // Add a second linear advance constant, configurable with M900.
2064
+  //#define EXTRA_LIN_ADVANCE_K // Add a second linear advance constant, configurable with M900 L.
2068 2065
   #define LIN_ADVANCE_K 0.22    // Unit: mm compression per 1mm/s extruder speed
2069 2066
   //#define LA_DEBUG            // Print debug information to serial during operation. Disable for production use.
2070 2067
   //#define EXPERIMENTAL_SCURVE // Allow S-Curve Acceleration to be used with LA.
@@ -4058,7 +4055,7 @@
4058 4055
 
4059 4056
 /**
4060 4057
  * Mechanical Gantry Calibration
4061
- * Modern replacement for the Prusa TMC_Z_CALIBRATION.
4058
+ * Modern replacement for the Průša TMC_Z_CALIBRATION.
4062 4059
  * Adds capability to work with any adjustable current drivers.
4063 4060
  * Implemented as G34 because M915 is deprecated.
4064 4061
  * @section calibrate

+ 1
- 1
Marlin/src/MarlinCore.cpp 查看文件

@@ -347,7 +347,7 @@ void startOrResumeJob() {
347 347
     TERN_(GCODE_REPEAT_MARKERS, repeat.reset());
348 348
     TERN_(CANCEL_OBJECTS, cancelable.reset());
349 349
     TERN_(LCD_SHOW_E_TOTAL, e_move_accumulator = 0);
350
-    #if BOTH(LCD_SET_PROGRESS_MANUALLY, USE_M73_REMAINING_TIME)
350
+    #if ENABLED(SET_REMAINING_TIME)
351 351
       ui.reset_remaining_time();
352 352
     #endif
353 353
   }

+ 2
- 2
Marlin/src/gcode/gcode.cpp 查看文件

@@ -561,8 +561,8 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
561 561
         case 48: M48(); break;                                    // M48: Z probe repeatability test
562 562
       #endif
563 563
 
564
-      #if ENABLED(LCD_SET_PROGRESS_MANUALLY)
565
-        case 73: M73(); break;                                    // M73: Set progress percentage (for display on LCD)
564
+      #if ENABLED(SET_PROGRESS_MANUALLY)
565
+        case 73: M73(); break;                                    // M73: Set progress percentage
566 566
       #endif
567 567
 
568 568
       case 75: M75(); break;                                      // M75: Start print timer

+ 2
- 2
Marlin/src/gcode/gcode.h 查看文件

@@ -114,7 +114,7 @@
114 114
  * M43  - Display pin status, watch pins for changes, watch endstops & toggle LED, Z servo probe test, toggle pins (Requires PINS_DEBUGGING)
115 115
  * M48  - Measure Z Probe repeatability: M48 P<points> X<pos> Y<pos> V<level> E<engage> L<legs> S<chizoid>. (Requires Z_MIN_PROBE_REPEATABILITY_TEST)
116 116
  *
117
- * M73  - Set the progress percentage. (Requires LCD_SET_PROGRESS_MANUALLY)
117
+ * M73  - Set the progress percentage. (Requires SET_PROGRESS_MANUALLY)
118 118
  * M75  - Start the print job timer.
119 119
  * M76  - Pause the print job timer.
120 120
  * M77  - Stop the print job timer.
@@ -677,7 +677,7 @@ private:
677 677
     static void M48();
678 678
   #endif
679 679
 
680
-  #if ENABLED(LCD_SET_PROGRESS_MANUALLY)
680
+  #if ENABLED(SET_PROGRESS_MANUALLY)
681 681
     static void M73();
682 682
   #endif
683 683
 

+ 1
- 1
Marlin/src/gcode/host/M115.cpp 查看文件

@@ -142,7 +142,7 @@ void GcodeSuite::M115() {
142 142
     cap_line(F("LEVELING_DATA"), ENABLED(HAS_LEVELING));
143 143
 
144 144
     // BUILD_PERCENT (M73)
145
-    cap_line(F("BUILD_PERCENT"), ENABLED(LCD_SET_PROGRESS_MANUALLY));
145
+    cap_line(F("BUILD_PERCENT"), ENABLED(SET_PROGRESS_PERCENT));
146 146
 
147 147
     // SOFTWARE_POWER (M80, M81)
148 148
     cap_line(F("SOFTWARE_POWER"), ENABLED(PSU_CONTROL));

+ 45
- 9
Marlin/src/gcode/lcd/M73.cpp 查看文件

@@ -22,21 +22,35 @@
22 22
 
23 23
 #include "../../inc/MarlinConfig.h"
24 24
 
25
-#if ENABLED(LCD_SET_PROGRESS_MANUALLY)
25
+#if ENABLED(SET_PROGRESS_MANUALLY)
26 26
 
27 27
 #include "../gcode.h"
28 28
 #include "../../lcd/marlinui.h"
29 29
 #include "../../sd/cardreader.h"
30
+#include "../../libs/numtostr.h"
30 31
 
31 32
 #if ENABLED(DWIN_LCD_PROUI)
32 33
   #include "../../lcd/e3v2/proui/dwin.h"
33 34
 #endif
34 35
 
36
+#if ENABLED(M73_REPORT)
37
+  #define M73_REPORT_PRUSA
38
+#endif
39
+
35 40
 /**
36 41
  * M73: Set percentage complete (for display on LCD)
37 42
  *
38 43
  * Example:
39
- *   M73 P25 ; Set progress to 25%
44
+ *   M73 P25.63 ; Set progress to 25.63%
45
+ *   M73 R456   ; Set remaining time to 456 minutes
46
+ *   M73 C12    ; Set next interaction countdown to 12 minutes
47
+ *   M73        ; Report current values
48
+ *
49
+ * Use a shorter-than-Průša report format:
50
+ * M73 Percent done: ---%; Time left: -----m; Change: -----m;
51
+ *
52
+ * When PRINT_PROGRESS_SHOW_DECIMALS is enabled - reports percent with 100 / 23.4 / 3.45 format
53
+ *
40 54
  */
41 55
 void GcodeSuite::M73() {
42 56
 
@@ -46,17 +60,39 @@ void GcodeSuite::M73() {
46 60
 
47 61
   #else
48 62
 
49
-    if (parser.seenval('P'))
50
-      ui.set_progress((PROGRESS_SCALE) > 1
51
-        ? parser.value_float() * (PROGRESS_SCALE)
52
-        : parser.value_byte()
53
-      );
63
+    #if ENABLED(SET_PROGRESS_PERCENT)
64
+      if (parser.seenval('P'))
65
+        ui.set_progress((PROGRESS_SCALE) > 1
66
+          ? parser.value_float() * (PROGRESS_SCALE)
67
+          : parser.value_byte()
68
+        );
69
+    #endif
54 70
 
55
-    #if ENABLED(USE_M73_REMAINING_TIME)
71
+    #if ENABLED(SET_REMAINING_TIME)
56 72
       if (parser.seenval('R')) ui.set_remaining_time(60 * parser.value_ulong());
57 73
     #endif
58 74
 
75
+    #if ENABLED(SET_INTERACTION_TIME)
76
+      if (parser.seenval('C')) ui.set_interaction_time(60 * parser.value_ulong());
77
+    #endif
78
+
79
+  #endif
80
+
81
+  #if ENABLED(M73_REPORT)
82
+  {
83
+    SERIAL_ECHO_MSG(
84
+        TERN(M73_REPORT_PRUSA, "M73 Percent done: ", "Progress: ")
85
+      , TERN(PRINT_PROGRESS_SHOW_DECIMALS, permyriadtostr4(ui.get_progress_permyriad()), ui.get_progress_percent())
86
+      #if ENABLED(SET_REMAINING_TIME)
87
+        , TERN(M73_REPORT_PRUSA, "; Print time remaining in mins: ", "%; Time left: "), ui.remaining_time / 60
88
+      #endif
89
+      #if ENABLED(SET_INTERACTION_TIME)
90
+        , TERN(M73_REPORT_PRUSA, "; Change in mins: ", "m; Change: "), ui.interaction_time / 60
91
+      #endif
92
+      , TERN(M73_REPORT_PRUSA, ";", "m")
93
+    );
94
+  }
59 95
   #endif
60 96
 }
61 97
 
62
-#endif // LCD_SET_PROGRESS_MANUALLY
98
+#endif // SET_PROGRESS_MANUALLY

+ 2
- 2
Marlin/src/gcode/sd/M1001.cpp 查看文件

@@ -34,7 +34,7 @@
34 34
   #include "../queue.h"
35 35
 #endif
36 36
 
37
-#if EITHER(LCD_SET_PROGRESS_MANUALLY, SD_REPRINT_LAST_SELECTED_FILE)
37
+#if EITHER(SET_PROGRESS_MANUALLY, SD_REPRINT_LAST_SELECTED_FILE)
38 38
   #include "../../lcd/marlinui.h"
39 39
 #endif
40 40
 
@@ -84,7 +84,7 @@ void GcodeSuite::M1001() {
84 84
   process_subcommands_now(F("M77"));
85 85
 
86 86
   // Set the progress bar "done" state
87
-  TERN_(LCD_SET_PROGRESS_MANUALLY, ui.set_progress_done());
87
+  TERN_(SET_PROGRESS_PERCENT, ui.set_progress_done());
88 88
 
89 89
   // Announce SD file completion
90 90
   {

+ 1
- 1
Marlin/src/gcode/sd/M23.cpp 查看文件

@@ -38,7 +38,7 @@ void GcodeSuite::M23() {
38 38
   for (char *fn = parser.string_arg; *fn; ++fn) if (*fn == ' ') *fn = '\0';
39 39
   card.openFileRead(parser.string_arg);
40 40
 
41
-  TERN_(LCD_SET_PROGRESS_MANUALLY, ui.set_progress(0));
41
+  TERN_(SET_PROGRESS_PERCENT, ui.set_progress(0));
42 42
 }
43 43
 
44 44
 #endif // SDSUPPORT

+ 0
- 4
Marlin/src/inc/Conditionals_LCD.h 查看文件

@@ -529,10 +529,6 @@
529 529
   #define HAS_MANUAL_MOVE_MENU 1
530 530
 #endif
531 531
 
532
-#if ANY(HAS_MARLINUI_U8GLIB, EXTENSIBLE_UI, HAS_MARLINUI_HD44780, IS_TFTGLCD_PANEL, IS_DWIN_MARLINUI, DWIN_CREALITY_LCD_JYERSUI)
533
-  #define CAN_SHOW_REMAINING_TIME 1
534
-#endif
535
-
536 532
 #if HAS_MARLINUI_U8GLIB
537 533
   #ifndef LCD_PIXEL_WIDTH
538 534
     #define LCD_PIXEL_WIDTH 128

+ 7
- 1
Marlin/src/inc/Conditionals_adv.h 查看文件

@@ -599,10 +599,16 @@
599 599
   #undef MENU_ADDAUTOSTART
600 600
 #endif
601 601
 
602
-#if EITHER(SDSUPPORT, LCD_SET_PROGRESS_MANUALLY)
602
+#if EITHER(SDSUPPORT, SET_PROGRESS_MANUALLY)
603 603
   #define HAS_PRINT_PROGRESS 1
604 604
 #endif
605 605
 
606
+#if DISABLED(SET_PROGRESS_MANUALLY)
607
+  #undef SET_REMAINING_TIME
608
+  #undef SET_INTERACTION_TIME
609
+  #undef M73_REPORT
610
+#endif
611
+
606 612
 #if ANY(HAS_MARLINUI_MENU, ULTIPANEL_FEEDMULTIPLY, SOFT_RESET_ON_KILL)
607 613
   #define HAS_ENCODER_ACTION 1
608 614
 #endif

+ 15
- 11
Marlin/src/inc/SanityCheck.h 查看文件

@@ -587,7 +587,7 @@
587 587
 #elif defined(MKS_LCD12864)
588 588
   #error "MKS_LCD12864 is now MKS_LCD12864A or MKS_LCD12864B."
589 589
 #elif defined(DOGM_SD_PERCENT)
590
-  #error "DOGM_SD_PERCENT is now SHOW_SD_PERCENT."
590
+  #error "DOGM_SD_PERCENT is now SHOW_PROGRESS_PERCENT."
591 591
 #elif defined(NEOPIXEL_BKGD_LED_INDEX)
592 592
   #error "NEOPIXEL_BKGD_LED_INDEX is now NEOPIXEL_BKGD_INDEX_FIRST."
593 593
 #elif defined(TEMP_SENSOR_1_AS_REDUNDANT)
@@ -646,6 +646,12 @@
646 646
   #error "TOUCH_IDLE_SLEEP (seconds) is now TOUCH_IDLE_SLEEP_MINS (minutes)."
647 647
 #elif defined(LCD_BACKLIGHT_TIMEOUT)
648 648
   #error "LCD_BACKLIGHT_TIMEOUT (seconds) is now LCD_BACKLIGHT_TIMEOUT_MINS (minutes)."
649
+#elif defined(LCD_SET_PROGRESS_MANUALLY)
650
+  #error "LCD_SET_PROGRESS_MANUALLY is now SET_PROGRESS_MANUALLY."
651
+#elif defined(USE_M73_REMAINING_TIME)
652
+  #error "USE_M73_REMAINING_TIME is now SET_REMAINING_TIME."
653
+#elif defined(SHOW_SD_PERCENT)
654
+  #error "SHOW_SD_PERCENT is now SHOW_PROGRESS_PERCENT."
649 655
 #endif
650 656
 
651 657
 // L64xx stepper drivers have been removed
@@ -894,8 +900,8 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
894 900
  * Progress Bar
895 901
  */
896 902
 #if ENABLED(LCD_PROGRESS_BAR)
897
-  #if NONE(SDSUPPORT, LCD_SET_PROGRESS_MANUALLY)
898
-    #error "LCD_PROGRESS_BAR requires SDSUPPORT or LCD_SET_PROGRESS_MANUALLY."
903
+  #if NONE(SDSUPPORT, SET_PROGRESS_MANUALLY)
904
+    #error "LCD_PROGRESS_BAR requires SDSUPPORT or SET_PROGRESS_MANUALLY."
899 905
   #elif NONE(HAS_MARLINUI_HD44780, IS_TFTGLCD_PANEL)
900 906
     #error "LCD_PROGRESS_BAR only applies to HD44780 character LCD and TFTGLCD_PANEL_(SPI|I2C)."
901 907
   #elif HAS_MARLINUI_U8GLIB || IS_DWIN_MARLINUI
@@ -905,12 +911,14 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
905 911
   #elif PROGRESS_MSG_EXPIRE < 0
906 912
     #error "PROGRESS_MSG_EXPIRE must be greater than or equal to 0."
907 913
   #endif
908
-#elif ENABLED(LCD_SET_PROGRESS_MANUALLY) && NONE(HAS_MARLINUI_U8GLIB, HAS_GRAPHICAL_TFT, HAS_MARLINUI_HD44780, EXTENSIBLE_UI, HAS_DWIN_E3V2, IS_DWIN_MARLINUI)
909
-  #error "LCD_SET_PROGRESS_MANUALLY requires LCD_PROGRESS_BAR, Character LCD, Graphical LCD, TFT, DWIN_CREALITY_LCD, DWIN_LCD_PROUI, DWIN_CREALITY_LCD_JYERSUI, DWIN_MARLINUI_*, OR EXTENSIBLE_UI."
910 914
 #endif
911 915
 
912
-#if ENABLED(USE_M73_REMAINING_TIME) && DISABLED(LCD_SET_PROGRESS_MANUALLY)
913
-  #error "USE_M73_REMAINING_TIME requires LCD_SET_PROGRESS_MANUALLY"
916
+#if ENABLED(SET_PROGRESS_MANUALLY) && NONE(SET_PROGRESS_PERCENT, SET_REMAINING_TIME, SET_INTERACTION_TIME)
917
+  #error "SET_PROGRESS_MANUALLY requires at least one of SET_PROGRESS_PERCENT, SET_REMAINING_TIME, SET_INTERACTION_TIME to be enabled."
918
+#endif
919
+
920
+#if HAS_LCDPRINT && LCD_HEIGHT < 4 && ANY(SHOW_PROGRESS_PERCENT, SHOW_ELAPSED_TIME, SHOW_REMAINING_TIME, SHOW_INTERACTION_TIME)
921
+  #error "Displays with fewer than 4 rows of text can't show progress values."
914 922
 #endif
915 923
 
916 924
 #if !HAS_MARLINUI_MENU && ENABLED(SD_REPRINT_LAST_SELECTED_FILE)
@@ -4038,10 +4046,6 @@ static_assert(_PLUS_TEST(4), "HOMING_FEEDRATE_MM_M values must be positive.");
4038 4046
   #error "COOLANT_FLOOD requires COOLANT_FLOOD_PIN to be defined."
4039 4047
 #endif
4040 4048
 
4041
-#if NONE(HAS_MARLINUI_U8GLIB, EXTENSIBLE_UI, IS_DWIN_MARLINUI) && ENABLED(PRINT_PROGRESS_SHOW_DECIMALS)
4042
-  #error "PRINT_PROGRESS_SHOW_DECIMALS currently requires a Graphical LCD."
4043
-#endif
4044
-
4045 4049
 #if HAS_ADC_BUTTONS && defined(ADC_BUTTON_DEBOUNCE_DELAY) && ADC_BUTTON_DEBOUNCE_DELAY < 16
4046 4050
   #error "ADC_BUTTON_DEBOUNCE_DELAY must be greater than 16."
4047 4051
 #endif

+ 61
- 62
Marlin/src/lcd/HD44780/marlinui_HD44780.cpp 查看文件

@@ -612,20 +612,6 @@ FORCE_INLINE void _draw_bed_status(const bool blink) {
612 612
   _draw_heater_status(H_BED, TERN0(HAS_LEVELING, blink && planner.leveling_active) ? '_' : LCD_STR_BEDTEMP[0], blink);
613 613
 }
614 614
 
615
-#if HAS_PRINT_PROGRESS
616
-
617
-  FORCE_INLINE void _draw_print_progress() {
618
-    const uint8_t progress = ui.get_progress_percent();
619
-    lcd_put_u8str(F(TERN(SDSUPPORT, "SD", "P:")));
620
-    if (progress)
621
-      lcd_put_u8str(ui8tostr3rj(progress));
622
-    else
623
-      lcd_put_u8str(F("---"));
624
-    lcd_put_lchar('%');
625
-  }
626
-
627
-#endif
628
-
629 615
 #if ENABLED(LCD_PROGRESS_BAR)
630 616
 
631 617
   void MarlinUI::draw_progress_bar(const uint8_t percent) {
@@ -733,6 +719,56 @@ void MarlinUI::draw_status_message(const bool blink) {
733 719
   #endif
734 720
 }
735 721
 
722
+#if HAS_PRINT_PROGRESS
723
+  #define TPOFFSET (LCD_WIDTH - 1)
724
+  static uint8_t timepos = TPOFFSET - 6;
725
+  static char buffer[14];
726
+  static lcd_uint_t pc, pr;
727
+
728
+  #if ENABLED(SHOW_PROGRESS_PERCENT)
729
+    void MarlinUI::drawPercent() {
730
+      const uint8_t progress = ui.get_progress_percent();
731
+      if (progress) {
732
+        lcd_moveto(pc, pr);
733
+        lcd_put_u8str(F(TERN(IS_SD_PRINTING, "SD", "P:")));
734
+        lcd_put_u8str(TERN(PRINT_PROGRESS_SHOW_DECIMALS, permyriadtostr4(ui.get_progress_permyriad()), ui8tostr3rj(progress)));
735
+        lcd_put_lchar('%');
736
+      }
737
+    }
738
+  #endif
739
+  #if ENABLED(SHOW_REMAINING_TIME)
740
+    void MarlinUI::drawRemain() {
741
+      const duration_t remaint = ui.get_remaining_time();
742
+      if (printJobOngoing()) {
743
+        timepos = TPOFFSET - remaint.toDigital(buffer);
744
+        lcd_put_lchar(TERN(LCD_INFO_SCREEN_STYLE, 11, timepos), 2, 'R');
745
+        lcd_put_u8str(buffer);
746
+      }
747
+    }
748
+  #endif
749
+  #if ENABLED(SHOW_INTERACTION_TIME)
750
+    void MarlinUI::drawInter() {
751
+      const duration_t interactt = ui.interaction_time;
752
+      if (printingIsActive() && interactt.value) {
753
+        timepos = TPOFFSET - interactt.toDigital(buffer);
754
+        lcd_put_lchar(TERN(LCD_INFO_SCREEN_STYLE, 11, timepos), 2, 'C');
755
+        lcd_put_u8str(buffer);
756
+      }
757
+    }
758
+  #endif
759
+  #if ENABLED(SHOW_ELAPSED_TIME)
760
+    void MarlinUI::drawElapsed() {
761
+      const duration_t elapsedt = print_job_timer.duration();
762
+      if (printJobOngoing()) {
763
+        timepos = TPOFFSET - elapsedt.toDigital(buffer);
764
+        lcd_put_lchar(TERN(LCD_INFO_SCREEN_STYLE, 11, timepos), 2, 'E');
765
+        //lcd_put_lchar(timepos, 2, LCD_STR_CLOCK[0]);
766
+        lcd_put_u8str(buffer);
767
+      }
768
+    }
769
+  #endif
770
+#endif // HAS_PRINT_PROGRESS
771
+
736 772
 /**
737 773
  *  LCD_INFO_SCREEN_STYLE 0 : Classic Status Screen
738 774
  *
@@ -765,35 +801,6 @@ void MarlinUI::draw_status_message(const bool blink) {
765 801
  *  |01234567890123456789|
766 802
  */
767 803
 
768
-inline uint8_t draw_elapsed_or_remaining_time(uint8_t timepos, const bool blink) {
769
-  char buffer[14];
770
-
771
-  #if ENABLED(SHOW_REMAINING_TIME)
772
-    const bool show_remain = TERN1(ROTATE_PROGRESS_DISPLAY, blink) && printingIsActive();
773
-    if (show_remain) {
774
-      #if ENABLED(USE_M73_REMAINING_TIME)
775
-        duration_t remaining = ui.get_remaining_time();
776
-      #else
777
-        uint8_t progress = ui.get_progress_percent();
778
-        uint32_t elapsed = print_job_timer.duration();
779
-        duration_t remaining = (progress > 0) ? ((elapsed * 25600 / progress) >> 8) - elapsed : 0;
780
-      #endif
781
-      timepos -= remaining.toDigital(buffer);
782
-      lcd_put_lchar(timepos, 2, 'R');
783
-    }
784
-  #else
785
-    constexpr bool show_remain = false;
786
-  #endif
787
-
788
-  if (!show_remain) {
789
-    duration_t elapsed = print_job_timer.duration();
790
-    timepos -= elapsed.toDigital(buffer);
791
-    lcd_put_lchar(timepos, 2, LCD_STR_CLOCK[0]);
792
-  }
793
-  lcd_put_u8str(buffer);
794
-  return timepos;
795
-}
796
-
797 804
 void MarlinUI::draw_status_screen() {
798 805
 
799 806
   const bool blink = get_blink();
@@ -856,8 +863,8 @@ void MarlinUI::draw_status_screen() {
856 863
       #if LCD_WIDTH < 20
857 864
 
858 865
         #if HAS_PRINT_PROGRESS
859
-          lcd_moveto(0, 2);
860
-          _draw_print_progress();
866
+          pc = 0, pr = 2;
867
+          rotate_progress();
861 868
         #endif
862 869
 
863 870
       #else // LCD_WIDTH >= 20
@@ -940,12 +947,11 @@ void MarlinUI::draw_status_screen() {
940 947
       lcd_put_u8str(i16tostr3rj(feedrate_percentage));
941 948
       lcd_put_lchar('%');
942 949
 
943
-      const uint8_t timepos = draw_elapsed_or_remaining_time(LCD_WIDTH - 1, blink);
944
-
945 950
       #if LCD_WIDTH >= 20
946
-        lcd_moveto(timepos - 7, 2);
951
+
947 952
         #if HAS_PRINT_PROGRESS
948
-          _draw_print_progress();
953
+          pc = timepos - 7, pr = 2;
954
+          rotate_progress();
949 955
         #else
950 956
           char c;
951 957
           uint16_t per;
@@ -1016,7 +1022,7 @@ void MarlinUI::draw_status_screen() {
1016 1022
     // ========== Line 3 ==========
1017 1023
 
1018 1024
     //
1019
-    // SD Percent, Hotend 2, or Bed
1025
+    // Progress percent, Hotend 2, or Bed
1020 1026
     //
1021 1027
     lcd_moveto(0, 2);
1022 1028
     #if HOTENDS > 2
@@ -1025,24 +1031,17 @@ void MarlinUI::draw_status_screen() {
1025 1031
       _draw_bed_status(blink);
1026 1032
     #elif HAS_PRINT_PROGRESS
1027 1033
       #define DREW_PRINT_PROGRESS 1
1028
-      _draw_print_progress();
1034
+      pc = 0, pr = 2;
1035
+      rotate_progress();
1029 1036
     #endif
1030 1037
 
1031 1038
     //
1032
-    // Elapsed Time or SD Percent
1039
+    // All progress strings
1033 1040
     //
1034
-    lcd_moveto(LCD_WIDTH - 9, 2);
1035
-
1036 1041
     #if HAS_PRINT_PROGRESS && !DREW_PRINT_PROGRESS
1037
-
1038
-      _draw_print_progress();
1039
-
1040
-    #else
1041
-
1042
-      (void)draw_elapsed_or_remaining_time(LCD_WIDTH - 4, blink);
1043
-
1042
+      pc = LCD_WIDTH - 9, pr = 2;
1043
+      rotate_progress();
1044 1044
     #endif
1045
-
1046 1045
   #endif // LCD_INFO_SCREEN_STYLE 1
1047 1046
 
1048 1047
   // ========= Last Line ========

+ 1
- 1
Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp 查看文件

@@ -606,7 +606,7 @@ FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const
606 606
     const uint8_t progress = ui._get_progress();
607 607
     #if ENABLED(SDSUPPORT)
608 608
       lcd_put_u8str(F("SD"));
609
-    #elif ENABLED(LCD_SET_PROGRESS_MANUALLY)
609
+    #elif ENABLED(SET_PROGRESS_PERCENT)
610 610
       lcd_put_u8str(F("P:"));
611 611
     #endif
612 612
     if (progress)

+ 95
- 129
Marlin/src/lcd/dogm/status_screen_DOGM.cpp 查看文件

@@ -40,9 +40,7 @@
40 40
 
41 41
 #include "../../gcode/parser.h" // for units (and volumetric)
42 42
 
43
-#if ENABLED(LCD_SHOW_E_TOTAL)
44
-  #include "../../MarlinCore.h" // for printingIsActive()
45
-#endif
43
+#include "../../MarlinCore.h" // for printingIsActive()
46 44
 
47 45
 #if ENABLED(FILAMENT_LCD_DISPLAY)
48 46
   #include "../../feature/filwidth.h"
@@ -445,6 +443,55 @@ FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const
445 443
     lcd_put_u8str(value);
446 444
 }
447 445
 
446
+// Prepare strings for progress display
447
+#if HAS_PRINT_PROGRESS
448
+  #define _PRGR_INFO_X(len) (LCD_PIXEL_WIDTH - (len) * (MENU_FONT_WIDTH))
449
+  #define PCENTERED 1  // center percent value over progress bar, else align to the right
450
+  static uint8_t lastProgress = 0xFF;
451
+  static u8g_uint_t progress_bar_solid_width = 0;
452
+  #if ENABLED(SHOW_PROGRESS_PERCENT)
453
+    static char progress_string[5];
454
+    static u8g_uint_t progress_x_pos;
455
+    void MarlinUI::drawPercent() {
456
+      if (progress_string[0]) {
457
+        lcd_put_u8str(progress_x_pos, EXTRAS_BASELINE, progress_string);
458
+        lcd_put_lchar('%');
459
+      }
460
+    }
461
+  #endif
462
+  #if ENABLED(SHOW_REMAINING_TIME)
463
+    static char remaining_string[10];
464
+    static u8g_uint_t remaining_x_pos = 0;
465
+    void MarlinUI::drawRemain() {
466
+      if (printJobOngoing()){
467
+        lcd_put_u8str(PROGRESS_BAR_X, EXTRAS_BASELINE, F("R:"));
468
+        lcd_put_u8str(remaining_x_pos, EXTRAS_BASELINE, remaining_string);
469
+      }
470
+    }
471
+  #endif
472
+  #if ENABLED(SHOW_INTERACTION_TIME)
473
+    static char interaction_string[10];
474
+    static u8g_uint_t interaction_x_pos = 0;
475
+    void MarlinUI::drawInter() {
476
+      if (printingIsActive() && interaction_string[0]) {
477
+        lcd_put_u8str(PROGRESS_BAR_X, EXTRAS_BASELINE, F("C:"));
478
+        lcd_put_u8str(interaction_x_pos, EXTRAS_BASELINE, interaction_string);
479
+      }
480
+    }
481
+  #endif
482
+  #if ENABLED(SHOW_ELAPSED_TIME)
483
+    static char elapsed_string[10];
484
+    static u8g_uint_t elapsed_x_pos = 0;
485
+    static uint8_t lastElapsed;
486
+    void MarlinUI::drawElapsed() {
487
+      if (printJobOngoing()) {
488
+        lcd_put_u8str(PROGRESS_BAR_X, EXTRAS_BASELINE, F("E:"));
489
+        lcd_put_u8str(elapsed_x_pos, EXTRAS_BASELINE, elapsed_string);
490
+      }
491
+    }
492
+  #endif
493
+#endif // HAS_PRINT_PROGRESS
494
+
448 495
 /**
449 496
  * Draw the Status Screen for a 128x64 DOGM (U8glib) display.
450 497
  *
@@ -459,30 +506,6 @@ void MarlinUI::draw_status_screen() {
459 506
     static char wstring[5], mstring[4];
460 507
   #endif
461 508
 
462
-  #if HAS_PRINT_PROGRESS
463
-    #if DISABLED(SHOW_SD_PERCENT)
464
-      #define _SD_INFO_X(len) (PROGRESS_BAR_X + (PROGRESS_BAR_WIDTH) / 2 - (len) * (MENU_FONT_WIDTH) / 2)
465
-    #else
466
-      #define _SD_INFO_X(len) (LCD_PIXEL_WIDTH - (len) * (MENU_FONT_WIDTH))
467
-    #endif
468
-
469
-    #if ENABLED(SHOW_SD_PERCENT)
470
-      static char progress_string[5];
471
-    #endif
472
-    static uint8_t lastElapsed = 0xFF, lastProgress = 0xFF;
473
-    static u8g_uint_t elapsed_x_pos = 0, progress_bar_solid_width = 0;
474
-    static char elapsed_string[16];
475
-    #if ENABLED(SHOW_REMAINING_TIME)
476
-      static u8g_uint_t estimation_x_pos = 0;
477
-      static char estimation_string[10];
478
-      #if BOTH(SHOW_SD_PERCENT, ROTATE_PROGRESS_DISPLAY)
479
-        static u8g_uint_t progress_x_pos = 0;
480
-        static uint8_t progress_state = 0;
481
-        static bool prev_blink = 0;
482
-      #endif
483
-    #endif
484
-  #endif
485
-
486 509
   const bool show_e_total = TERN0(LCD_SHOW_E_TOTAL, printingIsActive());
487 510
 
488 511
   // At the first page, generate new display values
@@ -523,61 +546,59 @@ void MarlinUI::draw_status_screen() {
523 546
     // Progress / elapsed / estimation updates and string formatting to avoid float math on each LCD draw
524 547
     #if HAS_PRINT_PROGRESS
525 548
       const progress_t progress = TERN(HAS_PRINT_PROGRESS_PERMYRIAD, get_progress_permyriad, get_progress_percent)();
526
-      duration_t elapsed = print_job_timer.duration();
527
-      const uint8_t p = progress & 0xFF, ev = elapsed.value & 0xFF;
549
+      duration_t elapsedt = print_job_timer.duration();
550
+      const uint8_t p = progress & 0xFF, ev = elapsedt.value & 0xFF;
528 551
       if (p != lastProgress) {
529 552
         lastProgress = p;
530 553
 
531 554
         progress_bar_solid_width = u8g_uint_t((PROGRESS_BAR_WIDTH - 2) * (progress / (PROGRESS_SCALE)) * 0.01f);
532 555
 
533
-        #if ENABLED(SHOW_SD_PERCENT)
534
-          if (progress == 0) {
556
+        #if ENABLED(SHOW_PROGRESS_PERCENT)
557
+          if (progress == 0)
535 558
             progress_string[0] = '\0';
536
-            #if ENABLED(SHOW_REMAINING_TIME)
537
-              estimation_string[0] = '\0';
538
-              estimation_x_pos = _SD_INFO_X(0);
539
-            #endif
540
-          }
541 559
           else
542 560
             strcpy(progress_string, TERN(PRINT_PROGRESS_SHOW_DECIMALS, permyriadtostr4(progress), ui8tostr3rj(progress / (PROGRESS_SCALE))));
543
-
544
-          #if BOTH(SHOW_REMAINING_TIME, ROTATE_PROGRESS_DISPLAY) // Tri-state progress display mode
545
-            progress_x_pos = _SD_INFO_X(strlen(progress_string) + 1);
546
-          #endif
561
+          progress_x_pos = TERN(PCENTERED, 77, _PRGR_INFO_X(strlen(progress_string) + 1));
547 562
         #endif
548 563
       }
549 564
 
550
-      constexpr bool can_show_days = DISABLED(SHOW_SD_PERCENT) || ENABLED(ROTATE_PROGRESS_DISPLAY);
551
-      if (ev != lastElapsed) {
552
-        lastElapsed = ev;
553
-        const uint8_t len = elapsed.toDigital(elapsed_string, can_show_days && elapsed.value >= 60*60*24L);
554
-        elapsed_x_pos = _SD_INFO_X(len);
555
-
556
-        #if ENABLED(SHOW_REMAINING_TIME)
557
-          if (!(ev & 0x3)) {
558
-            uint32_t timeval = (0
559
-              #if BOTH(LCD_SET_PROGRESS_MANUALLY, USE_M73_REMAINING_TIME)
560
-                + get_remaining_time()
561
-              #endif
562
-            );
563
-            if (!timeval && progress > 0) timeval = elapsed.value * (100 * (PROGRESS_SCALE) - progress) / progress;
564
-            if (!timeval) {
565
-              estimation_string[0] = '\0';
566
-              estimation_x_pos = _SD_INFO_X(0);
567
-            }
568
-            else {
569
-              duration_t estimation = timeval;
570
-              const uint8_t len = estimation.toDigital(estimation_string, can_show_days && estimation.value >= 60*60*24L);
571
-              estimation_x_pos = _SD_INFO_X(len + !BOTH(SHOW_SD_PERCENT, ROTATE_PROGRESS_DISPLAY));
572
-            }
565
+      #if ENABLED(SHOW_INTERACTION_TIME)
566
+        if (!(interaction_time)) {
567
+          interaction_string[0] = '\0';
568
+          interaction_x_pos = _PRGR_INFO_X(0);
569
+        }
570
+        else {
571
+          const duration_t interactt = ui.interaction_time;
572
+          interactt.toDigital(interaction_string, interactt.value >= 60*60*24L);
573
+          interaction_x_pos = _PRGR_INFO_X(strlen(interaction_string));
574
+        }
575
+      #endif
576
+
577
+      #if ENABLED(SHOW_ELAPSED_TIME)
578
+        if (ev != lastElapsed) {
579
+          lastElapsed = ev;
580
+          const uint8_t len = elapsedt.toDigital(elapsed_string, elapsedt.value >= 60*60*24L);
581
+          elapsed_x_pos = _PRGR_INFO_X(len);
582
+        }
583
+      #endif
584
+
585
+      #if ENABLED(SHOW_REMAINING_TIME)
586
+        if (!(ev & 0x3)) {
587
+          uint32_t timeval = get_remaining_time();
588
+          if (!timeval) {
589
+            remaining_string[0] = '\0';
590
+            remaining_x_pos = _PRGR_INFO_X(0);
573 591
           }
574
-        #endif
575
-      }
592
+          else {
593
+            const duration_t remaint = timeval;
594
+            const uint8_t len = remaint.toDigital(remaining_string, remaint.value >= 60*60*24L);
595
+            remaining_x_pos = _PRGR_INFO_X(len);
596
+          }
597
+        }
598
+      #endif
576 599
     #endif
577 600
   }
578 601
 
579
-  const bool blink = get_blink();
580
-
581 602
   // Status Menu Font
582 603
   set_font(FONT_STATUSMENU);
583 604
 
@@ -634,6 +655,8 @@ void MarlinUI::draw_status_screen() {
634 655
       u8g.drawBitmapP(STATUS_CHAMBER_X, chambery, STATUS_CHAMBER_BYTEWIDTH, chamberh, CHAMBER_BITMAP(CHAMBER_ALT()));
635 656
   #endif
636 657
 
658
+  const bool blink = ui.get_blink();
659
+
637 660
   #if DO_DRAW_FAN
638 661
     #if STATUS_FAN_FRAMES > 2
639 662
       static bool old_blink;
@@ -664,8 +687,7 @@ void MarlinUI::draw_status_screen() {
664 687
   if (PAGE_UNDER(6 + 1 + 12 + 1 + 6 + 1)) {
665 688
     // Extruders
666 689
     #if DO_DRAW_HOTENDS
667
-      LOOP_L_N(e, MAX_HOTEND_DRAW)
668
-        _draw_hotend_status((heater_id_t)e, blink);
690
+      LOOP_L_N(e, MAX_HOTEND_DRAW) _draw_hotend_status((heater_id_t)e, blink);
669 691
     #endif
670 692
 
671 693
     // Laser / Spindle
@@ -757,74 +779,18 @@ void MarlinUI::draw_status_screen() {
757 779
   #endif // SDSUPPORT
758 780
 
759 781
   #if HAS_PRINT_PROGRESS
760
-    //
761 782
     // Progress bar frame
762
-    //
763
-
764 783
     if (PAGE_CONTAINS(PROGRESS_BAR_Y, PROGRESS_BAR_Y + 3))
765 784
       u8g.drawFrame(PROGRESS_BAR_X, PROGRESS_BAR_Y, PROGRESS_BAR_WIDTH, 4);
766 785
 
767
-    //
768 786
     // Progress bar solid part
769
-    //
770
-
771 787
     if (PAGE_CONTAINS(PROGRESS_BAR_Y + 1, PROGRESS_BAR_Y + 2))
772 788
       u8g.drawBox(PROGRESS_BAR_X + 1, PROGRESS_BAR_Y + 1, progress_bar_solid_width, 2);
773 789
 
774
-    if (PAGE_CONTAINS(EXTRAS_BASELINE - INFO_FONT_ASCENT, EXTRAS_BASELINE - 1)) {
775
-
776
-      #if ALL(SHOW_SD_PERCENT, SHOW_REMAINING_TIME, ROTATE_PROGRESS_DISPLAY)
777
-
778
-        if (prev_blink != blink) {
779
-          prev_blink = blink;
780
-          if (++progress_state >= 3) progress_state = 0;
781
-        }
782
-
783
-        if (progress_state == 0) {
784
-          if (progress_string[0]) {
785
-            lcd_put_u8str(progress_x_pos, EXTRAS_BASELINE, progress_string);
786
-            lcd_put_lchar('%');
787
-          }
788
-        }
789
-        else if (progress_state == 2 && estimation_string[0]) {
790
-          lcd_put_u8str(PROGRESS_BAR_X, EXTRAS_BASELINE, F("R:"));
791
-          lcd_put_u8str(estimation_x_pos, EXTRAS_BASELINE, estimation_string);
792
-        }
793
-        else if (elapsed_string[0]) {
794
-          lcd_put_u8str(PROGRESS_BAR_X, EXTRAS_BASELINE, F("E:"));
795
-          lcd_put_u8str(elapsed_x_pos, EXTRAS_BASELINE, elapsed_string);
796
-        }
797
-
798
-      #else // !SHOW_SD_PERCENT || !SHOW_REMAINING_TIME || !ROTATE_PROGRESS_DISPLAY
799
-
800
-        //
801
-        // SD Percent Complete
802
-        //
803
-
804
-        #if ENABLED(SHOW_SD_PERCENT)
805
-          if (progress_string[0]) {
806
-            lcd_put_u8str(55, EXTRAS_BASELINE, progress_string); // Percent complete
807
-            lcd_put_lchar('%');
808
-          }
809
-        #endif
810
-
811
-        //
812
-        // Elapsed Time
813
-        //
814
-
815
-        #if ENABLED(SHOW_REMAINING_TIME)
816
-          if (blink && estimation_string[0]) {
817
-            lcd_put_lchar(estimation_x_pos, EXTRAS_BASELINE, 'R');
818
-            lcd_put_u8str(estimation_string);
819
-          }
820
-          else
821
-        #endif
822
-            lcd_put_u8str(elapsed_x_pos, EXTRAS_BASELINE, elapsed_string);
823
-
824
-      #endif // !SHOW_SD_PERCENT || !SHOW_REMAINING_TIME || !ROTATE_PROGRESS_DISPLAY
825
-    }
826
-
827
-  #endif // HAS_PRINT_PROGRESS
790
+    // Progress strings
791
+    if (PAGE_CONTAINS(EXTRAS_BASELINE - INFO_FONT_ASCENT, EXTRAS_BASELINE - 1))
792
+      ui.rotate_progress();
793
+  #endif
828 794
 
829 795
   //
830 796
   // XYZ Coordinates

+ 194
- 133
Marlin/src/lcd/dogm/status_screen_lite_ST7920.cpp 查看文件

@@ -40,12 +40,38 @@
40 40
 // Lightweight Status Screen for Graphical Display
41 41
 //
42 42
 
43
+/** One hotend layout
44
+ *  ------------------
45
+ *  |⟱ xxx➜xxx° ✱xxx%
46
+ *  |_ xxx➜xxx° Fxxx%
47
+ *  ||||||||||R•xxx:xx
48
+ *  |  status string
49
+ *  ------------------
50
+ *
51
+ *  hotend temp | fan speed
52
+ *  bed temp    | feedrate
53
+ *  progress bar| progress time
54
+ *       status string
55
+ *
56
+ * ****************************
57
+ *  Two hotends layout
58
+ *  ------------------
59
+ *  |⟱ xxx➜xxx° ✱xxx%
60
+ *  |⟱ xxx➜xxx°|||||||
61
+ *  |_ xxx➜xxx°Rxxx:xx
62
+ *  |  status string
63
+ *  ------------------
64
+ *
65
+ *  hotend temp | fan speed
66
+ *  hotend temp | progress bar
67
+ *  bed temp    | progress time
68
+ *       status string
69
+ */
70
+
43 71
 #include "../../inc/MarlinConfigPre.h"
44 72
 
45 73
 #if ENABLED(LIGHTWEIGHT_UI)
46 74
 
47
-#include "status_screen_lite_ST7920.h"
48
-
49 75
 #include "../marlinui.h"
50 76
 #include "../fontutils.h"
51 77
 #include "../lcdprint.h"
@@ -53,12 +79,13 @@
53 79
 #include "../../module/motion.h"
54 80
 #include "../../module/printcounter.h"
55 81
 #include "../../module/temperature.h"
82
+#include "../../libs/numtostr.h"
56 83
 
57 84
 #if ENABLED(SDSUPPORT)
58 85
   #include "../../sd/cardreader.h"
59 86
 #endif
60 87
 
61
-#if ENABLED(LCD_SHOW_E_TOTAL)
88
+#if ENABLED(LCD_SHOW_E_TOTAL) || HAS_PRINT_PROGRESS
62 89
   #include "../../MarlinCore.h" // for printingIsActive
63 90
 #endif
64 91
 
@@ -72,6 +99,9 @@
72 99
 #define DDRAM_LINE_3   0x08
73 100
 #define DDRAM_LINE_4   0x18
74 101
 
102
+#include "status_screen_lite_ST7920.h"
103
+extern ST7920_Lite_Status_Screen lightUI;
104
+
75 105
 ST7920_Lite_Status_Screen::st7920_state_t ST7920_Lite_Status_Screen::current_bits;
76 106
 
77 107
 void ST7920_Lite_Status_Screen::cmd(const uint8_t cmd) {
@@ -442,72 +472,6 @@ void ST7920_Lite_Status_Screen::draw_static_elements() {
442 472
   draw_fan_icon(false);
443 473
 }
444 474
 
445
-/**
446
- * Although this is undocumented, the ST7920 allows the character
447
- * data buffer (DDRAM) to be used in conjunction with the graphics
448
- * bitmap buffer (CGRAM). The contents of the graphics buffer is
449
- * XORed with the data from the character generator. This allows
450
- * us to make the progress bar out of graphical data (the bar) and
451
- * text data (the percentage).
452
- */
453
-void ST7920_Lite_Status_Screen::draw_progress_bar(const uint8_t value) {
454
-  #if HOTENDS == 1
455
-    // If we have only one extruder, draw a long progress bar on the third line
456
-    constexpr uint8_t top     = 1,         // Top in pixels
457
-                      bottom  = 13,        // Bottom in pixels
458
-                      left    = 12,        // Left edge, in 16-bit words
459
-                      width   = 4;         // Width of progress bar, in 16-bit words
460
-  #else
461
-    constexpr uint8_t top     = 16 + 1,
462
-                      bottom  = 16 + 13,
463
-                      left    = 5,
464
-                      width   = 3;
465
-  #endif
466
-  const uint8_t char_pcnt  = 100 / width; // How many percent does each 16-bit word represent?
467
-
468
-  // Draw the progress bar as a bitmap in CGRAM
469
-  LOOP_S_LE_N(y, top, bottom) {
470
-    set_gdram_address(left, y);
471
-    begin_data();
472
-    LOOP_L_N(x, width) {
473
-      uint16_t gfx_word = 0x0000;
474
-      if ((x + 1) * char_pcnt <= value)
475
-        gfx_word = 0xFFFF;                                              // Draw completely filled bytes
476
-      else if ((x * char_pcnt) < value)
477
-        gfx_word = int(0x8000) >> (value % char_pcnt) * 16 / char_pcnt; // Draw partially filled bytes
478
-
479
-      // Draw the frame around the progress bar
480
-      if (y == top || y == bottom)
481
-        gfx_word = 0xFFFF;        // Draw top/bottom border
482
-      else if (x == width - 1)
483
-        gfx_word |= 0x0001;       // Draw right border
484
-      else if (x == 0)
485
-        gfx_word |= 0x8000;       // Draw left border
486
-      write_word(gfx_word);
487
-    }
488
-  }
489
-
490
-  // Draw the percentage as text in DDRAM
491
-  #if HOTENDS == 1
492
-    set_ddram_address(DDRAM_LINE_3 + 4);
493
-    begin_data();
494
-    write_byte(' ');
495
-  #else
496
-    set_ddram_address(DDRAM_LINE_2 + left);
497
-    begin_data();
498
-  #endif
499
-
500
-  // Draw centered
501
-  if (value > 9) {
502
-    write_number(value, 4);
503
-    write_str(F("% "));
504
-  }
505
-  else {
506
-    write_number(value, 3);
507
-    write_str(F("%  "));
508
-  }
509
-}
510
-
511 475
 void ST7920_Lite_Status_Screen::draw_fan_icon(const bool whichIcon) {
512 476
   set_ddram_address(DDRAM_LINE_1 + 5);
513 477
   begin_data();
@@ -592,22 +556,8 @@ void ST7920_Lite_Status_Screen::draw_fan_speed(const uint8_t value) {
592 556
   write_byte('%');
593 557
 }
594 558
 
595
-void ST7920_Lite_Status_Screen::draw_print_time(const duration_t &elapsed, char suffix) {
596
-  #if HOTENDS == 1
597
-    set_ddram_address(DDRAM_LINE_3);
598
-  #else
599
-    set_ddram_address(DDRAM_LINE_3 + 5);
600
-  #endif
601
-  char str[7];
602
-  int str_length = elapsed.toDigital(str);
603
-  str[str_length++] = suffix;
604
-  begin_data();
605
-  write_str(str, str_length);
606
-}
607
-
608 559
 void ST7920_Lite_Status_Screen::draw_feedrate_percentage(const uint16_t percentage) {
609
-  // We only have enough room for the feedrate when
610
-  // we have one extruder
560
+  // We only have enough room for the feedrate when we have one extruder
611 561
   #if HOTENDS == 1
612 562
     set_ddram_address(DDRAM_LINE_2 + 6);
613 563
     begin_data();
@@ -631,11 +581,9 @@ void ST7920_Lite_Status_Screen::draw_status_message() {
631 581
       write_str(str);
632 582
       while (slen < TEXT_MODE_LCD_WIDTH) { write_byte(' '); ++slen; }
633 583
     }
634
-    else {
635
-      // String is larger than the available space in screen.
584
+    else {  // String is larger than the available space in ST7920_Lite_Status_Screen::
636 585
 
637
-      // Get a pointer to the next valid UTF8 character
638
-      // and the string remaining length
586
+      // Get a pointer to the next valid UTF8 character and the string remaining length
639 587
       uint8_t rlen;
640 588
       const char *stat = ui.status_and_len(rlen);
641 589
       write_str(stat, TEXT_MODE_LCD_WIDTH);
@@ -643,12 +591,12 @@ void ST7920_Lite_Status_Screen::draw_status_message() {
643 591
       // If the remaining string doesn't completely fill the screen
644 592
       if (rlen < TEXT_MODE_LCD_WIDTH) {
645 593
         uint8_t chars = TEXT_MODE_LCD_WIDTH - rlen; // Amount of space left in characters
646
-        write_byte(' ');                        // Always at 1+ spaces left, draw a space
647
-        if (--chars) {                          // Draw a second space if there's room
594
+        write_byte(' ');                            // Always at 1+ spaces left, draw a space
595
+        if (--chars) {                              // Draw a second space if there's room
648 596
           write_byte(' ');
649
-          if (--chars) {                        // Draw a third space if there's room
597
+          if (--chars) {                            // Draw a third space if there's room
650 598
             write_byte(' ');
651
-            if (--chars) write_str(str, chars); // Print a second copy of the message
599
+            if (--chars) write_str(str, chars);     // Print a second copy of the message
652 600
           }
653 601
         }
654 602
       }
@@ -715,11 +663,155 @@ bool ST7920_Lite_Status_Screen::indicators_changed() {
715 663
   return true;
716 664
 }
717 665
 
666
+// Process progress strings
667
+#if HAS_PRINT_PROGRESS
668
+  static char screenstr[8];
669
+
670
+  char * ST7920_Lite_Status_Screen::prepare_time_string(const duration_t &time, char prefix) {
671
+    static char str[6];
672
+    memset(&screenstr, 0x20, 8); // fill with spaces to avoid artifacts, not doing right-justification to save cycles
673
+    screenstr[0] = prefix;
674
+    TERN_(HOTENDS == 1, screenstr[1] = 0x07;)  // add bullet • separator when there is space
675
+    int str_length = time.toDigital(str);
676
+    memcpy(&screenstr[TERN(HOTENDS == 1, 2, 1)], str, str_length); //memcpy because we can't have terminator
677
+    return screenstr;
678
+  }
679
+
680
+  void ST7920_Lite_Status_Screen::draw_progress_string(uint8_t addr, const char *str) {
681
+    set_ddram_address(addr);
682
+    begin_data();
683
+    write_str(str, TERN(HOTENDS == 1, 8, 6));
684
+  }
685
+
686
+  #define PPOS (DDRAM_LINE_3 + TERN(HOTENDS == 1, 4, 5)) // progress string position, in 16-bit words
687
+
688
+  #if ENABLED(SHOW_PROGRESS_PERCENT)
689
+    void MarlinUI::drawPercent() { lightUI.drawPercent(); }
690
+    void ST7920_Lite_Status_Screen::drawPercent() {
691
+      #define LSHIFT TERN(HOTENDS == 1, 0, 1)
692
+      const uint8_t progress = ui.get_progress_percent();
693
+      memset(&screenstr, 0x20, 8); // fill with spaces to avoid artifacts
694
+      if (progress){
695
+        memcpy(&screenstr[2 - LSHIFT], \
696
+                  TERN(PRINT_PROGRESS_SHOW_DECIMALS, permyriadtostr4(ui.get_progress_permyriad()), ui8tostr3rj(progress)), \
697
+                  TERN(PRINT_PROGRESS_SHOW_DECIMALS, 4, 3));
698
+        screenstr[(TERN(PRINT_PROGRESS_SHOW_DECIMALS, 6, 5) - LSHIFT)] = '%';
699
+        draw_progress_string(PPOS, screenstr);
700
+      }
701
+    }
702
+  #endif
703
+  #if ENABLED(SHOW_REMAINING_TIME)
704
+    void MarlinUI::drawRemain() { lightUI.drawRemain(); }
705
+    void ST7920_Lite_Status_Screen::drawRemain() {
706
+      const duration_t remaint = TERN0(SET_REMAINING_TIME, ui.get_remaining_time());
707
+      if (printJobOngoing() && remaint.value) {
708
+        draw_progress_string( PPOS, prepare_time_string(remaint, 'R'));
709
+      }
710
+    }
711
+  #endif
712
+  #if ENABLED(SHOW_INTERACTION_TIME)
713
+    void MarlinUI::drawInter() { lightUI.drawInter(); }
714
+    void ST7920_Lite_Status_Screen::drawInter() {
715
+      const duration_t interactt = ui.interaction_time;
716
+      if (printingIsActive() && interactt.value) {
717
+        draw_progress_string( PPOS, prepare_time_string(interactt, 'C'));
718
+      }
719
+    }
720
+  #endif
721
+  #if ENABLED(SHOW_ELAPSED_TIME)
722
+    void MarlinUI::drawElapsed() { lightUI.drawElapsed(); }
723
+    void ST7920_Lite_Status_Screen::drawElapsed() {
724
+      if (printJobOngoing()) {
725
+        const duration_t elapsedt = print_job_timer.duration();
726
+        draw_progress_string( PPOS, prepare_time_string(elapsedt, 'E'));
727
+      }
728
+    }
729
+  #endif
730
+
731
+  /**
732
+   * Although this is undocumented, the ST7920 allows the character
733
+   * data buffer (DDRAM) to be used in conjunction with the graphics
734
+   * bitmap buffer (CGRAM). The contents of the graphics buffer is
735
+   * XORed with the data from the character generator. This allows
736
+   * us to make the progress bar out of graphical data (the bar) and
737
+   * text data (the percentage).
738
+   */
739
+  void ST7920_Lite_Status_Screen::draw_progress_bar(const uint8_t value) {
740
+    #if HOTENDS == 1
741
+      // If we have only one extruder, draw a long progress bar on the third line
742
+      constexpr uint8_t top     = 1,         // Top in pixels
743
+                        bottom  = 13,        // Bottom in pixels
744
+                        left    = 8,         // Left edge, in 16-bit words
745
+                        width   = 4;         // Width of progress bar, in 16-bit words
746
+    #else
747
+      constexpr uint8_t top     = 16 + 1,
748
+                        bottom  = 16 + 13,
749
+                        left    = 5,
750
+                        width   = 3;
751
+    #endif
752
+    const uint8_t char_pcnt  = 100 / width; // How many percent does each 16-bit word represent?
753
+
754
+    // Draw the progress bar as a bitmap in CGRAM
755
+    // This drawing is a mess and only produce readable result around 25% steps
756
+    // i.e. 74-76% look fine [||||||||||||||||||||||||        ], but 73% look like this: [||||||||||||||||       |        ]
757
+    // meaning partially filled bytes produce only single vertical line, and i bet they're not supposed to!
758
+    LOOP_S_LE_N(y, top, bottom) {
759
+      set_gdram_address(left, y);
760
+      begin_data();
761
+      LOOP_L_N(x, width) {
762
+        uint16_t gfx_word = 0x0000;
763
+        if ((x + 1) * char_pcnt <= value)
764
+          gfx_word = 0xFFFF;                                              // Draw completely filled bytes
765
+        else if ((x * char_pcnt) < value)
766
+          gfx_word = int16_t(0x8000) >> (value % char_pcnt) * 16 / char_pcnt; // Draw partially filled bytes
767
+
768
+        // Draw the frame around the progress bar
769
+        if (y == top || y == bottom)
770
+          gfx_word = 0xFFFF;        // Draw top/bottom border
771
+        else if (x == width - 1)
772
+          gfx_word |= 0x0001;       // Draw right border
773
+        else if (x == 0)
774
+          gfx_word |= 0x8000;       // Draw left border
775
+        write_word(gfx_word);
776
+      }
777
+    }
778
+
779
+    // // Draw the percentage as text in DDRAM
780
+    // #if HOTENDS == 1
781
+    //   set_ddram_address(DDRAM_LINE_3 + 4);
782
+    //   begin_data();
783
+    //   write_byte(' ');
784
+    // #else
785
+    //   set_ddram_address(DDRAM_LINE_2 + left);
786
+    //   begin_data();
787
+    // #endif
788
+
789
+    // // Draw centered
790
+    // if (value > 9)
791
+    //   write_number(value, 4);
792
+    // else
793
+    //   write_number(value, 3);
794
+    // write_str(F("%  "));
795
+  }
796
+
797
+  void ST7920_Lite_Status_Screen::update_progress(const bool forceUpdate) {
798
+
799
+    // Since the progress bar involves writing
800
+    // quite a few bytes to GDRAM, only do this
801
+    // when an update is actually necessary.
802
+
803
+    const uint8_t progress = ui.get_progress_percent();
804
+    static uint8_t last_progress = 0;
805
+    if (forceUpdate || last_progress != progress/2) {
806
+      last_progress = progress/2;     // Because progress bar turns out only 62||46px wide, we only need to redraw it every 2%
807
+      draw_progress_bar(progress);
808
+    }
809
+  }
810
+#endif // HAS_PRINT_PROGRESS
811
+
718 812
 void ST7920_Lite_Status_Screen::update_indicators(const bool forceUpdate) {
719 813
   if (forceUpdate || indicators_changed()) {
720 814
     const bool       blink              = ui.get_blink();
721
-    const duration_t elapsed            = print_job_timer.duration();
722
-    duration_t       remaining          = TERN0(USE_M73_REMAINING_TIME, ui.get_remaining_time());
723 815
     const uint16_t   feedrate_perc      = feedrate_percentage;
724 816
     const celsius_t  extruder_1_temp    = thermalManager.wholeDegHotend(0),
725 817
                      extruder_1_target  = thermalManager.degTargetHotend(0);
@@ -736,30 +828,20 @@ void ST7920_Lite_Status_Screen::update_indicators(const bool forceUpdate) {
736 828
     TERN_(HAS_MULTI_HOTEND, draw_extruder_2_temp(extruder_2_temp, extruder_2_target, forceUpdate));
737 829
     TERN_(HAS_HEATED_BED, draw_bed_temp(bed_temp, bed_target, forceUpdate));
738 830
 
831
+    // Update the fan and bed animations
739 832
     uint8_t spd = thermalManager.fan_speed[0];
740 833
     #if ENABLED(ADAPTIVE_FAN_SLOWING)
741 834
       if (!blink && thermalManager.fan_speed_scaler[0] < 128)
742 835
         spd = thermalManager.scaledFanSpeed(0, spd);
743 836
     #endif
744 837
     draw_fan_speed(thermalManager.pwmToPercent(spd));
745
-
746
-    // Draw elapsed/remaining time
747
-    const bool show_remaining = ENABLED(SHOW_REMAINING_TIME) && (DISABLED(ROTATE_PROGRESS_DISPLAY) || blink);
748
-    if (show_remaining && !remaining.second()) {
749
-      const auto progress = ui.get_progress_percent();
750
-      if (progress)
751
-        remaining = elapsed.second() * (100 - progress) / progress;
752
-    }
753
-    if (show_remaining && remaining.second())
754
-      draw_print_time(remaining, 'R');
755
-    else
756
-      draw_print_time(elapsed);
838
+    if (spd) draw_fan_icon(blink);
839
+    TERN_(HAS_HEATED_BED, draw_heat_icon(bed_target > 0 && blink, bed_target > 0));
757 840
 
758 841
     draw_feedrate_percentage(feedrate_perc);
759 842
 
760
-    // Update the fan and bed animations
761
-    if (spd) draw_fan_icon(blink);
762
-    TERN_(HAS_HEATED_BED, draw_heat_icon(bed_target > 0 && blink, bed_target > 0));
843
+    // Update and draw progress strings
844
+    TERN_(HAS_PRINT_PROGRESS, ui.rotate_progress());
763 845
   }
764 846
 }
765 847
 
@@ -839,27 +921,6 @@ void ST7920_Lite_Status_Screen::update_status_or_position(bool forceUpdate) {
839 921
   #endif
840 922
 }
841 923
 
842
-void ST7920_Lite_Status_Screen::update_progress(const bool forceUpdate) {
843
-  #if EITHER(LCD_SET_PROGRESS_MANUALLY, SDSUPPORT)
844
-
845
-    // Since the progress bar involves writing
846
-    // quite a few bytes to GDRAM, only do this
847
-    // when an update is actually necessary.
848
-
849
-    static uint8_t last_progress = 0;
850
-    const uint8_t progress = ui.get_progress_percent();
851
-    if (forceUpdate || last_progress != progress) {
852
-      last_progress = progress;
853
-      draw_progress_bar(progress);
854
-    }
855
-
856
-  #else
857
-
858
-    UNUSED(forceUpdate);
859
-
860
-  #endif
861
-}
862
-
863 924
 void ST7920_Lite_Status_Screen::update(const bool forceUpdate) {
864 925
   cs();
865 926
   update_indicators(forceUpdate);
@@ -902,7 +963,7 @@ void ST7920_Lite_Status_Screen::clear_text_buffer() {
902 963
 }
903 964
 
904 965
 void MarlinUI::draw_status_screen() {
905
-  ST7920_Lite_Status_Screen::update(false);
966
+  lightUI.update(false);
906 967
 }
907 968
 
908 969
 // This method is called before each screen update and
@@ -912,9 +973,9 @@ void MarlinUI::lcd_in_status(const bool inStatus) {
912 973
   static bool lastInStatus = false;
913 974
   if (lastInStatus == inStatus) return;
914 975
   if ((lastInStatus = inStatus))
915
-    ST7920_Lite_Status_Screen::on_entry();
976
+    lightUI.on_entry();
916 977
   else
917
-    ST7920_Lite_Status_Screen::on_exit();
978
+    lightUI.on_exit();
918 979
 }
919 980
 
920 981
 #endif // LIGHTWEIGHT_UI

+ 14
- 3
Marlin/src/lcd/dogm/status_screen_lite_ST7920.h 查看文件

@@ -75,7 +75,6 @@ class ST7920_Lite_Status_Screen {
75 75
   protected:
76 76
     static void draw_degree_symbol(uint8_t x, uint8_t y, const bool draw);
77 77
     static void draw_static_elements();
78
-    static void draw_progress_bar(const uint8_t value);
79 78
     static void draw_fan_icon(const bool whichIcon);
80 79
     static void draw_heat_icon(const bool whichIcon, const bool heating);
81 80
     static void draw_temps(uint8_t line, const int16_t temp, const int16_t target, bool showTarget, bool targetStateChange);
@@ -83,7 +82,12 @@ class ST7920_Lite_Status_Screen {
83 82
     static void draw_extruder_2_temp(const int16_t temp, const int16_t target, bool forceUpdate=false);
84 83
     static void draw_bed_temp(const int16_t temp, const int16_t target, bool forceUpdate=false);
85 84
     static void draw_fan_speed(const uint8_t value);
86
-    static void draw_print_time(const duration_t &elapsed, char suffix=' ');
85
+    #if HAS_PRINT_PROGRESS
86
+      static void draw_progress_bar(const uint8_t value);
87
+      static char* prepare_time_string(const duration_t &time, char prefix=' ');
88
+      static void draw_progress_string(uint8_t addr, const char *str);
89
+      static void update_progress(const bool forceUpdate);
90
+    #endif
87 91
     static void draw_feedrate_percentage(const uint16_t percentage);
88 92
     static void draw_status_message();
89 93
     static void draw_position(const xyze_pos_t &pos, bool position_known=true);
@@ -96,11 +100,18 @@ class ST7920_Lite_Status_Screen {
96 100
     static void update_indicators(const bool forceUpdate);
97 101
     static void update_position(const bool forceUpdate, bool resetChecksum);
98 102
     static void update_status_or_position(bool forceUpdate);
99
-    static void update_progress(const bool forceUpdate);
100 103
 
101 104
   public:
102 105
     static void update(const bool forceUpdate);
103 106
     static void on_entry();
104 107
     static void on_exit();
105 108
     static void clear_text_buffer();
109
+    #if HAS_PRINT_PROGRESS
110
+      static void drawPercent();
111
+      static void drawRemain();
112
+      static void drawInter();
113
+      static void drawElapsed();
114
+    #endif
106 115
 };
116
+
117
+extern ST7920_Lite_Status_Screen lightUI;

+ 7
- 7
Marlin/src/lcd/e3v2/jyersui/dwin.cpp 查看文件

@@ -733,7 +733,7 @@ void CrealityDWINClass::Draw_Print_Screen() {
733 733
   Update_Status_Bar(true);
734 734
   Draw_Print_ProgressBar();
735 735
   Draw_Print_ProgressElapsed();
736
-  TERN_(USE_M73_REMAINING_TIME, Draw_Print_ProgressRemain());
736
+  TERN_(SET_REMAINING_TIME, Draw_Print_ProgressRemain());
737 737
   Draw_Print_Filename(true);
738 738
 }
739 739
 
@@ -759,7 +759,7 @@ void CrealityDWINClass::Draw_Print_ProgressBar() {
759 759
   DWIN_Draw_String(false, DWIN_FONT_MENU, GetColor(eeprom_settings.progress_percent, Percent_Color), Color_Bg_Black, 133, 133, F("%"));
760 760
 }
761 761
 
762
-#if ENABLED(USE_M73_REMAINING_TIME)
762
+#if ENABLED(SET_REMAINING_TIME)
763 763
 
764 764
   void CrealityDWINClass::Draw_Print_ProgressRemain() {
765 765
     uint16_t remainingtime = ui.get_remaining_time();
@@ -4565,8 +4565,8 @@ void CrealityDWINClass::Start_Print(bool sd) {
4565 4565
     }
4566 4566
     else
4567 4567
       strcpy_P(filename, PSTR("Host Print"));
4568
-    TERN_(LCD_SET_PROGRESS_MANUALLY, ui.set_progress(0));
4569
-    TERN_(USE_M73_REMAINING_TIME, ui.set_remaining_time(0));
4568
+    TERN_(SET_PROGRESS_PERCENT, ui.set_progress(0));
4569
+    TERN_(SET_REMAINING_TIME, ui.set_remaining_time(0));
4570 4570
     Draw_Print_Screen();
4571 4571
   }
4572 4572
 }
@@ -4575,8 +4575,8 @@ void CrealityDWINClass::Stop_Print() {
4575 4575
   printing = false;
4576 4576
   sdprint = false;
4577 4577
   thermalManager.cooldown();
4578
-  TERN_(LCD_SET_PROGRESS_MANUALLY, ui.set_progress(100 * (PROGRESS_SCALE)));
4579
-  TERN_(USE_M73_REMAINING_TIME, ui.set_remaining_time(0));
4578
+  TERN_(SET_PROGRESS_PERCENT, ui.set_progress(100 * (PROGRESS_SCALE)));
4579
+  TERN_(SET_REMAINING_TIME, ui.set_remaining_time(0));
4580 4580
   Draw_Print_confirm();
4581 4581
 }
4582 4582
 
@@ -4653,7 +4653,7 @@ void CrealityDWINClass::Screen_Update() {
4653 4653
     if (process == Print) {
4654 4654
       Draw_Print_ProgressBar();
4655 4655
       Draw_Print_ProgressElapsed();
4656
-      TERN_(USE_M73_REMAINING_TIME, Draw_Print_ProgressRemain());
4656
+      TERN_(SET_REMAINING_TIME, Draw_Print_ProgressRemain());
4657 4657
     }
4658 4658
   }
4659 4659
 

+ 1
- 1
Marlin/src/lcd/e3v2/jyersui/dwin.h 查看文件

@@ -188,7 +188,7 @@ public:
188 188
   static void Draw_Print_Screen();
189 189
   static void Draw_Print_Filename(const bool reset=false);
190 190
   static void Draw_Print_ProgressBar();
191
-  #if ENABLED(USE_M73_REMAINING_TIME)
191
+  #if ENABLED(SET_REMAINING_TIME)
192 192
     static void Draw_Print_ProgressRemain();
193 193
   #endif
194 194
   static void Draw_Print_ProgressElapsed();

+ 3
- 3
Marlin/src/lcd/e3v2/marlinui/ui_status_480x272.cpp 查看文件

@@ -374,11 +374,11 @@ void MarlinUI::draw_status_screen() {
374 374
 
375 375
   #if ENABLED(DWIN_MARLINUI_PORTRAIT)
376 376
 
377
-    // Portrait mode only shows one value at a time, and will rotate if ROTATE_PROGRESS_DISPLAY
377
+    // Portrait mode only shows one value at a time, and will rotate if many are enabled
378 378
     dwin_string.set();
379 379
     char prefix = ' ';
380 380
     #if ENABLED(SHOW_REMAINING_TIME)
381
-      if (TERN1(ROTATE_PROGRESS_DISPLAY, blink) && print_job_timer.isRunning()) {
381
+      if (blink && print_job_timer.isRunning()) {
382 382
         time = get_remaining_time();
383 383
         prefix = 'R';
384 384
       }
@@ -447,7 +447,7 @@ void MarlinUI::draw_status_screen() {
447 447
       //if (pb_solid < old_solid)
448 448
         DWIN_Draw_Rectangle(1, Color_Bg_Black, pb_left + 1 + pb_solid, pb_top + 1, pb_right - 1, pb_bottom - 1); // Erase the rest
449 449
 
450
-      #if ENABLED(SHOW_SD_PERCENT)
450
+      #if ENABLED(SHOW_PROGRESS_PERCENT)
451 451
         dwin_string.set(TERN(PRINT_PROGRESS_SHOW_DECIMALS, permyriadtostr4(progress), ui8tostr3rj(progress / (PROGRESS_SCALE))));
452 452
         dwin_string.add('%');
453 453
         DWIN_Draw_String(

+ 2
- 2
Marlin/src/lcd/e3v2/proui/dwin.cpp 查看文件

@@ -43,8 +43,8 @@
43 43
 #if DISABLED(INDIVIDUAL_AXIS_HOMING_SUBMENU)
44 44
   #warning "INDIVIDUAL_AXIS_HOMING_SUBMENU is recommended with ProUI."
45 45
 #endif
46
-#if DISABLED(LCD_SET_PROGRESS_MANUALLY)
47
-  #warning "LCD_SET_PROGRESS_MANUALLY is recommended with ProUI."
46
+#if DISABLED(SET_PROGRESS_MANUALLY)
47
+  #warning "SET_PROGRESS_MANUALLY is recommended with ProUI."
48 48
 #endif
49 49
 #if DISABLED(STATUS_MESSAGE_SCROLLING)
50 50
   #warning "STATUS_MESSAGE_SCROLLING is recommended with ProUI."

+ 1
- 1
Marlin/src/lcd/extui/dgus/fysetc/DGUSDisplayDef.cpp 查看文件

@@ -63,7 +63,7 @@ const uint16_t VPList_Main[] PROGMEM = {
63 63
   VP_XPos, VP_YPos, VP_ZPos,
64 64
   VP_Fan0_Percentage,
65 65
   VP_Feedrate_Percentage,
66
-  #if ENABLED(LCD_SET_PROGRESS_MANUALLY)
66
+  #if ENABLED(SET_PROGRESS_PERCENT)
67 67
     VP_PrintProgress_Percentage,
68 68
   #endif
69 69
   0x0000

+ 1
- 1
Marlin/src/lcd/extui/dgus/hiprecy/DGUSDisplayDef.cpp 查看文件

@@ -63,7 +63,7 @@ const uint16_t VPList_Main[] PROGMEM = {
63 63
   VP_XPos, VP_YPos, VP_ZPos,
64 64
   VP_Fan0_Percentage,
65 65
   VP_Feedrate_Percentage,
66
-  #if ENABLED(LCD_SET_PROGRESS_MANUALLY)
66
+  #if ENABLED(SET_PROGRESS_PERCENT)
67 67
     VP_PrintProgress_Percentage,
68 68
   #endif
69 69
   0x0000

+ 1
- 1
Marlin/src/lcd/extui/dgus/mks/DGUSDisplayDef.cpp 查看文件

@@ -135,7 +135,7 @@ const uint16_t VPList_Main[] PROGMEM = {
135 135
   VP_XPos, VP_YPos, VP_ZPos,
136 136
   VP_Fan0_Percentage,
137 137
   VP_Feedrate_Percentage,
138
-  #if ENABLED(LCD_SET_PROGRESS_MANUALLY)
138
+  #if ENABLED(SET_PROGRESS_PERCENT)
139 139
     VP_PrintProgress_Percentage,
140 140
   #endif
141 141
   0x0000

+ 2
- 2
Marlin/src/lcd/extui/mks_ui/draw_printing.cpp 查看文件

@@ -39,7 +39,7 @@
39 39
   #include "../../../feature/powerloss.h"
40 40
 #endif
41 41
 
42
-#if BOTH(LCD_SET_PROGRESS_MANUALLY, USE_M73_REMAINING_TIME)
42
+#if ENABLED(SET_REMAINING_TIME)
43 43
   #include "../../marlinui.h"
44 44
 #endif
45 45
 
@@ -244,7 +244,7 @@ void disp_fan_speed() {
244 244
 }
245 245
 
246 246
 void disp_print_time() {
247
-  #if BOTH(LCD_SET_PROGRESS_MANUALLY, USE_M73_REMAINING_TIME)
247
+  #if ENABLED(SET_REMAINING_TIME)
248 248
     const uint32_t r = ui.get_remaining_time();
249 249
     sprintf_P(public_buf_l, PSTR("%02d:%02d R"), r / 3600, (r % 3600) / 60);
250 250
   #else

+ 3
- 0
Marlin/src/lcd/extui/ui_api.h 查看文件

@@ -164,6 +164,9 @@ namespace ExtUI {
164 164
   #if ENABLED(SHOW_REMAINING_TIME)
165 165
     inline uint32_t getProgress_seconds_remaining() { return ui.get_remaining_time(); }
166 166
   #endif
167
+  #if ENABLED(SHOW_INTERACTION_TIME)
168
+    inline uint32_t getInteraction_seconds_remaining() { return ui.interaction_time; }
169
+  #endif
167 170
 
168 171
   #if HAS_LEVELING
169 172
     bool getLevelingActive();

+ 41
- 17
Marlin/src/lcd/marlinui.cpp 查看文件

@@ -79,11 +79,16 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP;
79 79
   statusResetFunc_t MarlinUI::status_reset_callback; // = nullptr
80 80
 #endif
81 81
 
82
-#if ENABLED(LCD_SET_PROGRESS_MANUALLY)
83
-  MarlinUI::progress_t MarlinUI::progress_override; // = 0
84
-  #if ENABLED(USE_M73_REMAINING_TIME)
82
+#if ENABLED(SET_PROGRESS_MANUALLY)
83
+  #if ENABLED(SET_PROGRESS_PERCENT)
84
+    MarlinUI::progress_t MarlinUI::progress_override; // = 0
85
+  #endif
86
+  #if ENABLED(SET_REMAINING_TIME)
85 87
     uint32_t MarlinUI::remaining_time;
86 88
   #endif
89
+  #if ENABLED(SET_INTERACTION_TIME)
90
+    uint32_t MarlinUI::interaction_time;
91
+  #endif
87 92
 #endif
88 93
 
89 94
 #if HAS_MULTI_LANGUAGE
@@ -153,7 +158,7 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP;
153 158
   bool MarlinUI::lcd_clicked;
154 159
 #endif
155 160
 
156
-#if EITHER(HAS_WIRED_LCD, DWIN_CREALITY_LCD_JYERSUI)
161
+#if LCD_WITH_BLINK
157 162
 
158 163
   bool MarlinUI::get_blink() {
159 164
     static uint8_t blink = 0;
@@ -1677,19 +1682,6 @@ void MarlinUI::init() {
1677 1682
     print_job_timer.start(); // Also called by M24
1678 1683
   }
1679 1684
 
1680
-  #if HAS_PRINT_PROGRESS
1681
-
1682
-    MarlinUI::progress_t MarlinUI::_get_progress() {
1683
-      return (
1684
-        TERN0(LCD_SET_PROGRESS_MANUALLY, (progress_override & PROGRESS_MASK))
1685
-        #if ENABLED(SDSUPPORT)
1686
-          ?: TERN(HAS_PRINT_PROGRESS_PERMYRIAD, card.permyriadDone(), card.percentDone())
1687
-        #endif
1688
-      );
1689
-    }
1690
-
1691
-  #endif
1692
-
1693 1685
   #if HAS_TOUCH_BUTTONS
1694 1686
 
1695 1687
     //
@@ -1723,6 +1715,38 @@ void MarlinUI::init() {
1723 1715
 
1724 1716
 #endif // HAS_DISPLAY
1725 1717
 
1718
+#if HAS_PRINT_PROGRESS
1719
+
1720
+  MarlinUI::progress_t MarlinUI::_get_progress() {
1721
+    return (
1722
+      TERN0(SET_PROGRESS_PERCENT, (progress_override & PROGRESS_MASK))
1723
+      #if ENABLED(SDSUPPORT)
1724
+        ?: TERN(HAS_PRINT_PROGRESS_PERMYRIAD, card.permyriadDone(), card.percentDone())
1725
+      #endif
1726
+    );
1727
+  }
1728
+
1729
+  #if LCD_WITH_BLINK
1730
+    typedef void (*PrintProgress_t)();
1731
+    void MarlinUI::rotate_progress() { // Renew and redraw all enabled progress strings
1732
+      const PrintProgress_t progFunc[] = {
1733
+        OPTITEM(SHOW_PROGRESS_PERCENT, drawPercent)
1734
+        OPTITEM(SHOW_ELAPSED_TIME, drawElapsed)
1735
+        OPTITEM(SHOW_REMAINING_TIME, drawRemain)
1736
+        OPTITEM(SHOW_INTERACTION_TIME, drawInter)
1737
+      };
1738
+      static bool prev_blink;
1739
+      static uint8_t i;
1740
+      if (prev_blink != get_blink()) {
1741
+        prev_blink = get_blink();
1742
+        if (++i >= COUNT(progFunc)) i = 0;
1743
+        (*progFunc[i])();
1744
+      }
1745
+    }
1746
+  #endif
1747
+
1748
+#endif // HAS_PRINT_PROGRESS
1749
+
1726 1750
 #if ENABLED(SDSUPPORT)
1727 1751
 
1728 1752
   #if ENABLED(EXTENSIBLE_UI)

+ 26
- 6
Marlin/src/lcd/marlinui.h 查看文件

@@ -25,7 +25,6 @@
25 25
 #include "../sd/cardreader.h"
26 26
 #include "../module/motion.h"
27 27
 #include "../libs/buzzer.h"
28
-
29 28
 #include "buttons.h"
30 29
 
31 30
 #if ENABLED(TOUCH_SCREEN_CALIBRATION)
@@ -36,7 +35,7 @@
36 35
   #define MULTI_E_MANUAL 1
37 36
 #endif
38 37
 
39
-#if HAS_DISPLAY
38
+#if HAS_PRINT_PROGRESS
40 39
   #include "../module/printcounter.h"
41 40
 #endif
42 41
 
@@ -86,6 +85,7 @@ typedef bool (*statusResetFunc_t)();
86 85
 #endif // HAS_WIRED_LCD
87 86
 
88 87
 #if EITHER(HAS_WIRED_LCD, DWIN_CREALITY_LCD_JYERSUI)
88
+  #define LCD_WITH_BLINK 1
89 89
   #define LCD_UPDATE_INTERVAL TERN(HAS_TOUCH_BUTTONS, 50, 100)
90 90
 #endif
91 91
 
@@ -303,19 +303,19 @@ public:
303 303
       #define PROGRESS_SCALE 1U
304 304
       #define PROGRESS_MASK 0x7F
305 305
     #endif
306
-    #if ENABLED(LCD_SET_PROGRESS_MANUALLY)
306
+    #if ENABLED(SET_PROGRESS_PERCENT)
307 307
       static progress_t progress_override;
308 308
       static void set_progress(const progress_t p) { progress_override = _MIN(p, 100U * (PROGRESS_SCALE)); }
309 309
       static void set_progress_done() { progress_override = (PROGRESS_MASK + 1U) + 100U * (PROGRESS_SCALE); }
310 310
       static void progress_reset() { if (progress_override & (PROGRESS_MASK + 1U)) set_progress(0); }
311 311
     #endif
312
-    #if ENABLED(SHOW_REMAINING_TIME)
312
+    #if EITHER(SHOW_REMAINING_TIME, SET_PROGRESS_MANUALLY)
313 313
       static uint32_t _calculated_remaining_time() {
314 314
         const duration_t elapsed = print_job_timer.duration();
315 315
         const progress_t progress = _get_progress();
316 316
         return progress ? elapsed.value * (100 * (PROGRESS_SCALE) - progress) / progress : 0;
317 317
       }
318
-      #if ENABLED(USE_M73_REMAINING_TIME)
318
+      #if ENABLED(SET_REMAINING_TIME)
319 319
         static uint32_t remaining_time;
320 320
         FORCE_INLINE static void set_remaining_time(const uint32_t r) { remaining_time = r; }
321 321
         FORCE_INLINE static uint32_t get_remaining_time() { return remaining_time ?: _calculated_remaining_time(); }
@@ -323,12 +323,32 @@ public:
323 323
       #else
324 324
         FORCE_INLINE static uint32_t get_remaining_time() { return _calculated_remaining_time(); }
325 325
       #endif
326
+      #if ENABLED(SET_INTERACTION_TIME)
327
+        static uint32_t interaction_time;
328
+        FORCE_INLINE static void set_interaction_time(const uint32_t r) { interaction_time = r; }
329
+        FORCE_INLINE static void reset_interaction_time() { set_interaction_time(0); }
330
+      #endif
326 331
     #endif
327 332
     static progress_t _get_progress();
328 333
     #if HAS_PRINT_PROGRESS_PERMYRIAD
329 334
       FORCE_INLINE static uint16_t get_progress_permyriad() { return _get_progress(); }
330 335
     #endif
331 336
     static uint8_t get_progress_percent() { return uint8_t(_get_progress() / (PROGRESS_SCALE)); }
337
+    #if LCD_WITH_BLINK
338
+      #if ENABLED(SHOW_PROGRESS_PERCENT)
339
+        static void drawPercent();
340
+      #endif
341
+      #if ENABLED(SHOW_ELAPSED_TIME)
342
+        static void drawElapsed();
343
+      #endif
344
+      #if ENABLED(SHOW_REMAINING_TIME)
345
+        static void drawRemain();
346
+      #endif
347
+      #if ENABLED(SHOW_INTERACTION_TIME)
348
+        static void drawInter();
349
+      #endif
350
+      static void rotate_progress();
351
+    #endif
332 352
   #else
333 353
     static constexpr uint8_t get_progress_percent() { return 0; }
334 354
   #endif
@@ -390,7 +410,7 @@ public:
390 410
       static void poweroff();
391 411
     #endif
392 412
 
393
-    #if EITHER(HAS_WIRED_LCD, DWIN_CREALITY_LCD_JYERSUI)
413
+    #if LCD_WITH_BLINK
394 414
       static bool get_blink();
395 415
     #endif
396 416
 

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

@@ -175,7 +175,7 @@ void MarlinUI::goto_screen(screenFunc_t screen, const uint16_t encoder/*=0*/, co
175 175
 
176 176
     TERN_(HAS_TOUCH_BUTTONS, repeat_delay = BUTTON_DELAY_MENU);
177 177
 
178
-    TERN_(LCD_SET_PROGRESS_MANUALLY, progress_reset());
178
+    TERN_(SET_PROGRESS_PERCENT, progress_reset());
179 179
 
180 180
     #if BOTH(DOUBLECLICK_FOR_Z_BABYSTEPPING, BABYSTEPPING)
181 181
       static millis_t doubleclick_expire_ms = 0;

+ 2
- 2
Marlin/src/libs/numtostr.cpp 查看文件

@@ -73,10 +73,10 @@ const char* i8tostr3rj(const int8_t x) {
73 73
 }
74 74
 
75 75
 #if HAS_PRINT_PROGRESS_PERMYRIAD
76
-  // Convert unsigned 16-bit permyriad to percent with 100 / 23 / 23.4 / 3.45 format
76
+  // Convert unsigned 16-bit permyriad to percent with 100 / 23.4 / 3.45 format
77 77
   const char* permyriadtostr4(const uint16_t xx) {
78 78
     if (xx >= 10000)
79
-      return "100";
79
+      return " 100"; // space to keep 4-width alignment
80 80
     else if (xx >= 1000) {
81 81
       conv[3] = DIGIMOD(xx, 1000);
82 82
       conv[4] = DIGIMOD(xx, 100);

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

@@ -21,7 +21,7 @@ opt_enable ENDSTOP_INTERRUPTS_FEATURE S_CURVE_ACCELERATION BLTOUCH Z_MIN_PROBE_R
21 21
            FILAMENT_RUNOUT_SENSOR G26_MESH_VALIDATION MESH_EDIT_GFX_OVERLAY Z_SAFE_HOMING \
22 22
            EEPROM_SETTINGS NOZZLE_PARK_FEATURE SDSUPPORT SD_CHECK_AND_RETRY \
23 23
            REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER Z_STEPPER_AUTO_ALIGN ADAPTIVE_STEP_SMOOTHING \
24
-           STATUS_MESSAGE_SCROLLING LCD_SET_PROGRESS_MANUALLY SHOW_REMAINING_TIME USE_M73_REMAINING_TIME \
24
+           STATUS_MESSAGE_SCROLLING SET_PROGRESS_MANUALLY SHOW_REMAINING_TIME SET_REMAINING_TIME \
25 25
            LONG_FILENAME_HOST_SUPPORT CUSTOM_FIRMWARE_UPLOAD M20_TIMESTAMP_SUPPORT \
26 26
            SCROLL_LONG_FILENAMES BABYSTEPPING DOUBLECLICK_FOR_Z_BABYSTEPPING \
27 27
            MOVE_Z_WHEN_IDLE BABYSTEP_ZPROBE_OFFSET BABYSTEP_ZPROBE_GFX_OVERLAY \

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

@@ -20,7 +20,7 @@ exec_test $1 $2 "Ender 3 v2 with JyersUI" "$3"
20 20
 
21 21
 use_example_configs "Creality/Ender-3 S1/STM32F1"
22 22
 opt_disable DWIN_CREALITY_LCD Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN AUTO_BED_LEVELING_BILINEAR CONFIGURATION_EMBEDDING CANCEL_OBJECTS FWRETRACT
23
-opt_enable DWIN_LCD_PROUI INDIVIDUAL_AXIS_HOMING_SUBMENU LCD_SET_PROGRESS_MANUALLY STATUS_MESSAGE_SCROLLING \
23
+opt_enable DWIN_LCD_PROUI INDIVIDUAL_AXIS_HOMING_SUBMENU SET_PROGRESS_MANUALLY SET_PROGRESS_PERCENT STATUS_MESSAGE_SCROLLING \
24 24
            SOUND_MENU_ITEM PRINTCOUNTER NOZZLE_PARK_FEATURE ADVANCED_PAUSE_FEATURE FILAMENT_RUNOUT_SENSOR \
25 25
            BLTOUCH Z_SAFE_HOMING AUTO_BED_LEVELING_UBL MESH_EDIT_MENU \
26 26
            LIMITED_MAX_FR_EDITING LIMITED_MAX_ACCEL_EDITING LIMITED_JERK_EDITING BAUD_RATE_GCODE

+ 62
- 47
buildroot/tests/mega2560 查看文件

@@ -31,7 +31,7 @@ opt_enable AUTO_BED_LEVELING_UBL RESTORE_LEVELING_AFTER_G28 DEBUG_LEVELING_FEATU
31 31
            SDSUPPORT SDCARD_SORT_ALPHA USB_FLASH_DRIVE_SUPPORT AUTO_REPORT_SD_STATUS SCROLL_LONG_FILENAMES MEDIA_MENU_AT_TOP \
32 32
            EEPROM_SETTINGS EEPROM_CHITCHAT GCODE_MACROS CUSTOM_MENU_MAIN FREEZE_FEATURE CANCEL_OBJECTS SOUND_MENU_ITEM \
33 33
            MULTI_NOZZLE_DUPLICATION CLASSIC_JERK LIN_ADVANCE EXTRA_LIN_ADVANCE_K QUICK_HOME \
34
-           LCD_SET_PROGRESS_MANUALLY PRINT_PROGRESS_SHOW_DECIMALS SHOW_REMAINING_TIME \
34
+           SET_PROGRESS_MANUALLY SET_PROGRESS_PERCENT PRINT_PROGRESS_SHOW_DECIMALS SHOW_REMAINING_TIME \
35 35
            ENCODER_NOISE_FILTER BABYSTEPPING BABYSTEP_XY NANODLP_Z_SYNC I2C_POSITION_ENCODERS M114_DETAIL
36 36
 exec_test $1 $2 "Azteeg X3 Pro | EXTRUDERS 5 | RRDFGSC | UBL | LIN_ADVANCE ..." "$3"
37 37
 
@@ -42,7 +42,7 @@ use_example_configs AnimationExample
42 42
 opt_set MOTHERBOARD BOARD_AZTEEG_X3_PRO LCD_LANGUAGE jp_kana DEFAULT_EJERK 10 \
43 43
         EXTRUDERS 5 TEMP_SENSOR_1 1 TEMP_SENSOR_2 5 TEMP_SENSOR_3 20 TEMP_SENSOR_4 1000 TEMP_SENSOR_BED 1
44 44
 opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER LIGHTWEIGHT_UI SHOW_CUSTOM_BOOTSCREEN BOOT_MARLIN_LOGO_SMALL \
45
-           LCD_SET_PROGRESS_MANUALLY PRINT_PROGRESS_SHOW_DECIMALS SHOW_REMAINING_TIME STATUS_MESSAGE_SCROLLING SCROLL_LONG_FILENAMES \
45
+           SET_PROGRESS_MANUALLY SET_PROGRESS_PERCENT PRINT_PROGRESS_SHOW_DECIMALS SHOW_REMAINING_TIME STATUS_MESSAGE_SCROLLING SCROLL_LONG_FILENAMES \
46 46
            SDSUPPORT LONG_FILENAME_WRITE_SUPPORT SDCARD_SORT_ALPHA NO_SD_AUTOSTART USB_FLASH_DRIVE_SUPPORT CANCEL_OBJECTS \
47 47
            Z_PROBE_SLED AUTO_BED_LEVELING_UBL UBL_HILBERT_CURVE RESTORE_LEVELING_AFTER_G28 DEBUG_LEVELING_FEATURE G26_MESH_VALIDATION ENABLE_LEVELING_FADE_HEIGHT \
48 48
            EEPROM_SETTINGS EEPROM_CHITCHAT GCODE_MACROS CUSTOM_MENU_MAIN \
@@ -177,52 +177,52 @@ exec_test $1 $2 "Azteeg X3 | Mixing Extruder (x5) | Gradient Mix | Greek" "$3"
177 177
 #opt_enable LCM1602
178 178
 #exec_test $1 $2 "Stuff" "$3"
179 179
 
180
-#
181
-# Test Laser features with 12864 LCD
182
-#
183
-restore_configs
184
-opt_set MOTHERBOARD BOARD_RAMPS_14_EFB EXTRUDERS 0 LCD_LANGUAGE en TEMP_SENSOR_COOLER 1 TEMP_SENSOR_1 0 SERIAL_PORT_2 2 \
185
-        DEFAULT_AXIS_STEPS_PER_UNIT '{ 80, 80, 400 }' \
186
-        DEFAULT_MAX_FEEDRATE '{ 300, 300, 5 }' \
187
-        DEFAULT_MAX_ACCELERATION '{ 3000, 3000, 100 }' \
188
-        MANUAL_FEEDRATE '{ 50*60, 50*60, 4*60 }' \
189
-        AXIS_RELATIVE_MODES '{ false, false, false }'
190
-opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER SDSUPPORT EEPROM_SETTINGS EEPROM_BOOT_SILENT EEPROM_AUTO_INIT MEATPACK_ON_SERIAL_PORT_1 \
191
-           LASER_FEATURE LASER_SAFETY_TIMEOUT_MS LASER_COOLANT_FLOW_METER AIR_EVACUATION AIR_EVACUATION_PIN AIR_ASSIST AIR_ASSIST_PIN LASER_SYNCHRONOUS_M106_M107
192
-exec_test $1 $2 "MEGA2560 RAMPS | Laser Options | 12864 | Meatpack | Fan Sync | SERIAL_PORT_2 " "$3"
180
+# #
181
+# # Test Laser features with 12864 LCD
182
+# #
183
+# restore_configs
184
+# opt_set MOTHERBOARD BOARD_RAMPS_14_EFB EXTRUDERS 0 LCD_LANGUAGE en TEMP_SENSOR_COOLER 1 TEMP_SENSOR_1 0 SERIAL_PORT_2 2 \
185
+#         DEFAULT_AXIS_STEPS_PER_UNIT '{ 80, 80, 400 }' \
186
+#         DEFAULT_MAX_FEEDRATE '{ 300, 300, 5 }' \
187
+#         DEFAULT_MAX_ACCELERATION '{ 3000, 3000, 100 }' \
188
+#         MANUAL_FEEDRATE '{ 50*60, 50*60, 4*60 }' \
189
+#         AXIS_RELATIVE_MODES '{ false, false, false }'
190
+# opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER SDSUPPORT EEPROM_SETTINGS EEPROM_BOOT_SILENT EEPROM_AUTO_INIT MEATPACK_ON_SERIAL_PORT_1 \
191
+#            LASER_FEATURE LASER_SAFETY_TIMEOUT_MS LASER_COOLANT_FLOW_METER AIR_EVACUATION AIR_EVACUATION_PIN AIR_ASSIST AIR_ASSIST_PIN LASER_SYNCHRONOUS_M106_M107
192
+# exec_test $1 $2 "MEGA2560 RAMPS | Laser Options | 12864 | Meatpack | Fan Sync | SERIAL_PORT_2 " "$3"
193 193
 
194
-#
195
-# Test Laser features with 44780 LCD
196
-#
197
-restore_configs
198
-opt_set MOTHERBOARD BOARD_RAMPS_14_EFB EXTRUDERS 0 LCD_LANGUAGE en TEMP_SENSOR_COOLER 1 TEMP_SENSOR_1 0 \
199
-        DEFAULT_AXIS_STEPS_PER_UNIT '{ 80, 80, 400 }' \
200
-        DEFAULT_MAX_FEEDRATE '{ 300, 300, 5 }' \
201
-        DEFAULT_MAX_ACCELERATION '{ 3000, 3000, 100 }' \
202
-        MANUAL_FEEDRATE '{ 50*60, 50*60, 4*60 }' \
203
-        AXIS_RELATIVE_MODES '{ false, false, false }'
204
-opt_enable REPRAP_DISCOUNT_SMART_CONTROLLER SDSUPPORT EEPROM_SETTINGS EEPROM_BOOT_SILENT EEPROM_AUTO_INIT PRINTCOUNTER I2C_AMMETER \
205
-           LASER_FEATURE LASER_SAFETY_TIMEOUT_MS LASER_COOLANT_FLOW_METER AIR_EVACUATION AIR_EVACUATION_PIN AIR_ASSIST AIR_ASSIST_PIN
206
-exec_test $1 $2 "MEGA2560 RAMPS | Laser Feature | Air Evacuation | Air Assist | Cooler | Laser Safety Timeout | Flowmeter | 44780 LCD " "$3"
194
+# #
195
+# # Test Laser features with 44780 LCD
196
+# #
197
+# restore_configs
198
+# opt_set MOTHERBOARD BOARD_RAMPS_14_EFB EXTRUDERS 0 LCD_LANGUAGE en TEMP_SENSOR_COOLER 1 TEMP_SENSOR_1 0 \
199
+#         DEFAULT_AXIS_STEPS_PER_UNIT '{ 80, 80, 400 }' \
200
+#         DEFAULT_MAX_FEEDRATE '{ 300, 300, 5 }' \
201
+#         DEFAULT_MAX_ACCELERATION '{ 3000, 3000, 100 }' \
202
+#         MANUAL_FEEDRATE '{ 50*60, 50*60, 4*60 }' \
203
+#         AXIS_RELATIVE_MODES '{ false, false, false }'
204
+# opt_enable REPRAP_DISCOUNT_SMART_CONTROLLER SDSUPPORT EEPROM_SETTINGS EEPROM_BOOT_SILENT EEPROM_AUTO_INIT PRINTCOUNTER I2C_AMMETER \
205
+#            LASER_FEATURE LASER_SAFETY_TIMEOUT_MS LASER_COOLANT_FLOW_METER AIR_EVACUATION AIR_EVACUATION_PIN AIR_ASSIST AIR_ASSIST_PIN
206
+# exec_test $1 $2 "MEGA2560 RAMPS | Laser Feature | Air Evacuation | Air Assist | Cooler | Laser Safety Timeout | Flowmeter | 44780 LCD " "$3"
207 207
 
208
-#
209
-# Test redundant temperature sensors + MAX TC + Backlight Timeout
210
-#
211
-restore_configs
212
-opt_set MOTHERBOARD BOARD_RAMPS_14_EFB EXTRUDERS 1 \
213
-        TEMP_SENSOR_0 -2 TEMP_SENSOR_REDUNDANT -2 \
214
-        TEMP_SENSOR_REDUNDANT_SOURCE E1 TEMP_SENSOR_REDUNDANT_TARGET E0 \
215
-        TEMP_0_CS_PIN 11 TEMP_1_CS_PIN 12 \
216
-        LCD_BACKLIGHT_TIMEOUT_MINS 2
217
-opt_enable MPCTEMP MINIPANEL
218
-opt_disable PIDTEMP
219
-exec_test $1 $2 "MEGA2560 RAMPS | Redundant temperature sensor | 2x MAX6675 | BL Timeout" "$3"
208
+# #
209
+# # Test redundant temperature sensors + MAX TC + Backlight Timeout
210
+# #
211
+# restore_configs
212
+# opt_set MOTHERBOARD BOARD_RAMPS_14_EFB EXTRUDERS 1 \
213
+#         TEMP_SENSOR_0 -2 TEMP_SENSOR_REDUNDANT -2 \
214
+#         TEMP_SENSOR_REDUNDANT_SOURCE E1 TEMP_SENSOR_REDUNDANT_TARGET E0 \
215
+#         TEMP_0_CS_PIN 11 TEMP_1_CS_PIN 12 \
216
+#         LCD_BACKLIGHT_TIMEOUT_MINS 2
217
+# opt_enable MPCTEMP MINIPANEL
218
+# opt_disable PIDTEMP
219
+# exec_test $1 $2 "MEGA2560 RAMPS | Redundant temperature sensor | 2x MAX6675 | BL Timeout" "$3"
220 220
 
221
-#
222
-# Polargraph Config
223
-#
224
-use_example_configs Polargraph
225
-exec_test $1 $2 "RUMBA | POLARGRAPH | RRD LCD" "$3"
221
+# #
222
+# # Polargraph Config
223
+# #
224
+# use_example_configs Polargraph
225
+# exec_test $1 $2 "RUMBA | POLARGRAPH | RRD LCD" "$3"
226 226
 
227 227
 #
228 228
 # Language files test with REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
@@ -239,8 +239,8 @@ exec_test $1 $2 "RUMBA | POLARGRAPH | RRD LCD" "$3"
239 239
 #
240 240
 # Test a basic DUAL_X_CARRIAGE configuration
241 241
 #
242
-use_example_configs Formbot/T_Rex_3
243
-exec_test $1 $2 "Formbot/T_Rex_3 example configuration." "$3"
242
+# use_example_configs Formbot/T_Rex_3
243
+# exec_test $1 $2 "Formbot/T_Rex_3 example configuration." "$3"
244 244
 
245 245
 #
246 246
 # BQ Hephestos 2
@@ -260,5 +260,20 @@ exec_test $1 $2 "Formbot/T_Rex_3 example configuration." "$3"
260 260
 #use_example_configs tvrrug/Round2
261 261
 #exec_test $1 $2 "Stuff" "$3"
262 262
 
263
+#
264
+# Test progress display rotation
265
+#
266
+restore_configs
267
+opt_set MOTHERBOARD BOARD_RAMPS_14_EFB
268
+opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER \
269
+           SET_PROGRESS_MANUALLY SET_PROGRESS_PERCENT SET_REMAINING_TIME SET_INTERACTION_TIME M73_REPORT \
270
+           SHOW_PROGRESS_PERCENT SHOW_ELAPSED_TIME SHOW_REMAINING_TIME SHOW_INTERACTION_TIME PRINT_PROGRESS_SHOW_DECIMALS
271
+exec_test $1 $2 "MEGA2560 RAMPS | 12864 | progress rotation" "$3"
272
+opt_enable LIGHTWEIGHT_UI
273
+exec_test $1 $2 "MEGA2560 RAMPS | 12864 LIGHTWEIGHT_UI | progress rotation" "$3"
274
+opt_disable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
275
+opt_enable REPRAP_DISCOUNT_SMART_CONTROLLER
276
+exec_test $1 $2 "MEGA2560 RAMPS | 44780 | progress rotation" "$3"
277
+
263 278
 # clean up
264 279
 restore_configs

+ 1
- 1
ini/features.ini 查看文件

@@ -201,7 +201,7 @@ AUTO_REPORT_POSITION                   = src_filter=+<src/gcode/host/M154.cpp>
201 201
 REPETIER_GCODE_M360                    = src_filter=+<src/gcode/host/M360.cpp>
202 202
 HAS_GCODE_M876                         = src_filter=+<src/gcode/host/M876.cpp>
203 203
 HAS_RESUME_CONTINUE                    = src_filter=+<src/gcode/lcd/M0_M1.cpp>
204
-LCD_SET_PROGRESS_MANUALLY              = src_filter=+<src/gcode/lcd/M73.cpp>
204
+SET_PROGRESS_MANUALLY                  = src_filter=+<src/gcode/lcd/M73.cpp>
205 205
 HAS_STATUS_MESSAGE                     = src_filter=+<src/gcode/lcd/M117.cpp>
206 206
 HAS_LCD_CONTRAST                       = src_filter=+<src/gcode/lcd/M250.cpp>
207 207
 HAS_GCODE_M255                         = src_filter=+<src/gcode/lcd/M255.cpp>

Loading…
取消
儲存