Browse Source

Merge pull request #3560 from thinkyhead/rc_better_graphical_lcd

Aesthetic, functional improvements for Graphical Display
Scott Lahteine 8 years ago
parent
commit
00d36d10e2

+ 2
- 2
Marlin/Conditionals.h View File

@@ -218,7 +218,7 @@
218 218
   #endif
219 219
 
220 220
   #if ENABLED(DOGLCD)
221
-    /* Custom characters defined in font font_6x10_marlin_symbols */
221
+    /* Custom characters defined in font dogm_font_data_Marlin_symbols.h / Marlin_symbols.fon */
222 222
     // \x00 intentionally skipped to avoid problems in strings
223 223
     #define LCD_STR_REFRESH     "\x01"
224 224
     #define LCD_STR_FOLDER      "\x02"
@@ -235,7 +235,7 @@
235 235
     // Better stay below 0x10 because DISPLAY_CHARSET_HD44780_WESTERN begins here.
236 236
   #else
237 237
     /* Custom characters defined in the first 8 characters of the LCD */
238
-    #define LCD_STR_BEDTEMP     "\x00"  // this will have 'unexpected' results when used in a string!
238
+    #define LCD_STR_BEDTEMP     "\x00"  // Print only as a char. This will have 'unexpected' results when used in a string!
239 239
     #define LCD_STR_DEGREE      "\x01"
240 240
     #define LCD_STR_THERMOMETER "\x02"
241 241
     #define LCD_STR_UPLEVEL     "\x03"

+ 57
- 81
Marlin/dogm_lcd_implementation.h View File

@@ -279,26 +279,51 @@ static void lcd_implementation_init() {
279 279
 
280 280
 static void lcd_implementation_clear() { } // Automatically cleared by Picture Loop
281 281
 
282
-static void _draw_heater_status(int x, int heater) {
283
-  bool isBed = heater < 0;
284
-  int y = 17 + (isBed ? 1 : 0);
285
-
286
-  lcd_setFont(FONT_STATUSMENU);
287
-  u8g.setPrintPos(x, 7);
288
-  lcd_print(itostr3(int((heater >= 0 ? degTargetHotend(heater) : degTargetBed()) + 0.5)));
282
+FORCE_INLINE void _draw_centered_temp(int temp, int x, int y) {
283
+  int degsize = 6 * (temp >= 100 ? 3 : temp >= 10 ? 2 : 1); // number's pixel width
284
+  u8g.setPrintPos(x - (18 - degsize) / 2, y); // move left if shorter
285
+  lcd_print(itostr3(temp));
289 286
   lcd_printPGM(PSTR(LCD_STR_DEGREE " "));
290
-  u8g.setPrintPos(x, 28);
291
-  lcd_print(itostr3(int(heater >= 0 ? degHotend(heater) : degBed()) + 0.5));
287
+}
292 288
 
293
-  lcd_printPGM(PSTR(LCD_STR_DEGREE " "));
294
-  if (heater >= 0 ? !isHeatingHotend(heater) : !isHeatingBed()) {
295
-    u8g.drawBox(x+7,y,2,2);
296
-  }
297
-  else {
289
+FORCE_INLINE void _draw_heater_status(int x, int heater) {
290
+  #if HAS_TEMP_BED
291
+    bool isBed = heater < 0;
292
+  #else
293
+    const bool isBed = false;
294
+  #endif
295
+
296
+  _draw_centered_temp((isBed ? degTargetBed() : degTargetHotend(heater)) + 0.5, x, 7);
297
+
298
+  _draw_centered_temp((isBed ? degBed() : degHotend(heater)) + 0.5, x, 28);
299
+
300
+  int h = isBed ? 7 : 8,
301
+      y = isBed ? 18 : 17;
302
+  if (isBed ? isHeatingBed() : isHeatingHotend(heater)) {
298 303
     u8g.setColorIndex(0); // white on black
299
-    u8g.drawBox(x + 7, y, 2, 2);
304
+    u8g.drawBox(x + h, y, 2, 2);
300 305
     u8g.setColorIndex(1); // black on white
301 306
   }
307
+  else {
308
+    u8g.drawBox(x + h, y, 2, 2);
309
+  }
310
+}
311
+
312
+FORCE_INLINE void _draw_axis_label(AxisEnum axis, const char *pstr, bool blink) {
313
+  if (blink)
314
+    lcd_printPGM(pstr);
315
+  else {
316
+    if (!axis_homed[axis])
317
+      lcd_printPGM(PSTR("?"));
318
+    else {
319
+      #if DISABLED(DISABLE_REDUCED_ACCURACY_WARNING)
320
+        if (!axis_known_position[axis])
321
+          lcd_printPGM(PSTR(" "));
322
+        else
323
+      #endif
324
+      lcd_printPGM(pstr);
325
+    }
326
+  }
302 327
 }
303 328
 
304 329
 static void lcd_implementation_status_screen() {
@@ -315,6 +340,9 @@ static void lcd_implementation_status_screen() {
315 340
     #endif
316 341
   );
317 342
 
343
+  // Status Menu Font for SD info, Heater status, Fan, XYZ
344
+  lcd_setFont(FONT_STATUSMENU);
345
+
318 346
   #if ENABLED(SDSUPPORT)
319 347
     // SD Card Symbol
320 348
     u8g.drawBox(42, 42 - (TALL_FONT_CORRECTION), 8, 7);
@@ -326,8 +354,6 @@ static void lcd_implementation_status_screen() {
326 354
     u8g.drawFrame(54, 49, 73, 4 - (TALL_FONT_CORRECTION));
327 355
 
328 356
     // SD Card Progress bar and clock
329
-    lcd_setFont(FONT_STATUSMENU);
330
-
331 357
     if (IS_SD_PRINTING) {
332 358
       // Progress bar solid part
333 359
       u8g.drawBox(55, 50, (unsigned int)(71.f * card.percentDone() / 100.f), 2 - (TALL_FONT_CORRECTION));
@@ -340,19 +366,17 @@ static void lcd_implementation_status_screen() {
340 366
       lcd_print(':');
341 367
       lcd_print(itostr2(time%60));
342 368
     }
343
-    else {
344
-      lcd_printPGM(PSTR("--:--"));
345
-    }
346 369
   #endif
347 370
 
348 371
   // Extruders
349
-  for (int i = 0; i < EXTRUDERS; i++) _draw_heater_status(6 + i * 25, i);
372
+  for (int i = 0; i < EXTRUDERS; i++) _draw_heater_status(5 + i * 25, i);
350 373
 
351
-  // Heatbed
352
-  if (EXTRUDERS < 4) _draw_heater_status(81, -1);
374
+  // Heated bed
375
+  #if EXTRUDERS < 4 && HAS_TEMP_BED
376
+    _draw_heater_status(81, -1);
377
+  #endif
353 378
 
354 379
   // Fan
355
-  lcd_setFont(FONT_STATUSMENU);
356 380
   u8g.setPrintPos(104, 27);
357 381
   #if HAS_FAN0
358 382
     int per = ((fanSpeeds[0] + 1) * 100) / 256;
@@ -360,18 +384,13 @@ static void lcd_implementation_status_screen() {
360 384
       lcd_print(itostr3(per));
361 385
       lcd_print('%');
362 386
     }
363
-    else
364 387
   #endif
365
-    {
366
-      lcd_printPGM(PSTR("---"));
367
-    }
368 388
 
369 389
   // X, Y, Z-Coordinates
370 390
   // Before homing the axis letters are blinking 'X' <-> '?'.
371 391
   // When axis is homed but axis_known_position is false the axis letters are blinking 'X' <-> ' '.
372 392
   // When everything is ok you see a constant 'X'.
373 393
   #define XYZ_BASELINE 38
374
-  lcd_setFont(FONT_STATUSMENU);
375 394
 
376 395
   #if ENABLED(USE_SMALL_INFOFONT)
377 396
     u8g.drawBox(0, 30, LCD_PIXEL_WIDTH, 10);
@@ -379,78 +398,35 @@ static void lcd_implementation_status_screen() {
379 398
     u8g.drawBox(0, 30, LCD_PIXEL_WIDTH, 9);
380 399
   #endif
381 400
   u8g.setColorIndex(0); // white on black
401
+
382 402
   u8g.setPrintPos(2, XYZ_BASELINE);
383
-  if (blink)
384
-    lcd_printPGM(PSTR(MSG_X));
385
-  else {
386
-    if (!axis_homed[X_AXIS])
387
-      lcd_printPGM(PSTR("?"));
388
-    else {
389
-      #if DISABLED(DISABLE_REDUCED_ACCURACY_WARNING)
390
-        if (!axis_known_position[X_AXIS])
391
-          lcd_printPGM(PSTR(" "));
392
-        else
393
-      #endif
394
-      lcd_printPGM(PSTR(MSG_X));
395
-    }
396
-  }
397
-  u8g.drawPixel(8, XYZ_BASELINE - 5);
398
-  u8g.drawPixel(8, XYZ_BASELINE - 3);
403
+  _draw_axis_label(X_AXIS, PSTR(MSG_X), blink);
399 404
   u8g.setPrintPos(10, XYZ_BASELINE);
400
-  lcd_print(ftostr31ns(current_position[X_AXIS]));
405
+  lcd_print(ftostr4sign(current_position[X_AXIS]));
401 406
 
402 407
   u8g.setPrintPos(43, XYZ_BASELINE);
403
-  if (blink)
404
-    lcd_printPGM(PSTR(MSG_Y));
405
-  else {
406
-    if (!axis_homed[Y_AXIS])
407
-      lcd_printPGM(PSTR("?"));
408
-    else {
409
-      #if DISABLED(DISABLE_REDUCED_ACCURACY_WARNING)
410
-        if (!axis_known_position[Y_AXIS])
411
-          lcd_printPGM(PSTR(" "));
412
-        else
413
-      #endif
414
-      lcd_printPGM(PSTR(MSG_Y));
415
-    }
416
-  }
417
-  u8g.drawPixel(49, XYZ_BASELINE - 5);
418
-  u8g.drawPixel(49, XYZ_BASELINE - 3);
408
+  _draw_axis_label(Y_AXIS, PSTR(MSG_Y), blink);
419 409
   u8g.setPrintPos(51, XYZ_BASELINE);
420
-  lcd_print(ftostr31ns(current_position[Y_AXIS]));
410
+  lcd_print(ftostr4sign(current_position[Y_AXIS]));
421 411
 
422 412
   u8g.setPrintPos(83, XYZ_BASELINE);
423
-  if (blink)
424
-    lcd_printPGM(PSTR(MSG_Z));
425
-  else {
426
-    if (!axis_homed[Z_AXIS])
427
-      lcd_printPGM(PSTR("?"));
428
-    else {
429
-      #if DISABLED(DISABLE_REDUCED_ACCURACY_WARNING)
430
-        if (!axis_known_position[Z_AXIS])
431
-          lcd_printPGM(PSTR(" "));
432
-        else
433
-      #endif
434
-      lcd_printPGM(PSTR(MSG_Z));
435
-    }
436
-  }
437
-  u8g.drawPixel(89, XYZ_BASELINE - 5);
438
-  u8g.drawPixel(89, XYZ_BASELINE - 3);
413
+  _draw_axis_label(Z_AXIS, PSTR(MSG_Z), blink);
439 414
   u8g.setPrintPos(91, XYZ_BASELINE);
440
-  lcd_print(ftostr32sp(current_position[Z_AXIS]));
415
+  lcd_print(ftostr32sp(current_position[Z_AXIS] + 0.00001));
416
+
441 417
   u8g.setColorIndex(1); // black on white
442 418
 
443 419
   // Feedrate
444 420
   lcd_setFont(FONT_MENU);
445 421
   u8g.setPrintPos(3, 49);
446 422
   lcd_print(LCD_STR_FEEDRATE[0]);
423
+
447 424
   lcd_setFont(FONT_STATUSMENU);
448 425
   u8g.setPrintPos(12, 49);
449 426
   lcd_print(itostr3(feedrate_multiplier));
450 427
   lcd_print('%');
451 428
 
452 429
   // Status line
453
-  lcd_setFont(FONT_STATUSMENU);
454 430
   #if ENABLED(USE_SMALL_INFOFONT)
455 431
     u8g.setPrintPos(0, 62);
456 432
   #else

+ 0
- 23
Marlin/fonts/README.fonts View File

@@ -1,23 +0,0 @@
1
-The fonts are created with Fony.exe (http://hukka.ncn.fi/?fony) because Fontforge didn't do what I want (probably lack of experience).
2
-In Fony export the fonts to bdf-format. Maybe another one can edit them with Fontforge.
3
-Then run make_fonts.bat what calls bdf2u8g.exe with the needed parameters to produce the .h files.
4
-The .h files must be edited to replace '#include "u8g.h"' with '#include <utility/u8g.h>', replace 'U8G_FONT_SECTION' with 'U8G_SECTION', insert '.progmem.' right behind the first '"' and moved to the main directory.
5
-
6
-How to integrate a new font:
7
-Currently we are limited to 256 symbols per font. We use a menu system with 5 lines, on a display with 64 pixel height. That means we have 12 pixel for a line. To have some space in between the lines we can't use more than 10 pixel height for the symbols. For up to 11 pixel set TALL_FONT_CORRECTION 1 when loading the font.
8
-To fit 22 Symbols on the 128 pixel wide screen, the symbols can't be wider than 5 pixel, for the first 128 symbols.
9
-For the second half of the font we now support up to 11x11 pixel.
10
-
11
- * Get 'Fony.exe'
12
- * Copy one of the existing *.fon files and work with this.
13
- * Change the pixels. Don't change width or height.
14
- * Export as *.bdf
15
- * Use 'bdf2u8g.exe' to produce the *.h file. Examples for the existing fonts are in 'make_fonts.bat'
16
- * Edit the produced .h file to match our needs. See hints in 'README.fonts' or the other 'dogm_font_data_.h' files.
17
- * Make a new entry in the font list in 'dogm_lcd_implementation.h' before the '#else // fall back'
18
-    #elif ENABLED(DISPLAY_CHARSET_NEWNAME)
19
-      #include "dogm_font_data_yourfont.h"
20
-      #define FONT_MENU_NAME YOURFONTNAME
21
-    #else // fall-back
22
- * Add your font to the list of permitted fonts in 'language_en.h'
23
-    ... || ENABLED(DISPLAY_CHARSET_YOUR_NEW_FONT) ... )

+ 30
- 0
Marlin/fonts/README.md View File

@@ -0,0 +1,30 @@
1
+The fonts are created with Fony.exe (http://hukka.ncn.fi/?fony) because Fontforge didn't do what I want (probably lack of experience).
2
+
3
+In Fony export the fonts to bdf-format. (Maybe another one can edit them with Fontforge.) Then run `make_fonts.bat` which calls `bdf2u8g.exe` with the parameters needed to produce the `.h` files. The `.h` files must be edited and moved:
4
+- Replace `#include "u8g.h"` with `#include <utility/u8g.h>`,
5
+- Replace `U8G_FONT_SECTION` with `U8G_SECTION`,
6
+- Insert `.progmem.` right after the first quote `"`,
7
+- Move the file to the main directory.
8
+
9
+How to integrate a new font:
10
+Currently we are limited to 256 symbols per font. We use a menu system with 5 lines, on a display with 64 pixel height. That means we have 12 pixels per line. So to have any space between the lines we can use no more than 10 pixel height for the symbols. For up to 11 pixels set TALL_FONT_CORRECTION 1 when loading the font.
11
+To fit 22 Symbols on the 128 pixel wide screen, the symbols can't be wider than 5 pixel, for the first 128 symbols.
12
+For the second half of the font we now support up to 11x11 pixel.
13
+
14
+- Get `Fony.exe` from [hukka.ncn.fi](http://hukka.ncn.fi/?fony)
15
+- Copy one of the existing `*.fon` files and use the copy for your work.
16
+- Only change the pixels. Don't change width or height.
17
+- Export as a `*.bdf` file
18
+- Use `bdf2u8g.exe` to produce the `.h` file. Examples for the existing fonts are in `make_fonts.bat`.
19
+- Edit the produced `.h` file to match our needs. Find hints in the `dogm_font_data_.h` files.
20
+- Make a new entry in the font list in `dogm_lcd_implementation.h` before the `#else // fall-back` line:
21
+```cpp
22
+    #elif ENABLED(DISPLAY_CHARSET_NEWNAME)
23
+      #include "dogm_font_data_yourfont.h"
24
+      #define FONT_MENU_NAME YOURFONTNAME
25
+    #else // fall-back
26
+```
27
+- Add your font to the list of permitted fonts in 'language_en.h'
28
+```cpp
29
+    ... || ENABLED(DISPLAY_CHARSET_YOUR_NEW_FONT) ... )
30
+```

+ 4
- 4
Marlin/language_an.h View File

@@ -93,10 +93,10 @@
93 93
 #define MSG_VZ_JERK                         "Vz-jerk"
94 94
 #define MSG_VE_JERK                         "Ves-jerk"
95 95
 #define MSG_VMAX                            "Vmax"
96
-#define MSG_X                               "x"
97
-#define MSG_Y                               "y"
98
-#define MSG_Z                               "z"
99
-#define MSG_E                               "y"
96
+#define MSG_X                               "X"
97
+#define MSG_Y                               "Y"
98
+#define MSG_Z                               "Z"
99
+#define MSG_E                               "E"
100 100
 #define MSG_VMIN                            "Vmin"
101 101
 #define MSG_VTRAV_MIN                       "VTrav min"
102 102
 #define MSG_AMAX                            "Amax"

+ 4
- 4
Marlin/language_bg.h View File

@@ -94,10 +94,10 @@
94 94
 #define MSG_VZ_JERK                         "Vz-jerk"
95 95
 #define MSG_VE_JERK                         "Ve-jerk"
96 96
 #define MSG_VMAX                            "Vmax "
97
-#define MSG_X                               "x"
98
-#define MSG_Y                               "y"
99
-#define MSG_Z                               "z"
100
-#define MSG_E                               "e"
97
+#define MSG_X                               "X"
98
+#define MSG_Y                               "Y"
99
+#define MSG_Z                               "Z"
100
+#define MSG_E                               "E"
101 101
 #define MSG_VMIN                            "Vmin"
102 102
 #define MSG_VTRAV_MIN                       "VTrav min"
103 103
 #define MSG_AMAX                            "Amax "

+ 4
- 4
Marlin/language_ca.h View File

@@ -94,10 +94,10 @@
94 94
 #define MSG_VZ_JERK                         "Vz-jerk"
95 95
 #define MSG_VE_JERK                         "Ve-jerk"
96 96
 #define MSG_VMAX                            "Vmax "
97
-#define MSG_X                               "x"
98
-#define MSG_Y                               "y"
99
-#define MSG_Z                               "z"
100
-#define MSG_E                               "e"
97
+#define MSG_X                               "X"
98
+#define MSG_Y                               "Y"
99
+#define MSG_Z                               "Z"
100
+#define MSG_E                               "E"
101 101
 #define MSG_VMIN                            "Vmin"
102 102
 #define MSG_VTRAV_MIN                       "VTrav min"
103 103
 #define MSG_AMAX                            "Amax "

+ 4
- 4
Marlin/language_cn.h View File

@@ -92,10 +92,10 @@
92 92
 #define MSG_VZ_JERK                         "Vz-jerk"
93 93
 #define MSG_VE_JERK                         "Ve-jerk"
94 94
 #define MSG_VMAX                            "Vmax "
95
-#define MSG_X                               "x"
96
-#define MSG_Y                               "y"
97
-#define MSG_Z                               "z"
98
-#define MSG_E                               "e"
95
+#define MSG_X                               "X"
96
+#define MSG_Y                               "Y"
97
+#define MSG_Z                               "Z"
98
+#define MSG_E                               "E"
99 99
 #define MSG_VMIN                            "Vmin"
100 100
 #define MSG_VTRAV_MIN                       "VTrav min"
101 101
 #define MSG_AMAX                            "Amax "

+ 4
- 4
Marlin/language_cz.h View File

@@ -99,10 +99,10 @@
99 99
 #define MSG_VZ_JERK                         "Vz-jerk"
100 100
 #define MSG_VE_JERK                         "Ve-jerk"
101 101
 #define MSG_VMAX                            "Vmax "
102
-#define MSG_X                               "x"
103
-#define MSG_Y                               "y"
104
-#define MSG_Z                               "z"
105
-#define MSG_E                               "e"
102
+#define MSG_X                               "X"
103
+#define MSG_Y                               "Y"
104
+#define MSG_Z                               "Z"
105
+#define MSG_E                               "E"
106 106
 #define MSG_VMIN                            "Vmin"
107 107
 #define MSG_VTRAV_MIN                       "VTrav min"
108 108
 #define MSG_AMAX                            "Amax "

+ 4
- 4
Marlin/language_da.h View File

@@ -95,10 +95,10 @@
95 95
 #define MSG_VZ_JERK                         "Vz-jerk"
96 96
 #define MSG_VE_JERK                         "Ve-jerk"
97 97
 #define MSG_VMAX                            "Vmax "
98
-#define MSG_X                               "x"
99
-#define MSG_Y                               "y"
100
-#define MSG_Z                               "z"
101
-#define MSG_E                               "e"
98
+#define MSG_X                               "X"
99
+#define MSG_Y                               "Y"
100
+#define MSG_Z                               "Z"
101
+#define MSG_E                               "E"
102 102
 #define MSG_VMIN                            "Vmin"
103 103
 #define MSG_VTRAV_MIN                       "VTrav min"
104 104
 #define MSG_AMAX                            "Amax "

+ 4
- 4
Marlin/language_de.h View File

@@ -95,10 +95,10 @@
95 95
 #define MSG_VZ_JERK                         "V z  Ruck"
96 96
 #define MSG_VE_JERK                         "V e  Ruck"
97 97
 #define MSG_VMAX                            "V max " // space by purpose
98
-#define MSG_X                               "x"
99
-#define MSG_Y                               "y"
100
-#define MSG_Z                               "z"
101
-#define MSG_E                               "e"
98
+#define MSG_X                               "X"
99
+#define MSG_Y                               "Y"
100
+#define MSG_Z                               "Z"
101
+#define MSG_E                               "E"
102 102
 #define MSG_VMIN                            "V min"
103 103
 #define MSG_VTRAV_MIN                       "VTrav min"
104 104
 #define MSG_AMAX                            "A max " // space by purpose

+ 4
- 4
Marlin/language_en.h View File

@@ -272,16 +272,16 @@
272 272
   #define MSG_VMAX                            "Vmax "
273 273
 #endif
274 274
 #ifndef MSG_X
275
-  #define MSG_X                               "x"
275
+  #define MSG_X                               "X"
276 276
 #endif
277 277
 #ifndef MSG_Y
278
-  #define MSG_Y                               "y"
278
+  #define MSG_Y                               "Y"
279 279
 #endif
280 280
 #ifndef MSG_Z
281
-  #define MSG_Z                               "z"
281
+  #define MSG_Z                               "Z"
282 282
 #endif
283 283
 #ifndef MSG_E
284
-  #define MSG_E                               "e"
284
+  #define MSG_E                               "E"
285 285
 #endif
286 286
 #ifndef MSG_VMIN
287 287
   #define MSG_VMIN                            "Vmin"

+ 4
- 4
Marlin/language_es.h View File

@@ -94,10 +94,10 @@
94 94
 #define MSG_VZ_JERK                         "Vz-jerk"
95 95
 #define MSG_VE_JERK                         "Ve-jerk"
96 96
 #define MSG_VMAX                            "Vmax"
97
-#define MSG_X                               "x"
98
-#define MSG_Y                               "y"
99
-#define MSG_Z                               "z"
100
-#define MSG_E                               "e"
97
+#define MSG_X                               "X"
98
+#define MSG_Y                               "Y"
99
+#define MSG_Z                               "Z"
100
+#define MSG_E                               "E"
101 101
 #define MSG_VMIN                            "Vmin"
102 102
 #define MSG_VTRAV_MIN                       "Vel. viaje min"
103 103
 #define MSG_AMAX                            "Acel. max"

+ 4
- 4
Marlin/language_eu.h View File

@@ -93,10 +93,10 @@
93 93
 #define MSG_VZ_JERK                         "Vz-astindua"
94 94
 #define MSG_VE_JERK                         "Ve-astindua"
95 95
 #define MSG_VMAX                            "Vmax "
96
-#define MSG_X                               "x"
97
-#define MSG_Y                               "y"
98
-#define MSG_Z                               "z"
99
-#define MSG_E                               "e"
96
+#define MSG_X                               "X"
97
+#define MSG_Y                               "Y"
98
+#define MSG_Z                               "Z"
99
+#define MSG_E                               "E"
100 100
 #define MSG_VMIN                            "Vmin"
101 101
 #define MSG_VTRAV_MIN                       "VTrav min"
102 102
 #define MSG_AMAX                            "Amax "

+ 4
- 4
Marlin/language_fi.h View File

@@ -93,10 +93,10 @@
93 93
 #define MSG_VZ_JERK                         "Vz-jerk"
94 94
 #define MSG_VE_JERK                         "Ve-jerk"
95 95
 #define MSG_VMAX                            "Vmax "
96
-#define MSG_X                               "x"
97
-#define MSG_Y                               "y"
98
-#define MSG_Z                               "z"
99
-#define MSG_E                               "e"
96
+#define MSG_X                               "X"
97
+#define MSG_Y                               "Y"
98
+#define MSG_Z                               "Z"
99
+#define MSG_E                               "E"
100 100
 #define MSG_VMIN                            "Vmin"
101 101
 #define MSG_VTRAV_MIN                       "VLiike min"
102 102
 #define MSG_AMAX                            "Amax "

+ 4
- 4
Marlin/language_fr.h View File

@@ -95,10 +95,10 @@
95 95
 #define MSG_VZ_JERK                         "Vz-jerk"
96 96
 #define MSG_VE_JERK                         "Ve-jerk"
97 97
 #define MSG_VMAX                            "Vmax"
98
-#define MSG_X                               "x"
99
-#define MSG_Y                               "y"
100
-#define MSG_Z                               "z"
101
-#define MSG_E                               "e"
98
+#define MSG_X                               "X"
99
+#define MSG_Y                               "Y"
100
+#define MSG_Z                               "Z"
101
+#define MSG_E                               "E"
102 102
 #define MSG_VMIN                            "Vmin"
103 103
 #define MSG_VTRAV_MIN                       "Vdepl min"
104 104
 #define MSG_AMAX                            "Amax "

+ 4
- 4
Marlin/language_gl.h View File

@@ -92,10 +92,10 @@
92 92
 #define MSG_VZ_JERK                         "Vz-jerk"
93 93
 #define MSG_VE_JERK                         "Ve-jerk"
94 94
 #define MSG_VMAX                            "Vmax "
95
-#define MSG_X                               "x"
96
-#define MSG_Y                               "y"
97
-#define MSG_Z                               "z"
98
-#define MSG_E                               "e"
95
+#define MSG_X                               "X"
96
+#define MSG_Y                               "Y"
97
+#define MSG_Z                               "Z"
98
+#define MSG_E                               "E"
99 99
 #define MSG_VMIN                            "Vmin"
100 100
 #define MSG_VTRAV_MIN                       "VTrav min"
101 101
 #define MSG_AMAX                            "Amax "

+ 4
- 4
Marlin/language_it.h View File

@@ -94,10 +94,10 @@
94 94
 #define MSG_VZ_JERK                         "Vz-jerk"
95 95
 #define MSG_VE_JERK                         "Ve-jerk"
96 96
 #define MSG_VMAX                            "Vmax "
97
-#define MSG_X                               "x"
98
-#define MSG_Y                               "y"
99
-#define MSG_Z                               "z"
100
-#define MSG_E                               "e"
97
+#define MSG_X                               "X"
98
+#define MSG_Y                               "Y"
99
+#define MSG_Z                               "Z"
100
+#define MSG_E                               "E"
101 101
 #define MSG_VMIN                            "Vmin"
102 102
 #define MSG_VTRAV_MIN                       "VTrav min"
103 103
 #define MSG_AMAX                            "Amax "

+ 4
- 4
Marlin/language_nl.h View File

@@ -93,10 +93,10 @@
93 93
 #define MSG_VZ_JERK                         "Vz-jerk"
94 94
 #define MSG_VE_JERK                         "Ve-jerk"
95 95
 #define MSG_VMAX                            "Vmax "
96
-#define MSG_X                               "x"
97
-#define MSG_Y                               "y"
98
-#define MSG_Z                               "z"
99
-#define MSG_E                               "e"
96
+#define MSG_X                               "X"
97
+#define MSG_Y                               "Y"
98
+#define MSG_Z                               "Z"
99
+#define MSG_E                               "E"
100 100
 #define MSG_VMIN                            "Vmin"
101 101
 #define MSG_VTRAV_MIN                       "VTrav min"
102 102
 #define MSG_AMAX                            "Amax "

+ 4
- 4
Marlin/language_pl.h View File

@@ -93,10 +93,10 @@
93 93
 #define MSG_VZ_JERK                         "Zryw Vz"
94 94
 #define MSG_VE_JERK                         "Zryw Ve"
95 95
 #define MSG_VMAX                            "Vmax"
96
-#define MSG_X                               "x"
97
-#define MSG_Y                               "y"
98
-#define MSG_Z                               "z"
99
-#define MSG_E                               "e"
96
+#define MSG_X                               "X"
97
+#define MSG_Y                               "Y"
98
+#define MSG_Z                               "Z"
99
+#define MSG_E                               "E"
100 100
 #define MSG_VMIN                            "Vmin"
101 101
 #define MSG_VTRAV_MIN                       "Vskok min"
102 102
 #define MSG_AMAX                            "Amax"

+ 4
- 4
Marlin/language_pt-br.h View File

@@ -93,10 +93,10 @@
93 93
 #define MSG_VZ_JERK                         "jogo VZ"
94 94
 #define MSG_VE_JERK                         "jogo VE"
95 95
 #define MSG_VMAX                            " Vmax "
96
-#define MSG_X                               "x"
97
-#define MSG_Y                               "y"
98
-#define MSG_Z                               "z"
99
-#define MSG_E                               "e"
96
+#define MSG_X                               "X"
97
+#define MSG_Y                               "Y"
98
+#define MSG_Z                               "Z"
99
+#define MSG_E                               "E"
100 100
 #define MSG_VMIN                            "Vmin"
101 101
 #define MSG_VTRAV_MIN                       "VTrav min"
102 102
 #define MSG_AMAX                            "Amax "

+ 4
- 4
Marlin/language_pt-br_utf8.h View File

@@ -93,10 +93,10 @@
93 93
 #define MSG_VZ_JERK                         "jogo VZ"
94 94
 #define MSG_VE_JERK                         "jogo VE"
95 95
 #define MSG_VMAX                            " Vmax "
96
-#define MSG_X                               "x"
97
-#define MSG_Y                               "y"
98
-#define MSG_Z                               "z"
99
-#define MSG_E                               "e"
96
+#define MSG_X                               "X"
97
+#define MSG_Y                               "Y"
98
+#define MSG_Z                               "Z"
99
+#define MSG_E                               "E"
100 100
 #define MSG_VMIN                            "Vmin"
101 101
 #define MSG_VTRAV_MIN                       "VTrav min"
102 102
 #define MSG_AMAX                            "Amax "

+ 4
- 4
Marlin/language_pt.h View File

@@ -98,10 +98,10 @@
98 98
 #define MSG_VZ_JERK                         "Vz-jerk"
99 99
 #define MSG_VE_JERK                         "Ve-jerk"
100 100
 #define MSG_VMAX                            " Vmax "
101
-#define MSG_X                               "x"
102
-#define MSG_Y                               "y"
103
-#define MSG_Z                               "z"
104
-#define MSG_E                               "e"
101
+#define MSG_X                               "X"
102
+#define MSG_Y                               "Y"
103
+#define MSG_Z                               "Z"
104
+#define MSG_E                               "E"
105 105
 #define MSG_VMIN                            "Vmin"
106 106
 #define MSG_VTRAV_MIN                       "VTrav min"
107 107
 #define MSG_AMAX                            "Amax "

+ 4
- 4
Marlin/language_pt_utf8.h View File

@@ -98,10 +98,10 @@
98 98
 #define MSG_VZ_JERK                         "Vz-jerk"
99 99
 #define MSG_VE_JERK                         "Ve-jerk"
100 100
 #define MSG_VMAX                            " Vmax "
101
-#define MSG_X                               "x"
102
-#define MSG_Y                               "y"
103
-#define MSG_Z                               "z"
104
-#define MSG_E                               "e"
101
+#define MSG_X                               "X"
102
+#define MSG_Y                               "Y"
103
+#define MSG_Z                               "Z"
104
+#define MSG_E                               "E"
105 105
 #define MSG_VMIN                            "Vmin"
106 106
 #define MSG_VTRAV_MIN                       "VTrav min"
107 107
 #define MSG_AMAX                            "Amax "

+ 4
- 4
Marlin/language_ru.h View File

@@ -94,10 +94,10 @@
94 94
 #define MSG_VZ_JERK                         "Vz-jerk"
95 95
 #define MSG_VE_JERK                         "Ve-jerk"
96 96
 #define MSG_VMAX                            "Vmax "
97
-#define MSG_X                               "x"
98
-#define MSG_Y                               "y"
99
-#define MSG_Z                               "z"
100
-#define MSG_E                               "e"
97
+#define MSG_X                               "X"
98
+#define MSG_Y                               "Y"
99
+#define MSG_Z                               "Z"
100
+#define MSG_E                               "E"
101 101
 #define MSG_VMIN                            "Vmin"
102 102
 #define MSG_VTRAV_MIN                       "VTrav min"
103 103
 #define MSG_AMAX                            "Amax"

+ 21
- 40
Marlin/ultralcd_implementation_hitachi_HD44780.h View File

@@ -569,6 +569,23 @@ unsigned lcd_print(char c) { return charset_mapper(c); }
569 569
 
570 570
 #endif // SHOW_BOOTSCREEN
571 571
 
572
+FORCE_INLINE void _draw_axis_label(AxisEnum axis, const char *pstr, bool blink) {
573
+  if (blink)
574
+    lcd_printPGM(pstr);
575
+  else {
576
+    if (!axis_homed[axis])
577
+      lcd_printPGM(PSTR("?"));
578
+    else {
579
+      #if DISABLED(DISABLE_REDUCED_ACCURACY_WARNING)
580
+        if (!axis_known_position[axis])
581
+          lcd_printPGM(PSTR(" "));
582
+        else
583
+      #endif
584
+      lcd_printPGM(pstr);
585
+    }
586
+  }
587
+}
588
+
572 589
 /**
573 590
 Possible status screens:
574 591
 16x2   |000/000 B000/000|
@@ -692,36 +709,12 @@ static void lcd_implementation_status_screen() {
692 709
         // When axis is homed but axis_known_position is false the axis letters are blinking 'X' <-> ' '.
693 710
         // When everything is ok you see a constant 'X'.
694 711
 
695
-        if (blink)
696
-          lcd_printPGM(PSTR("X"));
697
-        else {
698
-          if (!axis_homed[X_AXIS])
699
-            lcd_printPGM(PSTR("?"));
700
-          else
701
-            #if DISABLED(DISABLE_REDUCED_ACCURACY_WARNING)
702
-              if (!axis_known_position[X_AXIS])
703
-                lcd_printPGM(PSTR(" "));
704
-              else
705
-            #endif
706
-            lcd_printPGM(PSTR("X"));
707
-        }
708
-
712
+        _draw_axis_label(X_AXIS, PSTR(MSG_X), blink);
709 713
         lcd.print(ftostr4sign(current_position[X_AXIS]));
710 714
 
711 715
         lcd_printPGM(PSTR(" "));
712
-        if (blink)
713
-          lcd_printPGM(PSTR("Y"));
714
-        else {
715
-          if (!axis_homed[Y_AXIS])
716
-            lcd_printPGM(PSTR("?"));
717
-          else
718
-            #if DISABLED(DISABLE_REDUCED_ACCURACY_WARNING)
719
-              if (!axis_known_position[Y_AXIS])
720
-                lcd_printPGM(PSTR(" "));
721
-              else
722
-            #endif
723
-            lcd_printPGM(PSTR("Y"));
724
-        }
716
+
717
+        _draw_axis_label(Y_AXIS, PSTR(MSG_Y), blink);
725 718
         lcd.print(ftostr4sign(current_position[Y_AXIS]));
726 719
 
727 720
       #endif // EXTRUDERS > 1 || TEMP_SENSOR_BED != 0
@@ -729,19 +722,7 @@ static void lcd_implementation_status_screen() {
729 722
     #endif // LCD_WIDTH >= 20
730 723
 
731 724
     lcd.setCursor(LCD_WIDTH - 8, 1);
732
-    if (blink)
733
-      lcd_printPGM(PSTR("Z"));
734
-    else {
735
-      if (!axis_homed[Z_AXIS])
736
-        lcd_printPGM(PSTR("?"));
737
-      else
738
-        #if DISABLED(DISABLE_REDUCED_ACCURACY_WARNING)
739
-          if (!axis_known_position[Z_AXIS])
740
-            lcd_printPGM(PSTR(" "));
741
-          else
742
-        #endif
743
-        lcd_printPGM(PSTR("Z"));
744
-    }
725
+    _draw_axis_label(Z_AXIS, PSTR(MSG_Z), blink);
745 726
     lcd.print(ftostr32sp(current_position[Z_AXIS] + 0.00001));
746 727
 
747 728
   #endif // LCD_HEIGHT > 2

Loading…
Cancel
Save