Browse Source

Fix FILAMENT_LCD_DISPLAY for disabled state

Scott Lahteine 7 years ago
parent
commit
b2dda096fe

+ 11
- 5
Marlin/src/lcd/ultralcd_impl_DOGM.h View File

@@ -654,9 +654,15 @@ static void lcd_implementation_status_screen() {
654 654
     strcpy(xstring, ftostr4sign(LOGICAL_X_POSITION(current_position[X_AXIS])));
655 655
     strcpy(ystring, ftostr4sign(LOGICAL_Y_POSITION(current_position[Y_AXIS])));
656 656
     strcpy(zstring, ftostr52sp(FIXFLOAT(LOGICAL_Z_POSITION(current_position[Z_AXIS]))));
657
-    #if ENABLED(FILAMENT_LCD_DISPLAY) && DISABLED(SDSUPPORT)
657
+    #if ENABLED(FILAMENT_LCD_DISPLAY)
658 658
       strcpy(wstring, ftostr12ns(filament_width_meas));
659
-      strcpy(mstring, itostr3(100.0 * planner.volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM]));
659
+      if (parser.volumetric_enabled)
660
+        strcpy(mstring, itostr3(100.0 * filament_width_meas / filament_width_nominal));
661
+      else
662
+        strcpy_P(mstring, PSTR("---"));
663
+      // Alternatively, show the ratio between cross-sectional areas:
664
+      //strcpy(mstring, itostr3(100.0 / CIRCLE_AREA(filament_width_nominal * 0.5)
665
+      //                              / planner.volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM]));
660 666
     #endif
661 667
   }
662 668
 
@@ -712,7 +718,7 @@ static void lcd_implementation_status_screen() {
712 718
     //
713 719
     // Filament sensor display if SD is disabled
714 720
     //
715
-    #if DISABLED(SDSUPPORT) && ENABLED(FILAMENT_LCD_DISPLAY)
721
+    #if ENABLED(FILAMENT_LCD_DISPLAY) && DISABLED(SDSUPPORT)
716 722
       u8g.setPrintPos(56, 50);
717 723
       lcd_print(wstring);
718 724
       u8g.setPrintPos(102, 50);
@@ -742,10 +748,10 @@ static void lcd_implementation_status_screen() {
742 748
       else {
743 749
         lcd_printPGM(PSTR(LCD_STR_FILAM_DIA));
744 750
         u8g.print(':');
745
-        lcd_print(ftostr12ns(filament_width_meas));
751
+        lcd_print(wstring);
746 752
         lcd_printPGM(PSTR("  " LCD_STR_FILAM_MUL));
747 753
         u8g.print(':');
748
-        lcd_print(itostr3(100.0 * planner.volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM]));
754
+        lcd_print(mstring);
749 755
         u8g.print('%');
750 756
       }
751 757
     #else

+ 6
- 2
Marlin/src/lcd/ultralcd_impl_HD44780.h View File

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

+ 1
- 2
Marlin/src/module/temperature.cpp View File

@@ -1002,13 +1002,12 @@ void Temperature::updateTemperaturesFromRawValues() {
1002 1002
   // Convert raw Filament Width to millimeters
1003 1003
   float Temperature::analog2widthFil() {
1004 1004
     return current_raw_filwidth * 5.0 * (1.0 / 16383.0);
1005
-    //return current_raw_filwidth;
1006 1005
   }
1007 1006
 
1008 1007
   // Convert raw Filament Width to a ratio
1009 1008
   int Temperature::widthFil_to_size_ratio() {
1010 1009
     float temp = filament_width_meas;
1011
-    if (temp < MEASURED_LOWER_LIMIT) temp = filament_width_nominal;  //assume sensor cut out
1010
+    if (temp < MEASURED_LOWER_LIMIT) temp = filament_width_nominal;  // Assume a bad sensor reading
1012 1011
     else NOMORE(temp, MEASURED_UPPER_LIMIT);
1013 1012
     return filament_width_nominal / temp * 100;
1014 1013
   }

Loading…
Cancel
Save