Commit 27cbf4f3 authored by MagoKimbra's avatar MagoKimbra

Adaption of LCD info screen

parent 8d8c62d8
This diff is collapsed.
......@@ -16,8 +16,8 @@
#define ULTRA_LCD_IMPLEMENTATION_DOGM_H
/**
* Implementation of the LCD display routines for a DOGM128 graphic display. These are common LCD 128x64 pixel graphic displays.
**/
* Implementation of the LCD display routines for a DOGM128 graphic display. These are common LCD 128x64 pixel graphic displays.
**/
#ifdef ULTIPANEL
#define BLEN_A 0
......@@ -42,14 +42,14 @@
/* Russian language not supported yet, needs custom font
#if LANGUAGE_CHOICE == 6
#include "LiquidCrystalRus.h"
#define LCD_CLASS LiquidCrystalRus
#else
#include <LiquidCrystal.h>
#define LCD_CLASS LiquidCrystal
#endif
*/
#if LANGUAGE_CHOICE == 6
#include "LiquidCrystalRus.h"
#define LCD_CLASS LiquidCrystalRus
#else
#include <LiquidCrystal.h>
#define LCD_CLASS LiquidCrystal
#endif
*/
// DOGM parameters (size in pixels)
#define DOG_CHAR_WIDTH 6
......@@ -106,8 +106,7 @@ static void lcd_implementation_init()
u8g.setColorIndex(1);
u8g.drawBox (0, 0, u8g.getWidth(), u8g.getHeight());
u8g.setColorIndex(1);
}
while( u8g.nextPage() );
} while( u8g.nextPage() );
#ifdef LCD_SCREEN_ROT_90
u8g.setRot90(); // Rotate screen by 90°
......@@ -141,22 +140,21 @@ static void lcd_implementation_init()
u8g.drawStr(62,61,"uses u");
u8g.drawStr90(92,57,"8");
u8g.drawStr(100,61,"glib");
}
while( u8g.nextPage() );
} while( u8g.nextPage() );
}
static void lcd_implementation_clear()
{
// NO NEED TO IMPLEMENT LIKE SO. Picture loop automatically clears the display.
//
// Check this article: http://arduino.cc/forum/index.php?topic=91395.25;wap2
//
// u8g.firstPage();
// do {
// u8g.setColorIndex(0);
// u8g.drawBox (0, 0, u8g.getWidth(), u8g.getHeight());
// u8g.setColorIndex(1);
// } while( u8g.nextPage() );
// NO NEED TO IMPLEMENT LIKE SO. Picture loop automatically clears the display.
//
// Check this article: http://arduino.cc/forum/index.php?topic=91395.25;wap2
//
// u8g.firstPage();
// do {
// u8g.setColorIndex(0);
// u8g.drawBox (0, 0, u8g.getWidth(), u8g.getHeight());
// u8g.setColorIndex(1);
// } while( u8g.nextPage() );
}
/* Arduino < 1.0.0 is missing a function to print PROGMEM strings, so we need to implement our own */
......@@ -181,7 +179,7 @@ static void lcd_implementation_status_screen()
if ((blink % 2) && fanSpeed ) u8g.drawBitmapP(9,1,STATUS_SCREENBYTEWIDTH,STATUS_SCREENHEIGHT,status_screen0_bmp);
else u8g.drawBitmapP(9,1,STATUS_SCREENBYTEWIDTH,STATUS_SCREENHEIGHT,status_screen1_bmp);
#ifdef SDSUPPORT
#ifdef SDSUPPORT
//SD Card Symbol
u8g.drawBox(42,42,8,7);
u8g.drawBox(50,44,2,5);
......@@ -210,11 +208,10 @@ static void lcd_implementation_status_screen()
u8g.print(itostr2(time/60));
u8g.print(':');
u8g.print(itostr2(time%60));
}
else{
}else{
lcd_printPGM(PSTR("--:--"));
}
#endif
#endif
// Extruder 1
u8g.setFont(FONT_STATUSMENU);
......@@ -234,7 +231,7 @@ static void lcd_implementation_status_screen()
// Extruder 2
u8g.setFont(FONT_STATUSMENU);
#if EXTRUDERS > 1
#if EXTRUDERS > 1
u8g.setPrintPos(31,6);
u8g.print(itostr3(int(degTargetHotend(1) + 0.5)));
lcd_printPGM(PSTR(LCD_STR_DEGREE " "));
......@@ -248,14 +245,11 @@ static void lcd_implementation_status_screen()
u8g.drawBox(38,17,2,2);
u8g.setColorIndex(1); // black on white
}
#else
u8g.setPrintPos(31,27);
u8g.print("---");
#endif
#endif
// Extruder 3
u8g.setFont(FONT_STATUSMENU);
# if EXTRUDERS > 2
# if EXTRUDERS > 2
u8g.setPrintPos(55,6);
u8g.print(itostr3(int(degTargetHotend(2) + 0.5)));
lcd_printPGM(PSTR(LCD_STR_DEGREE " "));
......@@ -269,10 +263,7 @@ static void lcd_implementation_status_screen()
u8g.drawBox(62,17,2,2);
u8g.setColorIndex(1); // black on white
}
#else
u8g.setPrintPos(55,27);
u8g.print("---");
#endif
#endif
// Heatbed
u8g.setFont(FONT_STATUSMENU);
......@@ -293,12 +284,12 @@ static void lcd_implementation_status_screen()
// Fan
u8g.setFont(FONT_STATUSMENU);
u8g.setPrintPos(104,27);
#if defined(FAN_PIN) && FAN_PIN > -1
#if defined(FAN_PIN) && FAN_PIN > -1
u8g.print(itostr3(int((fanSpeed*100)/256 + 1)));
u8g.print("%");
#else
#else
u8g.print("---");
#endif
#endif
// X, Y, Z-Coordinates
......@@ -352,12 +343,10 @@ static void lcd_implementation_drawmenu_generic(uint8_t row, const char* pstr, c
u8g.setColorIndex(1); // black on white
u8g.drawBox (0, row*DOG_CHAR_HEIGHT + 3, 128, DOG_CHAR_HEIGHT);
u8g.setColorIndex(0); // following text must be white on black
}
else u8g.setColorIndex(1); // unmarked text is black on white
} else u8g.setColorIndex(1); // unmarked text is black on white
u8g.setPrintPos(0 * DOG_CHAR_WIDTH, (row + 1) * DOG_CHAR_HEIGHT);
if (pre_char != '>') u8g.print(pre_char);
else u8g.print(' '); // Row selector is obsolete
if (pre_char != '>') u8g.print(pre_char); else u8g.print(' '); // Row selector is obsolete
while( (c = pgm_read_byte(pstr)) != '\0' )
......@@ -514,7 +503,7 @@ static void lcd_implementation_drawmenu_sdfile(uint8_t row, const char* pstr, co
u8g.setPrintPos(0 * DOG_CHAR_WIDTH, (row + 1) * DOG_CHAR_HEIGHT);
u8g.print(' ');
while((c = *filename) != '\0')
while((c = *filename) != '\0')
{
u8g.print(c);
......@@ -610,4 +599,3 @@ static void lcd_implementation_quick_feedback()
#endif//ULTRA_LCD_IMPLEMENTATION_DOGM_H
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment