Просмотр исходного кода

optional cutter/laser status in HD44780 status screen.

Thomas Buck 1 год назад
Родитель
Сommit
58dbdff1d5
1 измененных файлов: 60 добавлений и 0 удалений
  1. 60
    0
      Marlin/src/lcd/HD44780/marlinui_HD44780.cpp

+ 60
- 0
Marlin/src/lcd/HD44780/marlinui_HD44780.cpp Просмотреть файл

@@ -58,6 +58,10 @@
58 58
   #include "../../feature/bedlevel/bedlevel.h"
59 59
 #endif
60 60
 
61
+#if HAS_CUTTER
62
+  #include "../../feature/spindle_laser.h"
63
+#endif
64
+
61 65
 //
62 66
 // Create LCD instance and chipset-specific information
63 67
 //
@@ -616,6 +620,56 @@ FORCE_INLINE void _draw_bed_status(const bool blink) {
616 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 673
 #if ENABLED(LCD_PROGRESS_BAR)
620 674
 
621 675
   void MarlinUI::draw_progress_bar(const uint8_t percent) {
@@ -832,6 +886,9 @@ void MarlinUI::draw_status_screen() {
832 886
           lcd_moveto(8, 0);
833 887
           _draw_bed_status(blink);
834 888
         #endif
889
+      #elif HAS_CUTTER
890
+        lcd_moveto(0, 0);
891
+        _draw_cutter_status();
835 892
       #endif
836 893
 
837 894
     #else // LCD_WIDTH >= 20
@@ -852,6 +909,9 @@ void MarlinUI::draw_status_screen() {
852 909
           lcd_moveto(10, 0);
853 910
           _draw_bed_status(blink);
854 911
         #endif
912
+      #elif HAS_CUTTER
913
+        lcd_moveto(0, 0);
914
+        _draw_cutter_status();
855 915
       #endif
856 916
 
857 917
       TERN_(HAS_COOLER, _draw_cooler_status('*', blink));

Загрузка…
Отмена
Сохранить