Selaa lähdekoodia

Merge pull request #7987 from thinkyhead/bf2_progress_percentage

[2.0.x] Add M73 (LCD_SET_PROGRESS_MANUALLY)
Scott Lahteine 7 vuotta sitten
vanhempi
commit
a12ab611ae
36 muutettua tiedostoa jossa 207 lisäystä ja 31 poistoa
  1. 3
    0
      Marlin/Configuration_adv.h
  2. 3
    0
      Marlin/src/config/default/Configuration_adv.h
  3. 3
    0
      Marlin/src/config/examples/AlephObjects/TAZ4/Configuration_adv.h
  4. 3
    0
      Marlin/src/config/examples/Anet/A6/Configuration_adv.h
  5. 3
    0
      Marlin/src/config/examples/Anet/A8/Configuration_adv.h
  6. 3
    0
      Marlin/src/config/examples/BQ/Hephestos/Configuration_adv.h
  7. 3
    0
      Marlin/src/config/examples/BQ/WITBOX/Configuration_adv.h
  8. 3
    0
      Marlin/src/config/examples/Cartesio/Configuration_adv.h
  9. 3
    0
      Marlin/src/config/examples/Creality/CR-10/Configuration_adv.h
  10. 3
    0
      Marlin/src/config/examples/Felix/Configuration_adv.h
  11. 3
    0
      Marlin/src/config/examples/Folger Tech/i3-2020/Configuration_adv.h
  12. 3
    0
      Marlin/src/config/examples/Infitary/i3-M508/Configuration_adv.h
  13. 3
    0
      Marlin/src/config/examples/Mks/Sbase/Configuration_adv.h
  14. 3
    0
      Marlin/src/config/examples/RigidBot/Configuration_adv.h
  15. 3
    0
      Marlin/src/config/examples/SCARA/Configuration_adv.h
  16. 3
    0
      Marlin/src/config/examples/Sanguinololu/Configuration_adv.h
  17. 3
    0
      Marlin/src/config/examples/TinyBoy2/Configuration_adv.h
  18. 3
    0
      Marlin/src/config/examples/Velleman/K8400/Configuration_adv.h
  19. 3
    0
      Marlin/src/config/examples/delta/FLSUN/auto_calibrate/Configuration_adv.h
  20. 3
    0
      Marlin/src/config/examples/delta/FLSUN/kossel_mini/Configuration_adv.h
  21. 3
    0
      Marlin/src/config/examples/delta/generic/Configuration_adv.h
  22. 3
    0
      Marlin/src/config/examples/delta/kossel_mini/Configuration_adv.h
  23. 3
    0
      Marlin/src/config/examples/delta/kossel_pro/Configuration_adv.h
  24. 3
    0
      Marlin/src/config/examples/delta/kossel_xl/Configuration_adv.h
  25. 3
    0
      Marlin/src/config/examples/gCreate/gMax1.5+/Configuration_adv.h
  26. 3
    0
      Marlin/src/config/examples/makibox/Configuration_adv.h
  27. 3
    0
      Marlin/src/config/examples/tvrrug/Round2/Configuration_adv.h
  28. 3
    0
      Marlin/src/config/examples/wt150/Configuration_adv.h
  29. 4
    0
      Marlin/src/gcode/gcode.cpp
  30. 4
    0
      Marlin/src/gcode/gcode.h
  31. 7
    0
      Marlin/src/gcode/host/M115.cpp
  32. 48
    0
      Marlin/src/gcode/lcd/M73.cpp
  33. 41
    21
      Marlin/src/lcd/ultralcd.cpp
  34. 4
    0
      Marlin/src/lcd/ultralcd.h
  35. 8
    4
      Marlin/src/lcd/ultralcd_impl_DOGM.h
  36. 7
    6
      Marlin/src/lcd/ultralcd_impl_HD44780.h

+ 3
- 0
Marlin/Configuration_adv.h Näytä tiedosto

549
     //#define LCD_PROGRESS_BAR_TEST
549
     //#define LCD_PROGRESS_BAR_TEST
550
   #endif
550
   #endif
551
 
551
 
552
+  // Add an 'M73' G-code to set the current percentage
553
+  //#define LCD_SET_PROGRESS_MANUALLY
554
+
552
   // This allows hosts to request long names for files and folders with M33
555
   // This allows hosts to request long names for files and folders with M33
553
   //#define LONG_FILENAME_HOST_SUPPORT
556
   //#define LONG_FILENAME_HOST_SUPPORT
554
 
557
 

+ 3
- 0
Marlin/src/config/default/Configuration_adv.h Näytä tiedosto

549
     //#define LCD_PROGRESS_BAR_TEST
549
     //#define LCD_PROGRESS_BAR_TEST
550
   #endif
550
   #endif
551
 
551
 
552
+  // Add an 'M73' G-code to set the current percentage
553
+  //#define LCD_SET_PROGRESS_MANUALLY
554
+
552
   // This allows hosts to request long names for files and folders with M33
555
   // This allows hosts to request long names for files and folders with M33
553
   //#define LONG_FILENAME_HOST_SUPPORT
556
   //#define LONG_FILENAME_HOST_SUPPORT
554
 
557
 

+ 3
- 0
Marlin/src/config/examples/AlephObjects/TAZ4/Configuration_adv.h Näytä tiedosto

549
     //#define LCD_PROGRESS_BAR_TEST
549
     //#define LCD_PROGRESS_BAR_TEST
550
   #endif
550
   #endif
551
 
551
 
552
+  // Add an 'M73' G-code to set the current percentage
553
+  //#define LCD_SET_PROGRESS_MANUALLY
554
+
552
   // This allows hosts to request long names for files and folders with M33
555
   // This allows hosts to request long names for files and folders with M33
553
   //#define LONG_FILENAME_HOST_SUPPORT
556
   //#define LONG_FILENAME_HOST_SUPPORT
554
 
557
 

+ 3
- 0
Marlin/src/config/examples/Anet/A6/Configuration_adv.h Näytä tiedosto

549
     //#define LCD_PROGRESS_BAR_TEST
549
     //#define LCD_PROGRESS_BAR_TEST
550
   #endif
550
   #endif
551
 
551
 
552
+  // Add an 'M73' G-code to set the current percentage
553
+  //#define LCD_SET_PROGRESS_MANUALLY
554
+
552
   // This allows hosts to request long names for files and folders with M33
555
   // This allows hosts to request long names for files and folders with M33
553
   //#define LONG_FILENAME_HOST_SUPPORT
556
   //#define LONG_FILENAME_HOST_SUPPORT
554
 
557
 

+ 3
- 0
Marlin/src/config/examples/Anet/A8/Configuration_adv.h Näytä tiedosto

549
     //#define LCD_PROGRESS_BAR_TEST
549
     //#define LCD_PROGRESS_BAR_TEST
550
   #endif
550
   #endif
551
 
551
 
552
+  // Add an 'M73' G-code to set the current percentage
553
+  //#define LCD_SET_PROGRESS_MANUALLY
554
+
552
   // This allows hosts to request long names for files and folders with M33
555
   // This allows hosts to request long names for files and folders with M33
553
   //#define LONG_FILENAME_HOST_SUPPORT
556
   //#define LONG_FILENAME_HOST_SUPPORT
554
 
557
 

+ 3
- 0
Marlin/src/config/examples/BQ/Hephestos/Configuration_adv.h Näytä tiedosto

549
     //#define LCD_PROGRESS_BAR_TEST
549
     //#define LCD_PROGRESS_BAR_TEST
550
   #endif
550
   #endif
551
 
551
 
552
+  // Add an 'M73' G-code to set the current percentage
553
+  //#define LCD_SET_PROGRESS_MANUALLY
554
+
552
   // This allows hosts to request long names for files and folders with M33
555
   // This allows hosts to request long names for files and folders with M33
553
   //#define LONG_FILENAME_HOST_SUPPORT
556
   //#define LONG_FILENAME_HOST_SUPPORT
554
 
557
 

+ 3
- 0
Marlin/src/config/examples/BQ/WITBOX/Configuration_adv.h Näytä tiedosto

549
     //#define LCD_PROGRESS_BAR_TEST
549
     //#define LCD_PROGRESS_BAR_TEST
550
   #endif
550
   #endif
551
 
551
 
552
+  // Add an 'M73' G-code to set the current percentage
553
+  //#define LCD_SET_PROGRESS_MANUALLY
554
+
552
   // This allows hosts to request long names for files and folders with M33
555
   // This allows hosts to request long names for files and folders with M33
553
   //#define LONG_FILENAME_HOST_SUPPORT
556
   //#define LONG_FILENAME_HOST_SUPPORT
554
 
557
 

+ 3
- 0
Marlin/src/config/examples/Cartesio/Configuration_adv.h Näytä tiedosto

549
     //#define LCD_PROGRESS_BAR_TEST
549
     //#define LCD_PROGRESS_BAR_TEST
550
   #endif
550
   #endif
551
 
551
 
552
+  // Add an 'M73' G-code to set the current percentage
553
+  //#define LCD_SET_PROGRESS_MANUALLY
554
+
552
   // This allows hosts to request long names for files and folders with M33
555
   // This allows hosts to request long names for files and folders with M33
553
   //#define LONG_FILENAME_HOST_SUPPORT
556
   //#define LONG_FILENAME_HOST_SUPPORT
554
 
557
 

+ 3
- 0
Marlin/src/config/examples/Creality/CR-10/Configuration_adv.h Näytä tiedosto

549
     //#define LCD_PROGRESS_BAR_TEST
549
     //#define LCD_PROGRESS_BAR_TEST
550
   #endif
550
   #endif
551
 
551
 
552
+  // Add an 'M73' G-code to set the current percentage
553
+  //#define LCD_SET_PROGRESS_MANUALLY
554
+
552
   // This allows hosts to request long names for files and folders with M33
555
   // This allows hosts to request long names for files and folders with M33
553
   //#define LONG_FILENAME_HOST_SUPPORT
556
   //#define LONG_FILENAME_HOST_SUPPORT
554
 
557
 

+ 3
- 0
Marlin/src/config/examples/Felix/Configuration_adv.h Näytä tiedosto

549
     //#define LCD_PROGRESS_BAR_TEST
549
     //#define LCD_PROGRESS_BAR_TEST
550
   #endif
550
   #endif
551
 
551
 
552
+  // Add an 'M73' G-code to set the current percentage
553
+  //#define LCD_SET_PROGRESS_MANUALLY
554
+
552
   // This allows hosts to request long names for files and folders with M33
555
   // This allows hosts to request long names for files and folders with M33
553
   //#define LONG_FILENAME_HOST_SUPPORT
556
   //#define LONG_FILENAME_HOST_SUPPORT
554
 
557
 

+ 3
- 0
Marlin/src/config/examples/Folger Tech/i3-2020/Configuration_adv.h Näytä tiedosto

549
     //#define LCD_PROGRESS_BAR_TEST
549
     //#define LCD_PROGRESS_BAR_TEST
550
   #endif
550
   #endif
551
 
551
 
552
+  // Add an 'M73' G-code to set the current percentage
553
+  //#define LCD_SET_PROGRESS_MANUALLY
554
+
552
   // This allows hosts to request long names for files and folders with M33
555
   // This allows hosts to request long names for files and folders with M33
553
   //#define LONG_FILENAME_HOST_SUPPORT
556
   //#define LONG_FILENAME_HOST_SUPPORT
554
 
557
 

+ 3
- 0
Marlin/src/config/examples/Infitary/i3-M508/Configuration_adv.h Näytä tiedosto

549
     //#define LCD_PROGRESS_BAR_TEST
549
     //#define LCD_PROGRESS_BAR_TEST
550
   #endif
550
   #endif
551
 
551
 
552
+  // Add an 'M73' G-code to set the current percentage
553
+  //#define LCD_SET_PROGRESS_MANUALLY
554
+
552
   // This allows hosts to request long names for files and folders with M33
555
   // This allows hosts to request long names for files and folders with M33
553
   //#define LONG_FILENAME_HOST_SUPPORT
556
   //#define LONG_FILENAME_HOST_SUPPORT
554
 
557
 

+ 3
- 0
Marlin/src/config/examples/Mks/Sbase/Configuration_adv.h Näytä tiedosto

549
     //#define LCD_PROGRESS_BAR_TEST
549
     //#define LCD_PROGRESS_BAR_TEST
550
   #endif
550
   #endif
551
 
551
 
552
+  // Add an 'M73' G-code to set the current percentage
553
+  //#define LCD_SET_PROGRESS_MANUALLY
554
+
552
   // This allows hosts to request long names for files and folders with M33
555
   // This allows hosts to request long names for files and folders with M33
553
   //#define LONG_FILENAME_HOST_SUPPORT
556
   //#define LONG_FILENAME_HOST_SUPPORT
554
 
557
 

+ 3
- 0
Marlin/src/config/examples/RigidBot/Configuration_adv.h Näytä tiedosto

549
     //#define LCD_PROGRESS_BAR_TEST
549
     //#define LCD_PROGRESS_BAR_TEST
550
   #endif
550
   #endif
551
 
551
 
552
+  // Add an 'M73' G-code to set the current percentage
553
+  //#define LCD_SET_PROGRESS_MANUALLY
554
+
552
   // This allows hosts to request long names for files and folders with M33
555
   // This allows hosts to request long names for files and folders with M33
553
   //#define LONG_FILENAME_HOST_SUPPORT
556
   //#define LONG_FILENAME_HOST_SUPPORT
554
 
557
 

+ 3
- 0
Marlin/src/config/examples/SCARA/Configuration_adv.h Näytä tiedosto

549
     //#define LCD_PROGRESS_BAR_TEST
549
     //#define LCD_PROGRESS_BAR_TEST
550
   #endif
550
   #endif
551
 
551
 
552
+  // Add an 'M73' G-code to set the current percentage
553
+  //#define LCD_SET_PROGRESS_MANUALLY
554
+
552
   // This allows hosts to request long names for files and folders with M33
555
   // This allows hosts to request long names for files and folders with M33
553
   //#define LONG_FILENAME_HOST_SUPPORT
556
   //#define LONG_FILENAME_HOST_SUPPORT
554
 
557
 

+ 3
- 0
Marlin/src/config/examples/Sanguinololu/Configuration_adv.h Näytä tiedosto

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

+ 3
- 0
Marlin/src/config/examples/TinyBoy2/Configuration_adv.h Näytä tiedosto

549
     //#define LCD_PROGRESS_BAR_TEST
549
     //#define LCD_PROGRESS_BAR_TEST
550
   #endif
550
   #endif
551
 
551
 
552
+  // Add an 'M73' G-code to set the current percentage
553
+  //#define LCD_SET_PROGRESS_MANUALLY
554
+
552
   // This allows hosts to request long names for files and folders with M33
555
   // This allows hosts to request long names for files and folders with M33
553
   //#define LONG_FILENAME_HOST_SUPPORT
556
   //#define LONG_FILENAME_HOST_SUPPORT
554
 
557
 

+ 3
- 0
Marlin/src/config/examples/Velleman/K8400/Configuration_adv.h Näytä tiedosto

549
     //#define LCD_PROGRESS_BAR_TEST
549
     //#define LCD_PROGRESS_BAR_TEST
550
   #endif
550
   #endif
551
 
551
 
552
+  // Add an 'M73' G-code to set the current percentage
553
+  //#define LCD_SET_PROGRESS_MANUALLY
554
+
552
   // This allows hosts to request long names for files and folders with M33
555
   // This allows hosts to request long names for files and folders with M33
553
   //#define LONG_FILENAME_HOST_SUPPORT
556
   //#define LONG_FILENAME_HOST_SUPPORT
554
 
557
 

+ 3
- 0
Marlin/src/config/examples/delta/FLSUN/auto_calibrate/Configuration_adv.h Näytä tiedosto

551
     //#define LCD_PROGRESS_BAR_TEST
551
     //#define LCD_PROGRESS_BAR_TEST
552
   #endif
552
   #endif
553
 
553
 
554
+  // Add an 'M73' G-code to set the current percentage
555
+  //#define LCD_SET_PROGRESS_MANUALLY
556
+
554
   // This allows hosts to request long names for files and folders with M33
557
   // This allows hosts to request long names for files and folders with M33
555
   //#define LONG_FILENAME_HOST_SUPPORT
558
   //#define LONG_FILENAME_HOST_SUPPORT
556
 
559
 

+ 3
- 0
Marlin/src/config/examples/delta/FLSUN/kossel_mini/Configuration_adv.h Näytä tiedosto

551
     //#define LCD_PROGRESS_BAR_TEST
551
     //#define LCD_PROGRESS_BAR_TEST
552
   #endif
552
   #endif
553
 
553
 
554
+  // Add an 'M73' G-code to set the current percentage
555
+  //#define LCD_SET_PROGRESS_MANUALLY
556
+
554
   // This allows hosts to request long names for files and folders with M33
557
   // This allows hosts to request long names for files and folders with M33
555
   //#define LONG_FILENAME_HOST_SUPPORT
558
   //#define LONG_FILENAME_HOST_SUPPORT
556
 
559
 

+ 3
- 0
Marlin/src/config/examples/delta/generic/Configuration_adv.h Näytä tiedosto

551
     //#define LCD_PROGRESS_BAR_TEST
551
     //#define LCD_PROGRESS_BAR_TEST
552
   #endif
552
   #endif
553
 
553
 
554
+  // Add an 'M73' G-code to set the current percentage
555
+  //#define LCD_SET_PROGRESS_MANUALLY
556
+
554
   // This allows hosts to request long names for files and folders with M33
557
   // This allows hosts to request long names for files and folders with M33
555
   //#define LONG_FILENAME_HOST_SUPPORT
558
   //#define LONG_FILENAME_HOST_SUPPORT
556
 
559
 

+ 3
- 0
Marlin/src/config/examples/delta/kossel_mini/Configuration_adv.h Näytä tiedosto

551
     //#define LCD_PROGRESS_BAR_TEST
551
     //#define LCD_PROGRESS_BAR_TEST
552
   #endif
552
   #endif
553
 
553
 
554
+  // Add an 'M73' G-code to set the current percentage
555
+  //#define LCD_SET_PROGRESS_MANUALLY
556
+
554
   // This allows hosts to request long names for files and folders with M33
557
   // This allows hosts to request long names for files and folders with M33
555
   //#define LONG_FILENAME_HOST_SUPPORT
558
   //#define LONG_FILENAME_HOST_SUPPORT
556
 
559
 

+ 3
- 0
Marlin/src/config/examples/delta/kossel_pro/Configuration_adv.h Näytä tiedosto

556
     //#define LCD_PROGRESS_BAR_TEST
556
     //#define LCD_PROGRESS_BAR_TEST
557
   #endif
557
   #endif
558
 
558
 
559
+  // Add an 'M73' G-code to set the current percentage
560
+  //#define LCD_SET_PROGRESS_MANUALLY
561
+
559
   // This allows hosts to request long names for files and folders with M33
562
   // This allows hosts to request long names for files and folders with M33
560
   //#define LONG_FILENAME_HOST_SUPPORT
563
   //#define LONG_FILENAME_HOST_SUPPORT
561
 
564
 

+ 3
- 0
Marlin/src/config/examples/delta/kossel_xl/Configuration_adv.h Näytä tiedosto

551
     //#define LCD_PROGRESS_BAR_TEST
551
     //#define LCD_PROGRESS_BAR_TEST
552
   #endif
552
   #endif
553
 
553
 
554
+  // Add an 'M73' G-code to set the current percentage
555
+  //#define LCD_SET_PROGRESS_MANUALLY
556
+
554
   // This allows hosts to request long names for files and folders with M33
557
   // This allows hosts to request long names for files and folders with M33
555
   //#define LONG_FILENAME_HOST_SUPPORT
558
   //#define LONG_FILENAME_HOST_SUPPORT
556
 
559
 

+ 3
- 0
Marlin/src/config/examples/gCreate/gMax1.5+/Configuration_adv.h Näytä tiedosto

549
     //#define LCD_PROGRESS_BAR_TEST
549
     //#define LCD_PROGRESS_BAR_TEST
550
   #endif
550
   #endif
551
 
551
 
552
+  // Add an 'M73' G-code to set the current percentage
553
+  //#define LCD_SET_PROGRESS_MANUALLY
554
+
552
   // This allows hosts to request long names for files and folders with M33
555
   // This allows hosts to request long names for files and folders with M33
553
   //#define LONG_FILENAME_HOST_SUPPORT
556
   //#define LONG_FILENAME_HOST_SUPPORT
554
 
557
 

+ 3
- 0
Marlin/src/config/examples/makibox/Configuration_adv.h Näytä tiedosto

549
     //#define LCD_PROGRESS_BAR_TEST
549
     //#define LCD_PROGRESS_BAR_TEST
550
   #endif
550
   #endif
551
 
551
 
552
+  // Add an 'M73' G-code to set the current percentage
553
+  //#define LCD_SET_PROGRESS_MANUALLY
554
+
552
   // This allows hosts to request long names for files and folders with M33
555
   // This allows hosts to request long names for files and folders with M33
553
   //#define LONG_FILENAME_HOST_SUPPORT
556
   //#define LONG_FILENAME_HOST_SUPPORT
554
 
557
 

+ 3
- 0
Marlin/src/config/examples/tvrrug/Round2/Configuration_adv.h Näytä tiedosto

549
     //#define LCD_PROGRESS_BAR_TEST
549
     //#define LCD_PROGRESS_BAR_TEST
550
   #endif
550
   #endif
551
 
551
 
552
+  // Add an 'M73' G-code to set the current percentage
553
+  //#define LCD_SET_PROGRESS_MANUALLY
554
+
552
   // This allows hosts to request long names for files and folders with M33
555
   // This allows hosts to request long names for files and folders with M33
553
   //#define LONG_FILENAME_HOST_SUPPORT
556
   //#define LONG_FILENAME_HOST_SUPPORT
554
 
557
 

+ 3
- 0
Marlin/src/config/examples/wt150/Configuration_adv.h Näytä tiedosto

549
     //#define LCD_PROGRESS_BAR_TEST
549
     //#define LCD_PROGRESS_BAR_TEST
550
   #endif
550
   #endif
551
 
551
 
552
+  // Add an 'M73' G-code to set the current percentage
553
+  //#define LCD_SET_PROGRESS_MANUALLY
554
+
552
   // This allows hosts to request long names for files and folders with M33
555
   // This allows hosts to request long names for files and folders with M33
553
   //#define LONG_FILENAME_HOST_SUPPORT
556
   //#define LONG_FILENAME_HOST_SUPPORT
554
 
557
 

+ 4
- 0
Marlin/src/gcode/gcode.cpp Näytä tiedosto

354
         case 49: M49(); break;    // M49: Turn on or off G26 debug flag for verbose output
354
         case 49: M49(); break;    // M49: Turn on or off G26 debug flag for verbose output
355
       #endif
355
       #endif
356
 
356
 
357
+      #if ENABLED(ULTRA_LCD) && ENABLED(LCD_SET_PROGRESS_MANUALLY)
358
+        case 73: M73(); break;    // M73: Set progress percentage (for display on LCD)
359
+      #endif
360
+
357
       case 75: M75(); break;      // M75: Start print timer
361
       case 75: M75(); break;      // M75: Start print timer
358
       case 76: M76(); break;      // M76: Pause print timer
362
       case 76: M76(); break;      // M76: Pause print timer
359
       case 77: M77(); break;      // M77: Stop print timer
363
       case 77: M77(); break;      // M77: Stop print timer

+ 4
- 0
Marlin/src/gcode/gcode.h Näytä tiedosto

437
     static void M49();
437
     static void M49();
438
   #endif
438
   #endif
439
 
439
 
440
+  #if ENABLED(ULTRA_LCD) && ENABLED(LCD_SET_PROGRESS_MANUALLY)
441
+    static void M73();
442
+  #endif
443
+
440
   static void M75();
444
   static void M75();
441
   static void M76();
445
   static void M76();
442
   static void M77();
446
   static void M77();

+ 7
- 0
Marlin/src/gcode/host/M115.cpp Näytä tiedosto

72
       SERIAL_PROTOCOLLNPGM("Cap:LEVELING_DATA:0");
72
       SERIAL_PROTOCOLLNPGM("Cap:LEVELING_DATA:0");
73
     #endif
73
     #endif
74
 
74
 
75
+    // BUILD_PERCENT (M73)
76
+    #if ENABLED(LCD_SET_PROGRESS_MANUALLY)
77
+      SERIAL_PROTOCOLLNPGM("Cap:BUILD_PERCENT:1");
78
+    #else
79
+      SERIAL_PROTOCOLLNPGM("Cap:BUILD_PERCENT:0");
80
+    #endif
81
+
75
     // SOFTWARE_POWER (M80, M81)
82
     // SOFTWARE_POWER (M80, M81)
76
     #if HAS_POWER_SWITCH
83
     #if HAS_POWER_SWITCH
77
       SERIAL_PROTOCOLLNPGM("Cap:SOFTWARE_POWER:1");
84
       SERIAL_PROTOCOLLNPGM("Cap:SOFTWARE_POWER:1");

+ 48
- 0
Marlin/src/gcode/lcd/M73.cpp Näytä tiedosto

1
+/**
2
+ * Marlin 3D Printer Firmware
3
+ * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4
+ *
5
+ * Based on Sprinter and grbl.
6
+ * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
7
+ *
8
+ * This program is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
+ *
21
+ */
22
+
23
+#include "../../inc/MarlinConfig.h"
24
+
25
+#if ENABLED(ULTRA_LCD) && ENABLED(LCD_SET_PROGRESS_MANUALLY)
26
+
27
+#include "../gcode.h"
28
+#include "../../module/parser.h"
29
+#include "../../lcd/ultralcd.h"
30
+#include "../../sd/cardreader.h"
31
+
32
+/**
33
+ * M73: Set percentage complete (for display on LCD)
34
+ *
35
+ * Example:
36
+ *   M73 P25 ; Set progress to 25%
37
+ *
38
+ * Notes:
39
+ *   This has no effect during an SD print job
40
+ */
41
+void GcodeSuite::M73() {
42
+  if (!IS_SD_PRINTING && parser.seen('P')) {
43
+    progress_bar_percent = parser.value_byte();
44
+    NOMORE(progress_bar_percent, 100);
45
+  }
46
+}
47
+
48
+#endif // ULTRA_LCD && LCD_SET_PROGRESS_MANUALLY

+ 41
- 21
Marlin/src/lcd/ultralcd.cpp Näytä tiedosto

83
   uint8_t status_scroll_pos = 0;
83
   uint8_t status_scroll_pos = 0;
84
 #endif
84
 #endif
85
 
85
 
86
+#if ENABLED(LCD_SET_PROGRESS_MANUALLY)
87
+  uint8_t progress_bar_percent;
88
+#endif
89
+
86
 #if ENABLED(DOGLCD)
90
 #if ENABLED(DOGLCD)
87
   #include "ultralcd_impl_DOGM.h"
91
   #include "ultralcd_impl_DOGM.h"
88
   #include <U8glib.h>
92
   #include <U8glib.h>
604
   #endif
608
   #endif
605
 
609
 
606
   #if ENABLED(LCD_PROGRESS_BAR)
610
   #if ENABLED(LCD_PROGRESS_BAR)
611
+
612
+    //
613
+    // HD44780 implements the following message blinking and
614
+    // message expiration because Status Line and Progress Bar
615
+    // share the same line on the display.
616
+    //
617
+
618
+    // Set current percentage from SD when actively printing
619
+    #if ENABLED(LCD_SET_PROGRESS_MANUALLY)
620
+      if (IS_SD_PRINTING)
621
+        progress_bar_percent = card.percentDone();
622
+    #endif
623
+
607
     millis_t ms = millis();
624
     millis_t ms = millis();
625
+
626
+    // If the message will blink rather than expire...
608
     #if DISABLED(PROGRESS_MSG_ONCE)
627
     #if DISABLED(PROGRESS_MSG_ONCE)
609
-      if (ELAPSED(ms, progress_bar_ms + PROGRESS_BAR_MSG_TIME + PROGRESS_BAR_BAR_TIME)) {
628
+      if (ELAPSED(ms, progress_bar_ms + PROGRESS_BAR_MSG_TIME + PROGRESS_BAR_BAR_TIME))
610
         progress_bar_ms = ms;
629
         progress_bar_ms = ms;
611
-      }
612
     #endif
630
     #endif
631
+
613
     #if PROGRESS_MSG_EXPIRE > 0
632
     #if PROGRESS_MSG_EXPIRE > 0
633
+
614
       // Handle message expire
634
       // Handle message expire
615
       if (expire_status_ms > 0) {
635
       if (expire_status_ms > 0) {
616
-        #if ENABLED(SDSUPPORT)
617
-          if (card.isFileOpen()) {
618
-            // Expire the message when printing is active
619
-            if (IS_SD_PRINTING) {
620
-              if (ELAPSED(ms, expire_status_ms)) {
621
-                lcd_status_message[0] = '\0';
622
-                expire_status_ms = 0;
623
-              }
624
-            }
625
-            else {
626
-              expire_status_ms += LCD_UPDATE_INTERVAL;
627
-            }
628
-          }
629
-          else {
636
+
637
+        #if DISABLED(LCD_SET_PROGRESS_MANUALLY)
638
+          const uint8_t progress_bar_percent = card.percentDone();
639
+        #endif
640
+
641
+        // Expire the message if a job is active and the bar has ticks
642
+        if (progress_bar_percent > 2 && !print_job_timer.isPaused()) {
643
+          if (ELAPSED(ms, expire_status_ms)) {
644
+            lcd_status_message[0] = '\0';
630
             expire_status_ms = 0;
645
             expire_status_ms = 0;
631
           }
646
           }
632
-        #else
633
-          expire_status_ms = 0;
634
-        #endif // SDSUPPORT
647
+        }
648
+        else {
649
+          // Defer message expiration before bar appears
650
+          // and during any pause (not just SD)
651
+          expire_status_ms += LCD_UPDATE_INTERVAL;
652
+        }
635
       }
653
       }
636
-    #endif
654
+
655
+    #endif // PROGRESS_MSG_EXPIRE
656
+
637
   #endif // LCD_PROGRESS_BAR
657
   #endif // LCD_PROGRESS_BAR
638
 
658
 
639
   #if ENABLED(ULTIPANEL)
659
   #if ENABLED(ULTIPANEL)
2860
             #if ENABLED(MAX_SOFTWARE_ENDSTOP_Z)
2880
             #if ENABLED(MAX_SOFTWARE_ENDSTOP_Z)
2861
               max = soft_endstop_max[Z_AXIS];
2881
               max = soft_endstop_max[Z_AXIS];
2862
             #endif
2882
             #endif
2863
-            break;
2883
+          default: break;
2864
         }
2884
         }
2865
       #endif // MIN_SOFTWARE_ENDSTOPS || MAX_SOFTWARE_ENDSTOPS
2885
       #endif // MIN_SOFTWARE_ENDSTOPS || MAX_SOFTWARE_ENDSTOPS
2866
 
2886
 

+ 4
- 0
Marlin/src/lcd/ultralcd.h Näytä tiedosto

63
     void dontExpireStatus();
63
     void dontExpireStatus();
64
   #endif
64
   #endif
65
 
65
 
66
+  #if ENABLED(LCD_SET_PROGRESS_MANUALLY)
67
+    extern uint8_t progress_bar_percent;
68
+  #endif
69
+
66
   #if ENABLED(ADC_KEYPAD)
70
   #if ENABLED(ADC_KEYPAD)
67
     uint8_t get_ADC_keyValue();
71
     uint8_t get_ADC_keyValue();
68
   #endif
72
   #endif

+ 8
- 4
Marlin/src/lcd/ultralcd_impl_DOGM.h Näytä tiedosto

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

+ 7
- 6
Marlin/src/lcd/ultralcd_impl_HD44780.h Näytä tiedosto

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

Loading…
Peruuta
Tallenna