Browse Source

Show filament width sensor values in LCD constantly if SD card support is not enabled.

Remo Kallio 8 years ago
parent
commit
d38b1bc4b1

+ 4
- 0
Marlin/Conditionals_LCD.h View File

224
     #define LCD_STR_SPECIAL_MAX '\x09'
224
     #define LCD_STR_SPECIAL_MAX '\x09'
225
     // Maximum here is 0x1f because 0x20 is ' ' (space) and the normal charsets begin.
225
     // Maximum here is 0x1f because 0x20 is ' ' (space) and the normal charsets begin.
226
     // Better stay below 0x10 because DISPLAY_CHARSET_HD44780_WESTERN begins here.
226
     // Better stay below 0x10 because DISPLAY_CHARSET_HD44780_WESTERN begins here.
227
+
228
+    // Symbol characters
229
+    #define LCD_STR_FILAM_DIA   "\xf8"
230
+    #define LCD_STR_FILAM_MUL   "\xa4"
227
   #else
231
   #else
228
     /* Custom characters defined in the first 8 characters of the LCD */
232
     /* Custom characters defined in the first 8 characters of the LCD */
229
     #define LCD_STR_BEDTEMP     "\x00"  // Print only as a char. This will have 'unexpected' results when used in a string!
233
     #define LCD_STR_BEDTEMP     "\x00"  // Print only as a char. This will have 'unexpected' results when used in a string!

+ 3
- 3
Marlin/ultralcd.cpp View File

47
 
47
 
48
 int lcd_preheat_hotend_temp[2], lcd_preheat_bed_temp[2], lcd_preheat_fan_speed[2];
48
 int lcd_preheat_hotend_temp[2], lcd_preheat_bed_temp[2], lcd_preheat_fan_speed[2];
49
 
49
 
50
-#if ENABLED(FILAMENT_LCD_DISPLAY)
50
+#if ENABLED(FILAMENT_LCD_DISPLAY) && ENABLED(SDSUPPORT)
51
   millis_t previous_lcd_status_ms = 0;
51
   millis_t previous_lcd_status_ms = 0;
52
 #endif
52
 #endif
53
 
53
 
547
   #if ENABLED(ULTIPANEL)
547
   #if ENABLED(ULTIPANEL)
548
 
548
 
549
     if (lcd_clicked) {
549
     if (lcd_clicked) {
550
-      #if ENABLED(FILAMENT_LCD_DISPLAY)
550
+      #if ENABLED(FILAMENT_LCD_DISPLAY) && ENABLED(SDSUPPORT)
551
         previous_lcd_status_ms = millis();  // get status message to show up for a while
551
         previous_lcd_status_ms = millis();  // get status message to show up for a while
552
       #endif
552
       #endif
553
       lcd_implementation_init( // to maybe revive the LCD if static electricity killed it.
553
       lcd_implementation_init( // to maybe revive the LCD if static electricity killed it.
3456
   #endif
3456
   #endif
3457
   lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW;
3457
   lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW;
3458
 
3458
 
3459
-  #if ENABLED(FILAMENT_LCD_DISPLAY)
3459
+  #if ENABLED(FILAMENT_LCD_DISPLAY) && ENABLED(SDSUPPORT)
3460
     previous_lcd_status_ms = millis();  //get status message to show up for a while
3460
     previous_lcd_status_ms = millis();  //get status message to show up for a while
3461
   #endif
3461
   #endif
3462
 }
3462
 }

+ 1
- 1
Marlin/ultralcd.h View File

93
 
93
 
94
   #endif
94
   #endif
95
 
95
 
96
-  #if ENABLED(FILAMENT_LCD_DISPLAY)
96
+  #if ENABLED(FILAMENT_LCD_DISPLAY) && ENABLED(SDSUPPORT)
97
     extern millis_t previous_lcd_status_ms;
97
     extern millis_t previous_lcd_status_ms;
98
   #endif
98
   #endif
99
 
99
 

+ 30
- 5
Marlin/ultralcd_impl_DOGM.h View File

535
   // When everything is ok you see a constant 'X'.
535
   // When everything is ok you see a constant 'X'.
536
 
536
 
537
   static char xstring[5], ystring[5], zstring[7];
537
   static char xstring[5], ystring[5], zstring[7];
538
+  #if ENABLED(FILAMENT_LCD_DISPLAY) && DISABLED(SDSUPPORT)
539
+    static char wstring[5], mstring[4];
540
+  #endif
538
 
541
 
539
   // At the first page, regenerate the XYZ strings
542
   // At the first page, regenerate the XYZ strings
540
   if (page.page == 0) {
543
   if (page.page == 0) {
541
     strcpy(xstring, ftostr4sign(current_position[X_AXIS]));
544
     strcpy(xstring, ftostr4sign(current_position[X_AXIS]));
542
     strcpy(ystring, ftostr4sign(current_position[Y_AXIS]));
545
     strcpy(ystring, ftostr4sign(current_position[Y_AXIS]));
543
     strcpy(zstring, ftostr52sp(current_position[Z_AXIS] + 0.00001));
546
     strcpy(zstring, ftostr52sp(current_position[Z_AXIS] + 0.00001));
547
+    #if ENABLED(FILAMENT_LCD_DISPLAY) && DISABLED(SDSUPPORT)
548
+      strcpy(wstring, ftostr12ns(filament_width_meas));
549
+      strcpy(mstring, itostr3(100.0 * volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM]));
550
+    #endif
544
   }
551
   }
545
 
552
 
546
   if (PAGE_CONTAINS(XYZ_FRAME_TOP, XYZ_FRAME_TOP + XYZ_FRAME_HEIGHT - 1)) {
553
   if (PAGE_CONTAINS(XYZ_FRAME_TOP, XYZ_FRAME_TOP + XYZ_FRAME_HEIGHT - 1)) {
591
     u8g.setPrintPos(12, 50);
598
     u8g.setPrintPos(12, 50);
592
     lcd_print(itostr3(feedrate_percentage));
599
     lcd_print(itostr3(feedrate_percentage));
593
     u8g.print('%');
600
     u8g.print('%');
601
+
602
+    //
603
+    // Filament sensor display if SD is disabled
604
+    //
605
+    #if DISABLED(SDSUPPORT) && ENABLED(FILAMENT_LCD_DISPLAY)
606
+      u8g.setPrintPos(56, 50);
607
+      lcd_print(wstring);
608
+      u8g.setPrintPos(102, 50);
609
+      lcd_print(mstring);
610
+      u8g.print('%');
611
+      lcd_setFont(FONT_MENU);
612
+      u8g.setPrintPos(47, 50);
613
+      lcd_print(LCD_STR_FILAM_DIA);
614
+      u8g.setPrintPos(93, 50);
615
+      lcd_print(LCD_STR_FILAM_MUL);
616
+    #endif
594
   }
617
   }
595
 
618
 
596
   //
619
   //
602
   if (PAGE_CONTAINS(STATUS_BASELINE + 1 - INFO_FONT_HEIGHT, STATUS_BASELINE)) {
625
   if (PAGE_CONTAINS(STATUS_BASELINE + 1 - INFO_FONT_HEIGHT, STATUS_BASELINE)) {
603
     u8g.setPrintPos(0, STATUS_BASELINE);
626
     u8g.setPrintPos(0, STATUS_BASELINE);
604
 
627
 
605
-    #if DISABLED(FILAMENT_LCD_DISPLAY)
606
-      lcd_print(lcd_status_message);
607
-    #else
628
+    #if ENABLED(FILAMENT_LCD_DISPLAY) && ENABLED(SDSUPPORT)
608
       if (PENDING(millis(), previous_lcd_status_ms + 5000UL)) {  //Display both Status message line and Filament display on the last line
629
       if (PENDING(millis(), previous_lcd_status_ms + 5000UL)) {  //Display both Status message line and Filament display on the last line
609
         lcd_print(lcd_status_message);
630
         lcd_print(lcd_status_message);
610
       }
631
       }
611
       else {
632
       else {
612
-        lcd_printPGM(PSTR("dia:"));
633
+        lcd_printPGM(PSTR(LCD_STR_FILAM_DIA));
634
+        u8g.print(':');
613
         lcd_print(ftostr12ns(filament_width_meas));
635
         lcd_print(ftostr12ns(filament_width_meas));
614
-        lcd_printPGM(PSTR(" factor:"));
636
+        lcd_printPGM(PSTR("  " LCD_STR_FILAM_MUL));
637
+        u8g.print(':');
615
         lcd_print(itostr3(100.0 * volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM]));
638
         lcd_print(itostr3(100.0 * volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM]));
616
         u8g.print('%');
639
         u8g.print('%');
617
       }
640
       }
641
+    #else
642
+      lcd_print(lcd_status_message);
618
     #endif
643
     #endif
619
   }
644
   }
620
 }
645
 }

+ 7
- 9
Marlin/ultralcd_impl_HD44780.h View File

396
   void lcd_erase_line(const int line) {
396
   void lcd_erase_line(const int line) {
397
     lcd.setCursor(0, line);
397
     lcd.setCursor(0, line);
398
     for (uint8_t i = LCD_WIDTH + 1; --i;)
398
     for (uint8_t i = LCD_WIDTH + 1; --i;)
399
-      lcd_print(' ');
399
+      lcd.print(' ');
400
   }
400
   }
401
 
401
 
402
   // Scroll the PSTR 'text' in a 'len' wide field for 'time' milliseconds at position col,line
402
   // Scroll the PSTR 'text' in a 'len' wide field for 'time' milliseconds at position col,line
775
 
775
 
776
   #if ENABLED(LCD_PROGRESS_BAR)
776
   #if ENABLED(LCD_PROGRESS_BAR)
777
 
777
 
778
-    if (card.isFileOpen()) {
779
-      // Draw the progress bar if the message has shown long enough
780
-      // or if there is no message set.
781
-      if (ELAPSED(millis(), progress_bar_ms + PROGRESS_BAR_MSG_TIME) || !lcd_status_message[0])
782
-        return lcd_draw_progress_bar(card.percentDone());
783
-    } //card.isFileOpen
778
+    // Draw the progress bar if the message has shown long enough
779
+    // or if there is no message set.
780
+    if (card.isFileOpen() && ELAPSED(millis(), progress_bar_ms + PROGRESS_BAR_MSG_TIME) || !lcd_status_message[0])
781
+      return lcd_draw_progress_bar(card.percentDone());
784
 
782
 
785
-  #elif ENABLED(FILAMENT_LCD_DISPLAY)
783
+  #elif ENABLED(FILAMENT_LCD_DISPLAY) && ENABLED(SDSUPPORT)
786
 
784
 
787
     // Show Filament Diameter and Volumetric Multiplier %
785
     // Show Filament Diameter and Volumetric Multiplier %
788
     // After allowing lcd_status_message to show for 5 seconds
786
     // After allowing lcd_status_message to show for 5 seconds
795
       return;
793
       return;
796
     }
794
     }
797
 
795
 
798
-  #endif // FILAMENT_LCD_DISPLAY
796
+  #endif // FILAMENT_LCD_DISPLAY && SDSUPPORT
799
 
797
 
800
   lcd_print(lcd_status_message);
798
   lcd_print(lcd_status_message);
801
 }
799
 }

Loading…
Cancel
Save