Cleanup formatting in hitachi & dogm lcd

2.0.x
Scott Lahteine 10 years ago
parent 7431ef7e2d
commit 756bb5e268

@ -37,8 +37,8 @@
// save 3120 bytes of PROGMEM by commenting out #define USE_BIG_EDIT_FONT // save 3120 bytes of PROGMEM by commenting out #define USE_BIG_EDIT_FONT
// we don't have a big font for Cyrillic, Kana // we don't have a big font for Cyrillic, Kana
#if defined( MAPPER_C2C3 ) || defined( MAPPER_NON ) #if defined(MAPPER_C2C3) || defined(MAPPER_NON)
// #define USE_BIG_EDIT_FONT //#define USE_BIG_EDIT_FONT
#endif #endif
// If you have spare 2300Byte of progmem and want to use a // If you have spare 2300Byte of progmem and want to use a
@ -126,17 +126,17 @@
// LCD selection // LCD selection
#ifdef U8GLIB_ST7920 #ifdef U8GLIB_ST7920
//U8GLIB_ST7920_128X64_RRD u8g(0,0,0); //U8GLIB_ST7920_128X64_RRD u8g(0,0,0);
U8GLIB_ST7920_128X64_RRD u8g(0); U8GLIB_ST7920_128X64_RRD u8g(0);
#elif defined(MAKRPANEL) #elif defined(MAKRPANEL)
// The MaKrPanel display, ST7565 controller as well // The MaKrPanel display, ST7565 controller as well
U8GLIB_NHD_C12864 u8g(DOGLCD_CS, DOGLCD_A0); U8GLIB_NHD_C12864 u8g(DOGLCD_CS, DOGLCD_A0);
#elif defined(VIKI2) || defined(miniVIKI) #elif defined(VIKI2) || defined(miniVIKI)
// Mini Viki and Viki 2.0 LCD, ST7565 controller as well // Mini Viki and Viki 2.0 LCD, ST7565 controller as well
U8GLIB_NHD_C12864 u8g(DOGLCD_CS, DOGLCD_A0); U8GLIB_NHD_C12864 u8g(DOGLCD_CS, DOGLCD_A0);
#else #else
// for regular DOGM128 display with HW-SPI // for regular DOGM128 display with HW-SPI
U8GLIB_DOGM128 u8g(DOGLCD_CS, DOGLCD_A0); // HW-SPI Com: CS, A0 U8GLIB_DOGM128 u8g(DOGLCD_CS, DOGLCD_A0); // HW-SPI Com: CS, A0
#endif #endif
#include "utf_mapper.h" #include "utf_mapper.h"
@ -188,8 +188,8 @@ char lcd_printPGM(const char* str) {
static bool show_splashscreen = true; static bool show_splashscreen = true;
static void lcd_implementation_init() static void lcd_implementation_init() {
{
#ifdef LCD_PIN_BL // Enable LCD backlight #ifdef LCD_PIN_BL // Enable LCD backlight
pinMode(LCD_PIN_BL, OUTPUT); pinMode(LCD_PIN_BL, OUTPUT);
digitalWrite(LCD_PIN_BL, HIGH); digitalWrite(LCD_PIN_BL, HIGH);
@ -359,9 +359,9 @@ static void lcd_implementation_status_screen() {
// Status line // Status line
lcd_setFont(FONT_STATUSMENU); lcd_setFont(FONT_STATUSMENU);
#ifdef USE_SMALL_INFOFONT #ifdef USE_SMALL_INFOFONT
u8g.setPrintPos(0,62); u8g.setPrintPos(0,62);
#else #else
u8g.setPrintPos(0,63); u8g.setPrintPos(0,63);
#endif #endif
#ifndef FILAMENT_LCD_DISPLAY #ifndef FILAMENT_LCD_DISPLAY
lcd_print(lcd_status_message); lcd_print(lcd_status_message);

@ -443,7 +443,7 @@ Possible status screens:
20x4 |01234567890123456789| 20x4 |01234567890123456789|
|T000/000D B000/000D | |T000/000D B000/000D |
|X+000.0 Y+000.0 Z+000.0| |X000 Y000 Z000.00|
|F100% SD100% T--:--| |F100% SD100% T--:--|
|Status line.........| |Status line.........|
@ -453,141 +453,154 @@ Possible status screens:
|F100% SD100% T--:--| |F100% SD100% T--:--|
|Status line.........| |Status line.........|
*/ */
static void lcd_implementation_status_screen() static void lcd_implementation_status_screen() {
{ int tHotend = int(degHotend(0) + 0.5);
int tHotend=int(degHotend(0) + 0.5); int tTarget = int(degTargetHotend(0) + 0.5);
int tTarget=int(degTargetHotend(0) + 0.5);
#if LCD_WIDTH < 20
#if LCD_WIDTH < 20
lcd.setCursor(0, 0); lcd.setCursor(0, 0);
lcd.print(itostr3(tHotend)); lcd.print(itostr3(tHotend));
lcd.print('/'); lcd.print('/');
lcd.print(itostr3left(tTarget)); lcd.print(itostr3left(tTarget));
# if EXTRUDERS > 1 || TEMP_SENSOR_BED != 0 #if EXTRUDERS > 1 || TEMP_SENSOR_BED != 0
//If we have an 2nd extruder or heated bed, show that in the top right corner
lcd.setCursor(8, 0); // If we have an 2nd extruder or heated bed, show that in the top right corner
# if EXTRUDERS > 1 lcd.setCursor(8, 0);
tHotend = int(degHotend(1) + 0.5); #if EXTRUDERS > 1
tTarget = int(degTargetHotend(1) + 0.5); tHotend = int(degHotend(1) + 0.5);
lcd.print(LCD_STR_THERMOMETER[0]); tTarget = int(degTargetHotend(1) + 0.5);
# else//Heated bed lcd.print(LCD_STR_THERMOMETER[0]);
tHotend=int(degBed() + 0.5); #else // Heated bed
tTarget=int(degTargetBed() + 0.5); tHotend = int(degBed() + 0.5);
lcd.print(LCD_STR_BEDTEMP[0]); tTarget = int(degTargetBed() + 0.5);
# endif lcd.print(LCD_STR_BEDTEMP[0]);
lcd.print(itostr3(tHotend)); #endif
lcd.print('/'); lcd.print(itostr3(tHotend));
lcd.print(itostr3left(tTarget)); lcd.print('/');
# endif//EXTRUDERS > 1 || TEMP_SENSOR_BED != 0 lcd.print(itostr3left(tTarget));
#endif // EXTRUDERS > 1 || TEMP_SENSOR_BED != 0
#else // LCD_WIDTH > 19
#else//LCD_WIDTH > 19
lcd.setCursor(0, 0); lcd.setCursor(0, 0);
lcd.print(LCD_STR_THERMOMETER[0]); lcd.print(LCD_STR_THERMOMETER[0]);
lcd.print(itostr3(tHotend)); lcd.print(itostr3(tHotend));
lcd.print('/'); lcd.print('/');
lcd.print(itostr3left(tTarget)); lcd.print(itostr3left(tTarget));
lcd_printPGM(PSTR(LCD_STR_DEGREE " ")); lcd_printPGM(PSTR(LCD_STR_DEGREE " "));
if (tTarget < 10) if (tTarget < 10) lcd.print(' ');
lcd.print(' ');
# if EXTRUDERS > 1 || TEMP_SENSOR_BED != 0 #if EXTRUDERS > 1 || TEMP_SENSOR_BED != 0
//If we have an 2nd extruder or heated bed, show that in the top right corner // If we have an 2nd extruder or heated bed, show that in the top right corner
lcd.setCursor(10, 0); lcd.setCursor(10, 0);
# if EXTRUDERS > 1 #if EXTRUDERS > 1
tHotend = int(degHotend(1) + 0.5); tHotend = int(degHotend(1) + 0.5);
tTarget = int(degTargetHotend(1) + 0.5); tTarget = int(degTargetHotend(1) + 0.5);
lcd.print(LCD_STR_THERMOMETER[0]); lcd.print(LCD_STR_THERMOMETER[0]);
# else//Heated bed #else // Heated bed
tHotend=int(degBed() + 0.5); tHotend = int(degBed() + 0.5);
tTarget=int(degTargetBed() + 0.5); tTarget = int(degTargetBed() + 0.5);
lcd.print(LCD_STR_BEDTEMP[0]); lcd.print(LCD_STR_BEDTEMP[0]);
# endif #endif
lcd.print(itostr3(tHotend)); lcd.print(itostr3(tHotend));
lcd.print('/'); lcd.print('/');
lcd.print(itostr3left(tTarget)); lcd.print(itostr3left(tTarget));
lcd_printPGM(PSTR(LCD_STR_DEGREE " ")); lcd_printPGM(PSTR(LCD_STR_DEGREE " "));
if (tTarget < 10) if (tTarget < 10) lcd.print(' ');
lcd.print(' ');
# endif//EXTRUDERS > 1 || TEMP_SENSOR_BED != 0
#endif//LCD_WIDTH > 19
#if LCD_HEIGHT > 2 #endif // EXTRUDERS > 1 || TEMP_SENSOR_BED != 0
//Lines 2 for 4 line LCD
# if LCD_WIDTH < 20 #endif // LCD_WIDTH > 19
# ifdef SDSUPPORT
lcd.setCursor(0, 2); #if LCD_HEIGHT > 2
lcd_printPGM(PSTR("SD")); // Lines 2 for 4 line LCD
if (IS_SD_PRINTING) #if LCD_WIDTH < 20
lcd.print(itostr3(card.percentDone())); #ifdef SDSUPPORT
else lcd.setCursor(0, 2);
lcd_printPGM(PSTR("---")); lcd_printPGM(PSTR("SD"));
lcd.print('%'); if (IS_SD_PRINTING)
# endif//SDSUPPORT lcd.print(itostr3(card.percentDone()));
# else//LCD_WIDTH > 19 else
# if EXTRUDERS > 1 && TEMP_SENSOR_BED != 0 lcd_printPGM(PSTR("---"));
//If we both have a 2nd extruder and a heated bed, show the heated bed temp on the 2nd line on the left, as the first line is filled with extruder temps lcd.print('%');
tHotend=int(degBed() + 0.5); #endif // SDSUPPORT
tTarget=int(degTargetBed() + 0.5);
#else // LCD_WIDTH > 19
#if EXTRUDERS > 1 && TEMP_SENSOR_BED != 0
// If we both have a 2nd extruder and a heated bed, show the heated bed temp on the 2nd line on the left, as the first line is filled with extruder temps
tHotend = int(degBed() + 0.5);
tTarget = int(degTargetBed() + 0.5);
lcd.setCursor(0, 1);
lcd.print(LCD_STR_BEDTEMP[0]);
lcd.print(itostr3(tHotend));
lcd.print('/');
lcd.print(itostr3left(tTarget));
lcd_printPGM(PSTR(LCD_STR_DEGREE " "));
if (tTarget < 10) lcd.print(' ');
#else
lcd.setCursor(0,1);
lcd.print('X');
lcd.print(ftostr3(current_position[X_AXIS]));
lcd_printPGM(PSTR(" Y"));
lcd.print(ftostr3(current_position[Y_AXIS]));
#endif // EXTRUDERS > 1 || TEMP_SENSOR_BED != 0
#endif // LCD_WIDTH > 19
lcd.setCursor(0, 1);
lcd.print(LCD_STR_BEDTEMP[0]);
lcd.print(itostr3(tHotend));
lcd.print('/');
lcd.print(itostr3left(tTarget));
lcd_printPGM(PSTR(LCD_STR_DEGREE " "));
if (tTarget < 10)
lcd.print(' ');
# else
lcd.setCursor(0,1);
lcd.print('X');
lcd.print(ftostr3(current_position[X_AXIS]));
lcd_printPGM(PSTR(" Y"));
lcd.print(ftostr3(current_position[Y_AXIS]));
# endif//EXTRUDERS > 1 || TEMP_SENSOR_BED != 0
# endif//LCD_WIDTH > 19
lcd.setCursor(LCD_WIDTH - 8, 1); lcd.setCursor(LCD_WIDTH - 8, 1);
lcd.print('Z'); lcd.print('Z');
lcd.print(ftostr32sp(current_position[Z_AXIS] + 0.00001)); lcd.print(ftostr32sp(current_position[Z_AXIS] + 0.00001));
#endif//LCD_HEIGHT > 2
#if LCD_HEIGHT > 3 #endif // LCD_HEIGHT > 2
#if LCD_HEIGHT > 3
lcd.setCursor(0, 2); lcd.setCursor(0, 2);
lcd.print(LCD_STR_FEEDRATE[0]); lcd.print(LCD_STR_FEEDRATE[0]);
lcd.print(itostr3(feedmultiply)); lcd.print(itostr3(feedmultiply));
lcd.print('%'); lcd.print('%');
# if LCD_WIDTH > 19
# ifdef SDSUPPORT #if LCD_WIDTH > 19 && defined(SDSUPPORT)
lcd.setCursor(7, 2);
lcd_printPGM(PSTR("SD")); lcd.setCursor(7, 2);
if (IS_SD_PRINTING) lcd_printPGM(PSTR("SD"));
if (IS_SD_PRINTING)
lcd.print(itostr3(card.percentDone())); lcd.print(itostr3(card.percentDone()));
else else
lcd_printPGM(PSTR("---")); lcd_printPGM(PSTR("---"));
lcd.print('%'); lcd.print('%');
# endif//SDSUPPORT
# endif//LCD_WIDTH > 19 #endif // LCD_WIDTH > 19 && SDSUPPORT
lcd.setCursor(LCD_WIDTH - 6, 2); lcd.setCursor(LCD_WIDTH - 6, 2);
lcd.print(LCD_STR_CLOCK[0]); lcd.print(LCD_STR_CLOCK[0]);
if(starttime != 0) if (starttime != 0) {
{ uint16_t time = millis()/60000 - starttime/60000;
uint16_t time = millis()/60000 - starttime/60000; lcd.print(itostr2(time/60));
lcd.print(itostr2(time/60)); lcd.print(':');
lcd.print(':'); lcd.print(itostr2(time%60));
lcd.print(itostr2(time%60)); }
}else{ else {
lcd_printPGM(PSTR("--:--")); lcd_printPGM(PSTR("--:--"));
} }
#endif
// Status message line at the bottom #endif // LCD_HEIGHT > 3
/**
* Display Progress Bar, Filament display, and/or Status Message on the last line
*/
lcd.setCursor(0, LCD_HEIGHT - 1); lcd.setCursor(0, LCD_HEIGHT - 1);
#ifdef LCD_PROGRESS_BAR #ifdef LCD_PROGRESS_BAR
if (card.isFileOpen()) { if (card.isFileOpen()) {
uint16_t mil = millis(), diff = mil - progressBarTick; if (millis() >= progressBarTick + PROGRESS_BAR_MSG_TIME || !lcd_status_message[0]) {
if (diff >= PROGRESS_BAR_MSG_TIME || !lcd_status_message[0]) {
// draw the progress bar // draw the progress bar
int tix = (int)(card.percentDone() * LCD_WIDTH * 3) / 100, int tix = (int)(card.percentDone() * LCD_WIDTH * 3) / 100,
cel = tix / 3, rem = tix % 3, i = LCD_WIDTH; cel = tix / 3, rem = tix % 3, i = LCD_WIDTH;
@ -605,11 +618,11 @@ static void lcd_implementation_status_screen()
} }
} //card.isFileOpen } //card.isFileOpen
#endif //LCD_PROGRESS_BAR #elif defined(FILAMENT_LCD_DISPLAY)
//Display both Status message line and Filament display on the last line // Show Filament Diameter and Volumetric Multiplier %
#ifdef FILAMENT_LCD_DISPLAY // After allowing lcd_status_message to show for 5 seconds
if (message_millis + 5000 <= millis()) { //display any status for the first 5 sec after screen is initiated if (millis() >= message_millis + 5000) {
lcd_printPGM(PSTR("Dia ")); lcd_printPGM(PSTR("Dia "));
lcd.print(ftostr12ns(filament_width_meas)); lcd.print(ftostr12ns(filament_width_meas));
lcd_printPGM(PSTR(" V")); lcd_printPGM(PSTR(" V"));
@ -617,7 +630,8 @@ static void lcd_implementation_status_screen()
lcd.print('%'); lcd.print('%');
return; return;
} }
#endif //FILAMENT_LCD_DISPLAY
#endif // FILAMENT_LCD_DISPLAY
lcd_print(lcd_status_message); lcd_print(lcd_status_message);
} }

Loading…
Cancel
Save