Browse Source

Fix FILAMENT_LCD_DISPLAY, disabled state, optimize

Scott Lahteine 7 years ago
parent
commit
eb3bdb7550
2 changed files with 17 additions and 7 deletions
  1. 11
    5
      Marlin/ultralcd_impl_DOGM.h
  2. 6
    2
      Marlin/ultralcd_impl_HD44780.h

+ 11
- 5
Marlin/ultralcd_impl_DOGM.h View File

@@ -648,9 +648,15 @@ static void lcd_implementation_status_screen() {
648 648
     strcpy(xstring, ftostr4sign(LOGICAL_X_POSITION(current_position[X_AXIS])));
649 649
     strcpy(ystring, ftostr4sign(LOGICAL_Y_POSITION(current_position[Y_AXIS])));
650 650
     strcpy(zstring, ftostr52sp(FIXFLOAT(LOGICAL_Z_POSITION(current_position[Z_AXIS]))));
651
-    #if ENABLED(FILAMENT_LCD_DISPLAY) && DISABLED(SDSUPPORT)
651
+    #if ENABLED(FILAMENT_LCD_DISPLAY)
652 652
       strcpy(wstring, ftostr12ns(filament_width_meas));
653
-      strcpy(mstring, itostr3(100.0 * planner.volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM]));
653
+      if (parser.volumetric_enabled)
654
+        strcpy(mstring, itostr3(100.0 * filament_width_meas / filament_width_nominal));
655
+      else
656
+        strcpy_P(mstring, PSTR("---"));
657
+      // Alternatively, show the ratio between cross-sectional areas:
658
+      //strcpy(mstring, itostr3(100.0 / CIRCLE_AREA(filament_width_nominal * 0.5)
659
+      //                              / planner.volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM]));
654 660
     #endif
655 661
   }
656 662
 
@@ -706,7 +712,7 @@ static void lcd_implementation_status_screen() {
706 712
     //
707 713
     // Filament sensor display if SD is disabled
708 714
     //
709
-    #if DISABLED(SDSUPPORT) && ENABLED(FILAMENT_LCD_DISPLAY)
715
+    #if ENABLED(FILAMENT_LCD_DISPLAY) && DISABLED(SDSUPPORT)
710 716
       u8g.setPrintPos(56, 50);
711 717
       lcd_print(wstring);
712 718
       u8g.setPrintPos(102, 50);
@@ -736,10 +742,10 @@ static void lcd_implementation_status_screen() {
736 742
       else {
737 743
         lcd_printPGM(PSTR(LCD_STR_FILAM_DIA));
738 744
         u8g.print(':');
739
-        lcd_print(ftostr12ns(filament_width_meas));
745
+        lcd_print(wstring);
740 746
         lcd_printPGM(PSTR("  " LCD_STR_FILAM_MUL));
741 747
         u8g.print(':');
742
-        lcd_print(itostr3(100.0 * planner.volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM]));
748
+        lcd_print(mstring);
743 749
         u8g.print('%');
744 750
       }
745 751
     #else

+ 6
- 2
Marlin/ultralcd_impl_HD44780.h View File

@@ -857,8 +857,12 @@ static void lcd_implementation_status_screen() {
857 857
       lcd_printPGM(PSTR("Dia "));
858 858
       lcd.print(ftostr12ns(filament_width_meas));
859 859
       lcd_printPGM(PSTR(" V"));
860
-      lcd.print(itostr3(100.0 * planner.volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM]));
861
-      lcd.write('%');
860
+      if (parser.volumetric_enabled) {
861
+        lcd.print(itostr3(100.0 * filament_width_meas / filament_width_nominal));
862
+        lcd.write('%');
863
+      }
864
+      else
865
+        lcd_printPGM(PSTR("--- "));
862 866
       return;
863 867
     }
864 868
 

Loading…
Cancel
Save