Browse Source

optional cutter/laser status in HD44780 status screen.

Thomas Buck 1 year ago
parent
commit
58dbdff1d5
1 changed files with 60 additions and 0 deletions
  1. 60
    0
      Marlin/src/lcd/HD44780/marlinui_HD44780.cpp

+ 60
- 0
Marlin/src/lcd/HD44780/marlinui_HD44780.cpp View File

58
   #include "../../feature/bedlevel/bedlevel.h"
58
   #include "../../feature/bedlevel/bedlevel.h"
59
 #endif
59
 #endif
60
 
60
 
61
+#if HAS_CUTTER
62
+  #include "../../feature/spindle_laser.h"
63
+#endif
64
+
61
 //
65
 //
62
 // Create LCD instance and chipset-specific information
66
 // Create LCD instance and chipset-specific information
63
 //
67
 //
616
   _draw_heater_status(H_BED, TERN0(HAS_LEVELING, blink && planner.leveling_active) ? '_' : LCD_STR_BEDTEMP[0], blink);
620
   _draw_heater_status(H_BED, TERN0(HAS_LEVELING, blink && planner.leveling_active) ? '_' : LCD_STR_BEDTEMP[0], blink);
617
 }
621
 }
618
 
622
 
623
+#ifdef HAS_CUTTER
624
+  FORCE_INLINE void _draw_cutter_status() {
625
+    #if ENABLED(LASER_FEATURE)
626
+      lcd_put_u8str("Laser:");
627
+    #else
628
+      lcd_put_u8str("Cutter:");
629
+    #endif
630
+
631
+    lcd_put_u8str(" ");
632
+
633
+    #if CUTTER_UNIT_IS(PERCENT)
634
+      lcd_put_u8str(cutter_power2str(cutter.unitPower));
635
+      lcd_put_lchar('%');
636
+    #elif CUTTER_UNIT_IS(RPM)
637
+      lcd_put_u8str(ftostr61rj(float(cutter.unitPower) / 1000));
638
+      lcd_put_lchar('K');
639
+    #else
640
+      lcd_put_u8str(cutter_power2str(cutter.unitPower));
641
+    #endif
642
+
643
+    lcd_put_u8str(" ");
644
+
645
+    if (cutter.enabled()) {
646
+      lcd_put_u8str("On");
647
+    } else {
648
+      lcd_put_u8str("Off");
649
+    }
650
+
651
+    lcd_put_u8str(" ");
652
+
653
+    switch (cutter.cutter_mode) {
654
+      case CUTTER_MODE_STANDARD:
655
+        lcd_put_u8str("S");
656
+        break;
657
+
658
+      case CUTTER_MODE_CONTINUOUS:
659
+        lcd_put_u8str("C");
660
+        break;
661
+
662
+      case CUTTER_MODE_DYNAMIC:
663
+        lcd_put_u8str("D");
664
+        break;
665
+
666
+      case CUTTER_MODE_ERROR:
667
+        lcd_put_u8str("!");
668
+        break;
669
+    }
670
+  }
671
+#endif
672
+
619
 #if ENABLED(LCD_PROGRESS_BAR)
673
 #if ENABLED(LCD_PROGRESS_BAR)
620
 
674
 
621
   void MarlinUI::draw_progress_bar(const uint8_t percent) {
675
   void MarlinUI::draw_progress_bar(const uint8_t percent) {
832
           lcd_moveto(8, 0);
886
           lcd_moveto(8, 0);
833
           _draw_bed_status(blink);
887
           _draw_bed_status(blink);
834
         #endif
888
         #endif
889
+      #elif HAS_CUTTER
890
+        lcd_moveto(0, 0);
891
+        _draw_cutter_status();
835
       #endif
892
       #endif
836
 
893
 
837
     #else // LCD_WIDTH >= 20
894
     #else // LCD_WIDTH >= 20
852
           lcd_moveto(10, 0);
909
           lcd_moveto(10, 0);
853
           _draw_bed_status(blink);
910
           _draw_bed_status(blink);
854
         #endif
911
         #endif
912
+      #elif HAS_CUTTER
913
+        lcd_moveto(0, 0);
914
+        _draw_cutter_status();
855
       #endif
915
       #endif
856
 
916
 
857
       TERN_(HAS_COOLER, _draw_cooler_status('*', blink));
917
       TERN_(HAS_COOLER, _draw_cooler_status('*', blink));

Loading…
Cancel
Save