瀏覽代碼

Add LCD_SET_PROGRESS_MANUALLY

Scott Lahteine 6 年之前
父節點
當前提交
5f708d47ce
共有 31 個文件被更改,包括 161 次插入31 次删除
  1. 3
    0
      Marlin/Configuration_adv.h
  2. 24
    1
      Marlin/Marlin_main.cpp
  3. 3
    0
      Marlin/example_configurations/AlephObjects/TAZ4/Configuration_adv.h
  4. 3
    0
      Marlin/example_configurations/Anet/A6/Configuration_adv.h
  5. 3
    0
      Marlin/example_configurations/Anet/A8/Configuration_adv.h
  6. 3
    0
      Marlin/example_configurations/BQ/Hephestos/Configuration_adv.h
  7. 3
    0
      Marlin/example_configurations/BQ/WITBOX/Configuration_adv.h
  8. 3
    0
      Marlin/example_configurations/Cartesio/Configuration_adv.h
  9. 3
    0
      Marlin/example_configurations/Creality/CR-10/Configuration_adv.h
  10. 3
    0
      Marlin/example_configurations/Felix/Configuration_adv.h
  11. 3
    0
      Marlin/example_configurations/Folger Tech/i3-2020/Configuration_adv.h
  12. 3
    0
      Marlin/example_configurations/Infitary/i3-M508/Configuration_adv.h
  13. 3
    0
      Marlin/example_configurations/RigidBot/Configuration_adv.h
  14. 3
    0
      Marlin/example_configurations/SCARA/Configuration_adv.h
  15. 3
    0
      Marlin/example_configurations/Sanguinololu/Configuration_adv.h
  16. 3
    0
      Marlin/example_configurations/TinyBoy2/Configuration_adv.h
  17. 3
    0
      Marlin/example_configurations/Velleman/K8400/Configuration_adv.h
  18. 3
    0
      Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration_adv.h
  19. 3
    0
      Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration_adv.h
  20. 3
    0
      Marlin/example_configurations/delta/generic/Configuration_adv.h
  21. 3
    0
      Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h
  22. 3
    0
      Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h
  23. 3
    0
      Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h
  24. 3
    0
      Marlin/example_configurations/gCreate/gMax1.5+/Configuration_adv.h
  25. 3
    0
      Marlin/example_configurations/makibox/Configuration_adv.h
  26. 3
    0
      Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h
  27. 3
    0
      Marlin/example_configurations/wt150/Configuration_adv.h
  28. 40
    20
      Marlin/ultralcd.cpp
  29. 4
    0
      Marlin/ultralcd.h
  30. 8
    4
      Marlin/ultralcd_impl_DOGM.h
  31. 7
    6
      Marlin/ultralcd_impl_HD44780.h

+ 3
- 0
Marlin/Configuration_adv.h 查看文件

535
     //#define LCD_PROGRESS_BAR_TEST
535
     //#define LCD_PROGRESS_BAR_TEST
536
   #endif
536
   #endif
537
 
537
 
538
+  // Add an 'M73' G-code to set the current percentage
539
+  //#define LCD_SET_PROGRESS_MANUALLY
540
+
538
   // This allows hosts to request long names for files and folders with M33
541
   // This allows hosts to request long names for files and folders with M33
539
   //#define LONG_FILENAME_HOST_SUPPORT
542
   //#define LONG_FILENAME_HOST_SUPPORT
540
 
543
 

+ 24
- 1
Marlin/Marlin_main.cpp 查看文件

6022
       #if ENABLED(ULTIPANEL)
6022
       #if ENABLED(ULTIPANEL)
6023
         if (lcd_detected()) {
6023
         if (lcd_detected()) {
6024
           while (wait_for_user) idle();
6024
           while (wait_for_user) idle();
6025
-          IS_SD_PRINTING ? LCD_MESSAGEPGM(MSG_RESUMING) : LCD_MESSAGEPGM(WELCOME_MSG);
6025
+          print_job_timer.isPaused() ? LCD_MESSAGEPGM(WELCOME_MSG) : LCD_MESSAGEPGM(MSG_RESUMING);
6026
         }
6026
         }
6027
       #else
6027
       #else
6028
         while (wait_for_user) idle();
6028
         while (wait_for_user) idle();
7241
 
7241
 
7242
 #endif // AUTO_BED_LEVELING_UBL && UBL_G26_MESH_VALIDATION
7242
 #endif // AUTO_BED_LEVELING_UBL && UBL_G26_MESH_VALIDATION
7243
 
7243
 
7244
+#if ENABLED(ULTRA_LCD) && ENABLED(LCD_SET_PROGRESS_MANUALLY)
7245
+  /**
7246
+   * M73: Set percentage complete (for display on LCD)
7247
+   *
7248
+   * Example:
7249
+   *   M73 P25 ; Set progress to 25%
7250
+   *
7251
+   * Notes:
7252
+   *   This has no effect during an SD print job
7253
+   */
7254
+  inline void gcode_M73() {
7255
+    if (!IS_SD_PRINTING && parser.seen('P')) {
7256
+      progress_bar_percent = parser.value_byte();
7257
+      NOMORE(progress_bar_percent, 100);
7258
+    }
7259
+  }
7260
+#endif // ULTRA_LCD && LCD_SET_PROGRESS_MANUALLY
7261
+
7244
 /**
7262
 /**
7245
  * M75: Start print timer
7263
  * M75: Start print timer
7246
  */
7264
  */
11090
           break;
11108
           break;
11091
       #endif // AUTO_BED_LEVELING_UBL && UBL_G26_MESH_VALIDATION
11109
       #endif // AUTO_BED_LEVELING_UBL && UBL_G26_MESH_VALIDATION
11092
 
11110
 
11111
+      #if ENABLED(ULTRA_LCD) && ENABLED(LCD_SET_PROGRESS_MANUALLY)
11112
+        case 73: // M73: Set print progress percentage
11113
+          gcode_M73(); break;
11114
+      #endif
11115
+
11093
       case 75: // M75: Start print timer
11116
       case 75: // M75: Start print timer
11094
         gcode_M75(); break;
11117
         gcode_M75(); break;
11095
       case 76: // M76: Pause print timer
11118
       case 76: // M76: Pause print timer

+ 3
- 0
Marlin/example_configurations/AlephObjects/TAZ4/Configuration_adv.h 查看文件

535
     //#define LCD_PROGRESS_BAR_TEST
535
     //#define LCD_PROGRESS_BAR_TEST
536
   #endif
536
   #endif
537
 
537
 
538
+  // Add an 'M73' G-code to set the current percentage
539
+  //#define LCD_SET_PROGRESS_MANUALLY
540
+
538
   // This allows hosts to request long names for files and folders with M33
541
   // This allows hosts to request long names for files and folders with M33
539
   //#define LONG_FILENAME_HOST_SUPPORT
542
   //#define LONG_FILENAME_HOST_SUPPORT
540
 
543
 

+ 3
- 0
Marlin/example_configurations/Anet/A6/Configuration_adv.h 查看文件

535
     //#define LCD_PROGRESS_BAR_TEST
535
     //#define LCD_PROGRESS_BAR_TEST
536
   #endif
536
   #endif
537
 
537
 
538
+  // Add an 'M73' G-code to set the current percentage
539
+  //#define LCD_SET_PROGRESS_MANUALLY
540
+
538
   // This allows hosts to request long names for files and folders with M33
541
   // This allows hosts to request long names for files and folders with M33
539
   //#define LONG_FILENAME_HOST_SUPPORT
542
   //#define LONG_FILENAME_HOST_SUPPORT
540
 
543
 

+ 3
- 0
Marlin/example_configurations/Anet/A8/Configuration_adv.h 查看文件

535
     //#define LCD_PROGRESS_BAR_TEST
535
     //#define LCD_PROGRESS_BAR_TEST
536
   #endif
536
   #endif
537
 
537
 
538
+  // Add an 'M73' G-code to set the current percentage
539
+  //#define LCD_SET_PROGRESS_MANUALLY
540
+
538
   // This allows hosts to request long names for files and folders with M33
541
   // This allows hosts to request long names for files and folders with M33
539
   //#define LONG_FILENAME_HOST_SUPPORT
542
   //#define LONG_FILENAME_HOST_SUPPORT
540
 
543
 

+ 3
- 0
Marlin/example_configurations/BQ/Hephestos/Configuration_adv.h 查看文件

535
     //#define LCD_PROGRESS_BAR_TEST
535
     //#define LCD_PROGRESS_BAR_TEST
536
   #endif
536
   #endif
537
 
537
 
538
+  // Add an 'M73' G-code to set the current percentage
539
+  //#define LCD_SET_PROGRESS_MANUALLY
540
+
538
   // This allows hosts to request long names for files and folders with M33
541
   // This allows hosts to request long names for files and folders with M33
539
   //#define LONG_FILENAME_HOST_SUPPORT
542
   //#define LONG_FILENAME_HOST_SUPPORT
540
 
543
 

+ 3
- 0
Marlin/example_configurations/BQ/WITBOX/Configuration_adv.h 查看文件

535
     //#define LCD_PROGRESS_BAR_TEST
535
     //#define LCD_PROGRESS_BAR_TEST
536
   #endif
536
   #endif
537
 
537
 
538
+  // Add an 'M73' G-code to set the current percentage
539
+  //#define LCD_SET_PROGRESS_MANUALLY
540
+
538
   // This allows hosts to request long names for files and folders with M33
541
   // This allows hosts to request long names for files and folders with M33
539
   //#define LONG_FILENAME_HOST_SUPPORT
542
   //#define LONG_FILENAME_HOST_SUPPORT
540
 
543
 

+ 3
- 0
Marlin/example_configurations/Cartesio/Configuration_adv.h 查看文件

535
     //#define LCD_PROGRESS_BAR_TEST
535
     //#define LCD_PROGRESS_BAR_TEST
536
   #endif
536
   #endif
537
 
537
 
538
+  // Add an 'M73' G-code to set the current percentage
539
+  //#define LCD_SET_PROGRESS_MANUALLY
540
+
538
   // This allows hosts to request long names for files and folders with M33
541
   // This allows hosts to request long names for files and folders with M33
539
   //#define LONG_FILENAME_HOST_SUPPORT
542
   //#define LONG_FILENAME_HOST_SUPPORT
540
 
543
 

+ 3
- 0
Marlin/example_configurations/Creality/CR-10/Configuration_adv.h 查看文件

535
     //#define LCD_PROGRESS_BAR_TEST
535
     //#define LCD_PROGRESS_BAR_TEST
536
   #endif
536
   #endif
537
 
537
 
538
+  // Add an 'M73' G-code to set the current percentage
539
+  //#define LCD_SET_PROGRESS_MANUALLY
540
+
538
   // This allows hosts to request long names for files and folders with M33
541
   // This allows hosts to request long names for files and folders with M33
539
   //#define LONG_FILENAME_HOST_SUPPORT
542
   //#define LONG_FILENAME_HOST_SUPPORT
540
 
543
 

+ 3
- 0
Marlin/example_configurations/Felix/Configuration_adv.h 查看文件

535
     //#define LCD_PROGRESS_BAR_TEST
535
     //#define LCD_PROGRESS_BAR_TEST
536
   #endif
536
   #endif
537
 
537
 
538
+  // Add an 'M73' G-code to set the current percentage
539
+  //#define LCD_SET_PROGRESS_MANUALLY
540
+
538
   // This allows hosts to request long names for files and folders with M33
541
   // This allows hosts to request long names for files and folders with M33
539
   //#define LONG_FILENAME_HOST_SUPPORT
542
   //#define LONG_FILENAME_HOST_SUPPORT
540
 
543
 

+ 3
- 0
Marlin/example_configurations/Folger Tech/i3-2020/Configuration_adv.h 查看文件

535
     //#define LCD_PROGRESS_BAR_TEST
535
     //#define LCD_PROGRESS_BAR_TEST
536
   #endif
536
   #endif
537
 
537
 
538
+  // Add an 'M73' G-code to set the current percentage
539
+  //#define LCD_SET_PROGRESS_MANUALLY
540
+
538
   // This allows hosts to request long names for files and folders with M33
541
   // This allows hosts to request long names for files and folders with M33
539
   //#define LONG_FILENAME_HOST_SUPPORT
542
   //#define LONG_FILENAME_HOST_SUPPORT
540
 
543
 

+ 3
- 0
Marlin/example_configurations/Infitary/i3-M508/Configuration_adv.h 查看文件

535
     //#define LCD_PROGRESS_BAR_TEST
535
     //#define LCD_PROGRESS_BAR_TEST
536
   #endif
536
   #endif
537
 
537
 
538
+  // Add an 'M73' G-code to set the current percentage
539
+  //#define LCD_SET_PROGRESS_MANUALLY
540
+
538
   // This allows hosts to request long names for files and folders with M33
541
   // This allows hosts to request long names for files and folders with M33
539
   //#define LONG_FILENAME_HOST_SUPPORT
542
   //#define LONG_FILENAME_HOST_SUPPORT
540
 
543
 

+ 3
- 0
Marlin/example_configurations/RigidBot/Configuration_adv.h 查看文件

535
     //#define LCD_PROGRESS_BAR_TEST
535
     //#define LCD_PROGRESS_BAR_TEST
536
   #endif
536
   #endif
537
 
537
 
538
+  // Add an 'M73' G-code to set the current percentage
539
+  //#define LCD_SET_PROGRESS_MANUALLY
540
+
538
   // This allows hosts to request long names for files and folders with M33
541
   // This allows hosts to request long names for files and folders with M33
539
   //#define LONG_FILENAME_HOST_SUPPORT
542
   //#define LONG_FILENAME_HOST_SUPPORT
540
 
543
 

+ 3
- 0
Marlin/example_configurations/SCARA/Configuration_adv.h 查看文件

535
     //#define LCD_PROGRESS_BAR_TEST
535
     //#define LCD_PROGRESS_BAR_TEST
536
   #endif
536
   #endif
537
 
537
 
538
+  // Add an 'M73' G-code to set the current percentage
539
+  //#define LCD_SET_PROGRESS_MANUALLY
540
+
538
   // This allows hosts to request long names for files and folders with M33
541
   // This allows hosts to request long names for files and folders with M33
539
   //#define LONG_FILENAME_HOST_SUPPORT
542
   //#define LONG_FILENAME_HOST_SUPPORT
540
 
543
 

+ 3
- 0
Marlin/example_configurations/Sanguinololu/Configuration_adv.h 查看文件

524
     //#define LCD_PROGRESS_BAR_TEST
524
     //#define LCD_PROGRESS_BAR_TEST
525
   #endif
525
   #endif
526
 
526
 
527
+  // Add an 'M73' G-code to set the current percentage
528
+  //#define LCD_SET_PROGRESS_MANUALLY
529
+
527
   // This allows hosts to request long names for files and folders with M33
530
   // This allows hosts to request long names for files and folders with M33
528
   //#define LONG_FILENAME_HOST_SUPPORT
531
   //#define LONG_FILENAME_HOST_SUPPORT
529
 
532
 

+ 3
- 0
Marlin/example_configurations/TinyBoy2/Configuration_adv.h 查看文件

535
     //#define LCD_PROGRESS_BAR_TEST
535
     //#define LCD_PROGRESS_BAR_TEST
536
   #endif
536
   #endif
537
 
537
 
538
+  // Add an 'M73' G-code to set the current percentage
539
+  //#define LCD_SET_PROGRESS_MANUALLY
540
+
538
   // This allows hosts to request long names for files and folders with M33
541
   // This allows hosts to request long names for files and folders with M33
539
   //#define LONG_FILENAME_HOST_SUPPORT
542
   //#define LONG_FILENAME_HOST_SUPPORT
540
 
543
 

+ 3
- 0
Marlin/example_configurations/Velleman/K8400/Configuration_adv.h 查看文件

535
     //#define LCD_PROGRESS_BAR_TEST
535
     //#define LCD_PROGRESS_BAR_TEST
536
   #endif
536
   #endif
537
 
537
 
538
+  // Add an 'M73' G-code to set the current percentage
539
+  //#define LCD_SET_PROGRESS_MANUALLY
540
+
538
   // This allows hosts to request long names for files and folders with M33
541
   // This allows hosts to request long names for files and folders with M33
539
   //#define LONG_FILENAME_HOST_SUPPORT
542
   //#define LONG_FILENAME_HOST_SUPPORT
540
 
543
 

+ 3
- 0
Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration_adv.h 查看文件

537
     //#define LCD_PROGRESS_BAR_TEST
537
     //#define LCD_PROGRESS_BAR_TEST
538
   #endif
538
   #endif
539
 
539
 
540
+  // Add an 'M73' G-code to set the current percentage
541
+  //#define LCD_SET_PROGRESS_MANUALLY
542
+
540
   // This allows hosts to request long names for files and folders with M33
543
   // This allows hosts to request long names for files and folders with M33
541
   //#define LONG_FILENAME_HOST_SUPPORT
544
   //#define LONG_FILENAME_HOST_SUPPORT
542
 
545
 

+ 3
- 0
Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration_adv.h 查看文件

537
     //#define LCD_PROGRESS_BAR_TEST
537
     //#define LCD_PROGRESS_BAR_TEST
538
   #endif
538
   #endif
539
 
539
 
540
+  // Add an 'M73' G-code to set the current percentage
541
+  //#define LCD_SET_PROGRESS_MANUALLY
542
+
540
   // This allows hosts to request long names for files and folders with M33
543
   // This allows hosts to request long names for files and folders with M33
541
   //#define LONG_FILENAME_HOST_SUPPORT
544
   //#define LONG_FILENAME_HOST_SUPPORT
542
 
545
 

+ 3
- 0
Marlin/example_configurations/delta/generic/Configuration_adv.h 查看文件

537
     //#define LCD_PROGRESS_BAR_TEST
537
     //#define LCD_PROGRESS_BAR_TEST
538
   #endif
538
   #endif
539
 
539
 
540
+  // Add an 'M73' G-code to set the current percentage
541
+  //#define LCD_SET_PROGRESS_MANUALLY
542
+
540
   // This allows hosts to request long names for files and folders with M33
543
   // This allows hosts to request long names for files and folders with M33
541
   //#define LONG_FILENAME_HOST_SUPPORT
544
   //#define LONG_FILENAME_HOST_SUPPORT
542
 
545
 

+ 3
- 0
Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h 查看文件

537
     //#define LCD_PROGRESS_BAR_TEST
537
     //#define LCD_PROGRESS_BAR_TEST
538
   #endif
538
   #endif
539
 
539
 
540
+  // Add an 'M73' G-code to set the current percentage
541
+  //#define LCD_SET_PROGRESS_MANUALLY
542
+
540
   // This allows hosts to request long names for files and folders with M33
543
   // This allows hosts to request long names for files and folders with M33
541
   //#define LONG_FILENAME_HOST_SUPPORT
544
   //#define LONG_FILENAME_HOST_SUPPORT
542
 
545
 

+ 3
- 0
Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h 查看文件

542
     //#define LCD_PROGRESS_BAR_TEST
542
     //#define LCD_PROGRESS_BAR_TEST
543
   #endif
543
   #endif
544
 
544
 
545
+  // Add an 'M73' G-code to set the current percentage
546
+  //#define LCD_SET_PROGRESS_MANUALLY
547
+
545
   // This allows hosts to request long names for files and folders with M33
548
   // This allows hosts to request long names for files and folders with M33
546
   //#define LONG_FILENAME_HOST_SUPPORT
549
   //#define LONG_FILENAME_HOST_SUPPORT
547
 
550
 

+ 3
- 0
Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h 查看文件

537
     //#define LCD_PROGRESS_BAR_TEST
537
     //#define LCD_PROGRESS_BAR_TEST
538
   #endif
538
   #endif
539
 
539
 
540
+  // Add an 'M73' G-code to set the current percentage
541
+  //#define LCD_SET_PROGRESS_MANUALLY
542
+
540
   // This allows hosts to request long names for files and folders with M33
543
   // This allows hosts to request long names for files and folders with M33
541
   //#define LONG_FILENAME_HOST_SUPPORT
544
   //#define LONG_FILENAME_HOST_SUPPORT
542
 
545
 

+ 3
- 0
Marlin/example_configurations/gCreate/gMax1.5+/Configuration_adv.h 查看文件

535
     //#define LCD_PROGRESS_BAR_TEST
535
     //#define LCD_PROGRESS_BAR_TEST
536
   #endif
536
   #endif
537
 
537
 
538
+  // Add an 'M73' G-code to set the current percentage
539
+  //#define LCD_SET_PROGRESS_MANUALLY
540
+
538
   // This allows hosts to request long names for files and folders with M33
541
   // This allows hosts to request long names for files and folders with M33
539
   //#define LONG_FILENAME_HOST_SUPPORT
542
   //#define LONG_FILENAME_HOST_SUPPORT
540
 
543
 

+ 3
- 0
Marlin/example_configurations/makibox/Configuration_adv.h 查看文件

535
     //#define LCD_PROGRESS_BAR_TEST
535
     //#define LCD_PROGRESS_BAR_TEST
536
   #endif
536
   #endif
537
 
537
 
538
+  // Add an 'M73' G-code to set the current percentage
539
+  //#define LCD_SET_PROGRESS_MANUALLY
540
+
538
   // This allows hosts to request long names for files and folders with M33
541
   // This allows hosts to request long names for files and folders with M33
539
   //#define LONG_FILENAME_HOST_SUPPORT
542
   //#define LONG_FILENAME_HOST_SUPPORT
540
 
543
 

+ 3
- 0
Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h 查看文件

535
     //#define LCD_PROGRESS_BAR_TEST
535
     //#define LCD_PROGRESS_BAR_TEST
536
   #endif
536
   #endif
537
 
537
 
538
+  // Add an 'M73' G-code to set the current percentage
539
+  //#define LCD_SET_PROGRESS_MANUALLY
540
+
538
   // This allows hosts to request long names for files and folders with M33
541
   // This allows hosts to request long names for files and folders with M33
539
   //#define LONG_FILENAME_HOST_SUPPORT
542
   //#define LONG_FILENAME_HOST_SUPPORT
540
 
543
 

+ 3
- 0
Marlin/example_configurations/wt150/Configuration_adv.h 查看文件

535
     //#define LCD_PROGRESS_BAR_TEST
535
     //#define LCD_PROGRESS_BAR_TEST
536
   #endif
536
   #endif
537
 
537
 
538
+  // Add an 'M73' G-code to set the current percentage
539
+  //#define LCD_SET_PROGRESS_MANUALLY
540
+
538
   // This allows hosts to request long names for files and folders with M33
541
   // This allows hosts to request long names for files and folders with M33
539
   //#define LONG_FILENAME_HOST_SUPPORT
542
   //#define LONG_FILENAME_HOST_SUPPORT
540
 
543
 

+ 40
- 20
Marlin/ultralcd.cpp 查看文件

60
 // Initialized by settings.load()
60
 // Initialized by settings.load()
61
 int16_t lcd_preheat_hotend_temp[2], lcd_preheat_bed_temp[2], lcd_preheat_fan_speed[2];
61
 int16_t lcd_preheat_hotend_temp[2], lcd_preheat_bed_temp[2], lcd_preheat_fan_speed[2];
62
 
62
 
63
+#if ENABLED(LCD_SET_PROGRESS_MANUALLY) && (ENABLED(LCD_PROGRESS_BAR) || ENABLED(DOGLCD))
64
+  uint8_t progress_bar_percent;
65
+#endif
66
+
63
 #if ENABLED(FILAMENT_LCD_DISPLAY) && ENABLED(SDSUPPORT)
67
 #if ENABLED(FILAMENT_LCD_DISPLAY) && ENABLED(SDSUPPORT)
64
   millis_t previous_lcd_status_ms = 0;
68
   millis_t previous_lcd_status_ms = 0;
65
 #endif
69
 #endif
603
   #endif
607
   #endif
604
 
608
 
605
   #if ENABLED(LCD_PROGRESS_BAR)
609
   #if ENABLED(LCD_PROGRESS_BAR)
610
+
611
+    //
612
+    // HD44780 implements the following message blinking and
613
+    // message expiration because Status Line and Progress Bar
614
+    // share the same line on the display.
615
+    //
616
+
617
+    // Set current percentage from SD when actively printing
618
+    #if ENABLED(LCD_SET_PROGRESS_MANUALLY)
619
+      if (IS_SD_PRINTING)
620
+        progress_bar_percent = card.percentDone();
621
+    #endif
622
+
606
     millis_t ms = millis();
623
     millis_t ms = millis();
624
+
625
+    // If the message will blink rather than expire...
607
     #if DISABLED(PROGRESS_MSG_ONCE)
626
     #if DISABLED(PROGRESS_MSG_ONCE)
608
-      if (ELAPSED(ms, progress_bar_ms + PROGRESS_BAR_MSG_TIME + PROGRESS_BAR_BAR_TIME)) {
627
+      if (ELAPSED(ms, progress_bar_ms + PROGRESS_BAR_MSG_TIME + PROGRESS_BAR_BAR_TIME))
609
         progress_bar_ms = ms;
628
         progress_bar_ms = ms;
610
-      }
611
     #endif
629
     #endif
630
+
612
     #if PROGRESS_MSG_EXPIRE > 0
631
     #if PROGRESS_MSG_EXPIRE > 0
632
+
613
       // Handle message expire
633
       // Handle message expire
614
       if (expire_status_ms > 0) {
634
       if (expire_status_ms > 0) {
615
-        #if ENABLED(SDSUPPORT)
616
-          if (card.isFileOpen()) {
617
-            // Expire the message when printing is active
618
-            if (IS_SD_PRINTING) {
619
-              if (ELAPSED(ms, expire_status_ms)) {
620
-                lcd_status_message[0] = '\0';
621
-                expire_status_ms = 0;
622
-              }
623
-            }
624
-            else {
625
-              expire_status_ms += LCD_UPDATE_INTERVAL;
626
-            }
627
-          }
628
-          else {
635
+
636
+        #if DISABLED(LCD_SET_PROGRESS_MANUALLY)
637
+          const uint8_t progress_bar_percent = card.percentDone();
638
+        #endif
639
+
640
+        // Expire the message if a job is active and the bar has ticks
641
+        if (progress_bar_percent > 2 && !print_job_timer.isPaused()) {
642
+          if (ELAPSED(ms, expire_status_ms)) {
643
+            lcd_status_message[0] = '\0';
629
             expire_status_ms = 0;
644
             expire_status_ms = 0;
630
           }
645
           }
631
-        #else
632
-          expire_status_ms = 0;
633
-        #endif // SDSUPPORT
646
+        }
647
+        else {
648
+          // Defer message expiration before bar appears
649
+          // and during any pause (not just SD)
650
+          expire_status_ms += LCD_UPDATE_INTERVAL;
651
+        }
634
       }
652
       }
635
-    #endif
653
+
654
+    #endif // PROGRESS_MSG_EXPIRE
655
+
636
   #endif // LCD_PROGRESS_BAR
656
   #endif // LCD_PROGRESS_BAR
637
 
657
 
638
   #if ENABLED(ULTIPANEL)
658
   #if ENABLED(ULTIPANEL)

+ 4
- 0
Marlin/ultralcd.h 查看文件

168
     #define LCD_CLICKED false
168
     #define LCD_CLICKED false
169
   #endif
169
   #endif
170
 
170
 
171
+  #if ENABLED(LCD_SET_PROGRESS_MANUALLY) && (ENABLED(LCD_PROGRESS_BAR) || ENABLED(DOGLCD))
172
+    extern uint8_t progress_bar_percent;
173
+  #endif
174
+
171
 #else // no LCD
175
 #else // no LCD
172
 
176
 
173
   inline void lcd_update() {}
177
   inline void lcd_update() {}

+ 8
- 4
Marlin/ultralcd_impl_DOGM.h 查看文件

535
     // SD Card Symbol
535
     // SD Card Symbol
536
     //
536
     //
537
 
537
 
538
-    if (PAGE_CONTAINS(42 - (TALL_FONT_CORRECTION), 51 - (TALL_FONT_CORRECTION))) {
538
+    if (card.isFileOpen() && PAGE_CONTAINS(42 - (TALL_FONT_CORRECTION), 51 - (TALL_FONT_CORRECTION))) {
539
       // Upper box
539
       // Upper box
540
       u8g.drawBox(42, 42 - (TALL_FONT_CORRECTION), 8, 7);     // 42-48 (or 41-47)
540
       u8g.drawBox(42, 42 - (TALL_FONT_CORRECTION), 8, 7);     // 42-48 (or 41-47)
541
       // Right edge
541
       // Right edge
559
         PROGRESS_BAR_WIDTH, 4 - (TALL_FONT_CORRECTION)
559
         PROGRESS_BAR_WIDTH, 4 - (TALL_FONT_CORRECTION)
560
       );
560
       );
561
 
561
 
562
-    if (IS_SD_PRINTING) {
562
+    #if DISABLED(LCD_SET_PROGRESS_MANUALLY)
563
+      const uint8_t progress_bar_percent = card.percentDone();
564
+    #endif
565
+
566
+    if (progress_bar_percent > 1) {
563
 
567
 
564
       //
568
       //
565
       // Progress bar solid part
569
       // Progress bar solid part
568
       if (PAGE_CONTAINS(50, 51 - (TALL_FONT_CORRECTION)))     // 50-51 (or just 50)
572
       if (PAGE_CONTAINS(50, 51 - (TALL_FONT_CORRECTION)))     // 50-51 (or just 50)
569
         u8g.drawBox(
573
         u8g.drawBox(
570
           PROGRESS_BAR_X + 1, 50,
574
           PROGRESS_BAR_X + 1, 50,
571
-          (uint16_t)((PROGRESS_BAR_WIDTH - 2) * card.percentDone() * 0.01), 2 - (TALL_FONT_CORRECTION)
575
+          (uint16_t)((PROGRESS_BAR_WIDTH - 2) * progress_bar_percent * 0.01), 2 - (TALL_FONT_CORRECTION)
572
         );
576
         );
573
 
577
 
574
       //
578
       //
579
         if (PAGE_CONTAINS(41, 48)) {
583
         if (PAGE_CONTAINS(41, 48)) {
580
           // Percent complete
584
           // Percent complete
581
           u8g.setPrintPos(55, 48);
585
           u8g.setPrintPos(55, 48);
582
-          u8g.print(itostr3(card.percentDone()));
586
+          u8g.print(itostr3(progress_bar_percent));
583
           u8g.print('%');
587
           u8g.print('%');
584
         }
588
         }
585
       #endif
589
       #endif

+ 7
- 6
Marlin/ultralcd_impl_HD44780.h 查看文件

200
 #include "utf_mapper.h"
200
 #include "utf_mapper.h"
201
 
201
 
202
 #if ENABLED(LCD_PROGRESS_BAR)
202
 #if ENABLED(LCD_PROGRESS_BAR)
203
-  static millis_t progress_bar_ms = 0;
203
+  static millis_t progress_bar_ms = 0;     // Start millis of the current progress bar cycle
204
   #if PROGRESS_MSG_EXPIRE > 0
204
   #if PROGRESS_MSG_EXPIRE > 0
205
-    static millis_t expire_status_ms = 0;
205
+    static millis_t expire_status_ms = 0;  // millis at which to expire the status message
206
   #endif
206
   #endif
207
   #define LCD_STR_PROGRESS  "\x03\x04\x05"
207
   #define LCD_STR_PROGRESS  "\x03\x04\x05"
208
 #endif
208
 #endif
841
 
841
 
842
     // Draw the progress bar if the message has shown long enough
842
     // Draw the progress bar if the message has shown long enough
843
     // or if there is no message set.
843
     // or if there is no message set.
844
-    if (card.isFileOpen() && (ELAPSED(millis(), progress_bar_ms + PROGRESS_BAR_MSG_TIME) || !lcd_status_message[0])) {
845
-      const uint8_t percent = card.percentDone();
846
-      if (percent) return lcd_draw_progress_bar(percent);
847
-    }
844
+    #if DISABLED(LCD_SET_PROGRESS_MANUALLY)
845
+      const uint8_t progress_bar_percent = card.percentDone();
846
+    #endif
847
+    if (progress_bar_percent > 2 && (ELAPSED(millis(), progress_bar_ms + PROGRESS_BAR_MSG_TIME) || !lcd_status_message[0]))
848
+      return lcd_draw_progress_bar(progress_bar_percent);
848
 
849
 
849
   #elif ENABLED(FILAMENT_LCD_DISPLAY) && ENABLED(SDSUPPORT)
850
   #elif ENABLED(FILAMENT_LCD_DISPLAY) && ENABLED(SDSUPPORT)
850
 
851
 

Loading…
取消
儲存