浏览代码

Merge pull request #3560 from thinkyhead/rc_better_graphical_lcd

Aesthetic, functional improvements for Graphical Display
Scott Lahteine 9 年前
父节点
当前提交
00d36d10e2

+ 2
- 2
Marlin/Conditionals.h 查看文件

218
   #endif
218
   #endif
219
 
219
 
220
   #if ENABLED(DOGLCD)
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
     // \x00 intentionally skipped to avoid problems in strings
222
     // \x00 intentionally skipped to avoid problems in strings
223
     #define LCD_STR_REFRESH     "\x01"
223
     #define LCD_STR_REFRESH     "\x01"
224
     #define LCD_STR_FOLDER      "\x02"
224
     #define LCD_STR_FOLDER      "\x02"
235
     // Better stay below 0x10 because DISPLAY_CHARSET_HD44780_WESTERN begins here.
235
     // Better stay below 0x10 because DISPLAY_CHARSET_HD44780_WESTERN begins here.
236
   #else
236
   #else
237
     /* Custom characters defined in the first 8 characters of the LCD */
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
     #define LCD_STR_DEGREE      "\x01"
239
     #define LCD_STR_DEGREE      "\x01"
240
     #define LCD_STR_THERMOMETER "\x02"
240
     #define LCD_STR_THERMOMETER "\x02"
241
     #define LCD_STR_UPLEVEL     "\x03"
241
     #define LCD_STR_UPLEVEL     "\x03"

+ 57
- 81
Marlin/dogm_lcd_implementation.h 查看文件

279
 
279
 
280
 static void lcd_implementation_clear() { } // Automatically cleared by Picture Loop
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
   lcd_printPGM(PSTR(LCD_STR_DEGREE " "));
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
     u8g.setColorIndex(0); // white on black
303
     u8g.setColorIndex(0); // white on black
299
-    u8g.drawBox(x + 7, y, 2, 2);
304
+    u8g.drawBox(x + h, y, 2, 2);
300
     u8g.setColorIndex(1); // black on white
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
 static void lcd_implementation_status_screen() {
329
 static void lcd_implementation_status_screen() {
315
     #endif
340
     #endif
316
   );
341
   );
317
 
342
 
343
+  // Status Menu Font for SD info, Heater status, Fan, XYZ
344
+  lcd_setFont(FONT_STATUSMENU);
345
+
318
   #if ENABLED(SDSUPPORT)
346
   #if ENABLED(SDSUPPORT)
319
     // SD Card Symbol
347
     // SD Card Symbol
320
     u8g.drawBox(42, 42 - (TALL_FONT_CORRECTION), 8, 7);
348
     u8g.drawBox(42, 42 - (TALL_FONT_CORRECTION), 8, 7);
326
     u8g.drawFrame(54, 49, 73, 4 - (TALL_FONT_CORRECTION));
354
     u8g.drawFrame(54, 49, 73, 4 - (TALL_FONT_CORRECTION));
327
 
355
 
328
     // SD Card Progress bar and clock
356
     // SD Card Progress bar and clock
329
-    lcd_setFont(FONT_STATUSMENU);
330
-
331
     if (IS_SD_PRINTING) {
357
     if (IS_SD_PRINTING) {
332
       // Progress bar solid part
358
       // Progress bar solid part
333
       u8g.drawBox(55, 50, (unsigned int)(71.f * card.percentDone() / 100.f), 2 - (TALL_FONT_CORRECTION));
359
       u8g.drawBox(55, 50, (unsigned int)(71.f * card.percentDone() / 100.f), 2 - (TALL_FONT_CORRECTION));
340
       lcd_print(':');
366
       lcd_print(':');
341
       lcd_print(itostr2(time%60));
367
       lcd_print(itostr2(time%60));
342
     }
368
     }
343
-    else {
344
-      lcd_printPGM(PSTR("--:--"));
345
-    }
346
   #endif
369
   #endif
347
 
370
 
348
   // Extruders
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
   // Fan
379
   // Fan
355
-  lcd_setFont(FONT_STATUSMENU);
356
   u8g.setPrintPos(104, 27);
380
   u8g.setPrintPos(104, 27);
357
   #if HAS_FAN0
381
   #if HAS_FAN0
358
     int per = ((fanSpeeds[0] + 1) * 100) / 256;
382
     int per = ((fanSpeeds[0] + 1) * 100) / 256;
360
       lcd_print(itostr3(per));
384
       lcd_print(itostr3(per));
361
       lcd_print('%');
385
       lcd_print('%');
362
     }
386
     }
363
-    else
364
   #endif
387
   #endif
365
-    {
366
-      lcd_printPGM(PSTR("---"));
367
-    }
368
 
388
 
369
   // X, Y, Z-Coordinates
389
   // X, Y, Z-Coordinates
370
   // Before homing the axis letters are blinking 'X' <-> '?'.
390
   // Before homing the axis letters are blinking 'X' <-> '?'.
371
   // When axis is homed but axis_known_position is false the axis letters are blinking 'X' <-> ' '.
391
   // When axis is homed but axis_known_position is false the axis letters are blinking 'X' <-> ' '.
372
   // When everything is ok you see a constant 'X'.
392
   // When everything is ok you see a constant 'X'.
373
   #define XYZ_BASELINE 38
393
   #define XYZ_BASELINE 38
374
-  lcd_setFont(FONT_STATUSMENU);
375
 
394
 
376
   #if ENABLED(USE_SMALL_INFOFONT)
395
   #if ENABLED(USE_SMALL_INFOFONT)
377
     u8g.drawBox(0, 30, LCD_PIXEL_WIDTH, 10);
396
     u8g.drawBox(0, 30, LCD_PIXEL_WIDTH, 10);
379
     u8g.drawBox(0, 30, LCD_PIXEL_WIDTH, 9);
398
     u8g.drawBox(0, 30, LCD_PIXEL_WIDTH, 9);
380
   #endif
399
   #endif
381
   u8g.setColorIndex(0); // white on black
400
   u8g.setColorIndex(0); // white on black
401
+
382
   u8g.setPrintPos(2, XYZ_BASELINE);
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
   u8g.setPrintPos(10, XYZ_BASELINE);
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
   u8g.setPrintPos(43, XYZ_BASELINE);
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
   u8g.setPrintPos(51, XYZ_BASELINE);
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
   u8g.setPrintPos(83, XYZ_BASELINE);
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
   u8g.setPrintPos(91, XYZ_BASELINE);
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
   u8g.setColorIndex(1); // black on white
417
   u8g.setColorIndex(1); // black on white
442
 
418
 
443
   // Feedrate
419
   // Feedrate
444
   lcd_setFont(FONT_MENU);
420
   lcd_setFont(FONT_MENU);
445
   u8g.setPrintPos(3, 49);
421
   u8g.setPrintPos(3, 49);
446
   lcd_print(LCD_STR_FEEDRATE[0]);
422
   lcd_print(LCD_STR_FEEDRATE[0]);
423
+
447
   lcd_setFont(FONT_STATUSMENU);
424
   lcd_setFont(FONT_STATUSMENU);
448
   u8g.setPrintPos(12, 49);
425
   u8g.setPrintPos(12, 49);
449
   lcd_print(itostr3(feedrate_multiplier));
426
   lcd_print(itostr3(feedrate_multiplier));
450
   lcd_print('%');
427
   lcd_print('%');
451
 
428
 
452
   // Status line
429
   // Status line
453
-  lcd_setFont(FONT_STATUSMENU);
454
   #if ENABLED(USE_SMALL_INFOFONT)
430
   #if ENABLED(USE_SMALL_INFOFONT)
455
     u8g.setPrintPos(0, 62);
431
     u8g.setPrintPos(0, 62);
456
   #else
432
   #else

+ 0
- 23
Marlin/fonts/README.fonts 查看文件

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 查看文件

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 查看文件

93
 #define MSG_VZ_JERK                         "Vz-jerk"
93
 #define MSG_VZ_JERK                         "Vz-jerk"
94
 #define MSG_VE_JERK                         "Ves-jerk"
94
 #define MSG_VE_JERK                         "Ves-jerk"
95
 #define MSG_VMAX                            "Vmax"
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
 #define MSG_VMIN                            "Vmin"
100
 #define MSG_VMIN                            "Vmin"
101
 #define MSG_VTRAV_MIN                       "VTrav min"
101
 #define MSG_VTRAV_MIN                       "VTrav min"
102
 #define MSG_AMAX                            "Amax"
102
 #define MSG_AMAX                            "Amax"

+ 4
- 4
Marlin/language_bg.h 查看文件

94
 #define MSG_VZ_JERK                         "Vz-jerk"
94
 #define MSG_VZ_JERK                         "Vz-jerk"
95
 #define MSG_VE_JERK                         "Ve-jerk"
95
 #define MSG_VE_JERK                         "Ve-jerk"
96
 #define MSG_VMAX                            "Vmax "
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
 #define MSG_VMIN                            "Vmin"
101
 #define MSG_VMIN                            "Vmin"
102
 #define MSG_VTRAV_MIN                       "VTrav min"
102
 #define MSG_VTRAV_MIN                       "VTrav min"
103
 #define MSG_AMAX                            "Amax "
103
 #define MSG_AMAX                            "Amax "

+ 4
- 4
Marlin/language_ca.h 查看文件

94
 #define MSG_VZ_JERK                         "Vz-jerk"
94
 #define MSG_VZ_JERK                         "Vz-jerk"
95
 #define MSG_VE_JERK                         "Ve-jerk"
95
 #define MSG_VE_JERK                         "Ve-jerk"
96
 #define MSG_VMAX                            "Vmax "
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
 #define MSG_VMIN                            "Vmin"
101
 #define MSG_VMIN                            "Vmin"
102
 #define MSG_VTRAV_MIN                       "VTrav min"
102
 #define MSG_VTRAV_MIN                       "VTrav min"
103
 #define MSG_AMAX                            "Amax "
103
 #define MSG_AMAX                            "Amax "

+ 4
- 4
Marlin/language_cn.h 查看文件

92
 #define MSG_VZ_JERK                         "Vz-jerk"
92
 #define MSG_VZ_JERK                         "Vz-jerk"
93
 #define MSG_VE_JERK                         "Ve-jerk"
93
 #define MSG_VE_JERK                         "Ve-jerk"
94
 #define MSG_VMAX                            "Vmax "
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
 #define MSG_VMIN                            "Vmin"
99
 #define MSG_VMIN                            "Vmin"
100
 #define MSG_VTRAV_MIN                       "VTrav min"
100
 #define MSG_VTRAV_MIN                       "VTrav min"
101
 #define MSG_AMAX                            "Amax "
101
 #define MSG_AMAX                            "Amax "

+ 4
- 4
Marlin/language_cz.h 查看文件

99
 #define MSG_VZ_JERK                         "Vz-jerk"
99
 #define MSG_VZ_JERK                         "Vz-jerk"
100
 #define MSG_VE_JERK                         "Ve-jerk"
100
 #define MSG_VE_JERK                         "Ve-jerk"
101
 #define MSG_VMAX                            "Vmax "
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
 #define MSG_VMIN                            "Vmin"
106
 #define MSG_VMIN                            "Vmin"
107
 #define MSG_VTRAV_MIN                       "VTrav min"
107
 #define MSG_VTRAV_MIN                       "VTrav min"
108
 #define MSG_AMAX                            "Amax "
108
 #define MSG_AMAX                            "Amax "

+ 4
- 4
Marlin/language_da.h 查看文件

95
 #define MSG_VZ_JERK                         "Vz-jerk"
95
 #define MSG_VZ_JERK                         "Vz-jerk"
96
 #define MSG_VE_JERK                         "Ve-jerk"
96
 #define MSG_VE_JERK                         "Ve-jerk"
97
 #define MSG_VMAX                            "Vmax "
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
 #define MSG_VMIN                            "Vmin"
102
 #define MSG_VMIN                            "Vmin"
103
 #define MSG_VTRAV_MIN                       "VTrav min"
103
 #define MSG_VTRAV_MIN                       "VTrav min"
104
 #define MSG_AMAX                            "Amax "
104
 #define MSG_AMAX                            "Amax "

+ 4
- 4
Marlin/language_de.h 查看文件

95
 #define MSG_VZ_JERK                         "V z  Ruck"
95
 #define MSG_VZ_JERK                         "V z  Ruck"
96
 #define MSG_VE_JERK                         "V e  Ruck"
96
 #define MSG_VE_JERK                         "V e  Ruck"
97
 #define MSG_VMAX                            "V max " // space by purpose
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
 #define MSG_VMIN                            "V min"
102
 #define MSG_VMIN                            "V min"
103
 #define MSG_VTRAV_MIN                       "VTrav min"
103
 #define MSG_VTRAV_MIN                       "VTrav min"
104
 #define MSG_AMAX                            "A max " // space by purpose
104
 #define MSG_AMAX                            "A max " // space by purpose

+ 4
- 4
Marlin/language_en.h 查看文件

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

+ 4
- 4
Marlin/language_es.h 查看文件

94
 #define MSG_VZ_JERK                         "Vz-jerk"
94
 #define MSG_VZ_JERK                         "Vz-jerk"
95
 #define MSG_VE_JERK                         "Ve-jerk"
95
 #define MSG_VE_JERK                         "Ve-jerk"
96
 #define MSG_VMAX                            "Vmax"
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
 #define MSG_VMIN                            "Vmin"
101
 #define MSG_VMIN                            "Vmin"
102
 #define MSG_VTRAV_MIN                       "Vel. viaje min"
102
 #define MSG_VTRAV_MIN                       "Vel. viaje min"
103
 #define MSG_AMAX                            "Acel. max"
103
 #define MSG_AMAX                            "Acel. max"

+ 4
- 4
Marlin/language_eu.h 查看文件

93
 #define MSG_VZ_JERK                         "Vz-astindua"
93
 #define MSG_VZ_JERK                         "Vz-astindua"
94
 #define MSG_VE_JERK                         "Ve-astindua"
94
 #define MSG_VE_JERK                         "Ve-astindua"
95
 #define MSG_VMAX                            "Vmax "
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
 #define MSG_VMIN                            "Vmin"
100
 #define MSG_VMIN                            "Vmin"
101
 #define MSG_VTRAV_MIN                       "VTrav min"
101
 #define MSG_VTRAV_MIN                       "VTrav min"
102
 #define MSG_AMAX                            "Amax "
102
 #define MSG_AMAX                            "Amax "

+ 4
- 4
Marlin/language_fi.h 查看文件

93
 #define MSG_VZ_JERK                         "Vz-jerk"
93
 #define MSG_VZ_JERK                         "Vz-jerk"
94
 #define MSG_VE_JERK                         "Ve-jerk"
94
 #define MSG_VE_JERK                         "Ve-jerk"
95
 #define MSG_VMAX                            "Vmax "
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
 #define MSG_VMIN                            "Vmin"
100
 #define MSG_VMIN                            "Vmin"
101
 #define MSG_VTRAV_MIN                       "VLiike min"
101
 #define MSG_VTRAV_MIN                       "VLiike min"
102
 #define MSG_AMAX                            "Amax "
102
 #define MSG_AMAX                            "Amax "

+ 4
- 4
Marlin/language_fr.h 查看文件

95
 #define MSG_VZ_JERK                         "Vz-jerk"
95
 #define MSG_VZ_JERK                         "Vz-jerk"
96
 #define MSG_VE_JERK                         "Ve-jerk"
96
 #define MSG_VE_JERK                         "Ve-jerk"
97
 #define MSG_VMAX                            "Vmax"
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
 #define MSG_VMIN                            "Vmin"
102
 #define MSG_VMIN                            "Vmin"
103
 #define MSG_VTRAV_MIN                       "Vdepl min"
103
 #define MSG_VTRAV_MIN                       "Vdepl min"
104
 #define MSG_AMAX                            "Amax "
104
 #define MSG_AMAX                            "Amax "

+ 4
- 4
Marlin/language_gl.h 查看文件

92
 #define MSG_VZ_JERK                         "Vz-jerk"
92
 #define MSG_VZ_JERK                         "Vz-jerk"
93
 #define MSG_VE_JERK                         "Ve-jerk"
93
 #define MSG_VE_JERK                         "Ve-jerk"
94
 #define MSG_VMAX                            "Vmax "
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
 #define MSG_VMIN                            "Vmin"
99
 #define MSG_VMIN                            "Vmin"
100
 #define MSG_VTRAV_MIN                       "VTrav min"
100
 #define MSG_VTRAV_MIN                       "VTrav min"
101
 #define MSG_AMAX                            "Amax "
101
 #define MSG_AMAX                            "Amax "

+ 4
- 4
Marlin/language_it.h 查看文件

94
 #define MSG_VZ_JERK                         "Vz-jerk"
94
 #define MSG_VZ_JERK                         "Vz-jerk"
95
 #define MSG_VE_JERK                         "Ve-jerk"
95
 #define MSG_VE_JERK                         "Ve-jerk"
96
 #define MSG_VMAX                            "Vmax "
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
 #define MSG_VMIN                            "Vmin"
101
 #define MSG_VMIN                            "Vmin"
102
 #define MSG_VTRAV_MIN                       "VTrav min"
102
 #define MSG_VTRAV_MIN                       "VTrav min"
103
 #define MSG_AMAX                            "Amax "
103
 #define MSG_AMAX                            "Amax "

+ 4
- 4
Marlin/language_nl.h 查看文件

93
 #define MSG_VZ_JERK                         "Vz-jerk"
93
 #define MSG_VZ_JERK                         "Vz-jerk"
94
 #define MSG_VE_JERK                         "Ve-jerk"
94
 #define MSG_VE_JERK                         "Ve-jerk"
95
 #define MSG_VMAX                            "Vmax "
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
 #define MSG_VMIN                            "Vmin"
100
 #define MSG_VMIN                            "Vmin"
101
 #define MSG_VTRAV_MIN                       "VTrav min"
101
 #define MSG_VTRAV_MIN                       "VTrav min"
102
 #define MSG_AMAX                            "Amax "
102
 #define MSG_AMAX                            "Amax "

+ 4
- 4
Marlin/language_pl.h 查看文件

93
 #define MSG_VZ_JERK                         "Zryw Vz"
93
 #define MSG_VZ_JERK                         "Zryw Vz"
94
 #define MSG_VE_JERK                         "Zryw Ve"
94
 #define MSG_VE_JERK                         "Zryw Ve"
95
 #define MSG_VMAX                            "Vmax"
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
 #define MSG_VMIN                            "Vmin"
100
 #define MSG_VMIN                            "Vmin"
101
 #define MSG_VTRAV_MIN                       "Vskok min"
101
 #define MSG_VTRAV_MIN                       "Vskok min"
102
 #define MSG_AMAX                            "Amax"
102
 #define MSG_AMAX                            "Amax"

+ 4
- 4
Marlin/language_pt-br.h 查看文件

93
 #define MSG_VZ_JERK                         "jogo VZ"
93
 #define MSG_VZ_JERK                         "jogo VZ"
94
 #define MSG_VE_JERK                         "jogo VE"
94
 #define MSG_VE_JERK                         "jogo VE"
95
 #define MSG_VMAX                            " Vmax "
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
 #define MSG_VMIN                            "Vmin"
100
 #define MSG_VMIN                            "Vmin"
101
 #define MSG_VTRAV_MIN                       "VTrav min"
101
 #define MSG_VTRAV_MIN                       "VTrav min"
102
 #define MSG_AMAX                            "Amax "
102
 #define MSG_AMAX                            "Amax "

+ 4
- 4
Marlin/language_pt-br_utf8.h 查看文件

93
 #define MSG_VZ_JERK                         "jogo VZ"
93
 #define MSG_VZ_JERK                         "jogo VZ"
94
 #define MSG_VE_JERK                         "jogo VE"
94
 #define MSG_VE_JERK                         "jogo VE"
95
 #define MSG_VMAX                            " Vmax "
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
 #define MSG_VMIN                            "Vmin"
100
 #define MSG_VMIN                            "Vmin"
101
 #define MSG_VTRAV_MIN                       "VTrav min"
101
 #define MSG_VTRAV_MIN                       "VTrav min"
102
 #define MSG_AMAX                            "Amax "
102
 #define MSG_AMAX                            "Amax "

+ 4
- 4
Marlin/language_pt.h 查看文件

98
 #define MSG_VZ_JERK                         "Vz-jerk"
98
 #define MSG_VZ_JERK                         "Vz-jerk"
99
 #define MSG_VE_JERK                         "Ve-jerk"
99
 #define MSG_VE_JERK                         "Ve-jerk"
100
 #define MSG_VMAX                            " Vmax "
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
 #define MSG_VMIN                            "Vmin"
105
 #define MSG_VMIN                            "Vmin"
106
 #define MSG_VTRAV_MIN                       "VTrav min"
106
 #define MSG_VTRAV_MIN                       "VTrav min"
107
 #define MSG_AMAX                            "Amax "
107
 #define MSG_AMAX                            "Amax "

+ 4
- 4
Marlin/language_pt_utf8.h 查看文件

98
 #define MSG_VZ_JERK                         "Vz-jerk"
98
 #define MSG_VZ_JERK                         "Vz-jerk"
99
 #define MSG_VE_JERK                         "Ve-jerk"
99
 #define MSG_VE_JERK                         "Ve-jerk"
100
 #define MSG_VMAX                            " Vmax "
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
 #define MSG_VMIN                            "Vmin"
105
 #define MSG_VMIN                            "Vmin"
106
 #define MSG_VTRAV_MIN                       "VTrav min"
106
 #define MSG_VTRAV_MIN                       "VTrav min"
107
 #define MSG_AMAX                            "Amax "
107
 #define MSG_AMAX                            "Amax "

+ 4
- 4
Marlin/language_ru.h 查看文件

94
 #define MSG_VZ_JERK                         "Vz-jerk"
94
 #define MSG_VZ_JERK                         "Vz-jerk"
95
 #define MSG_VE_JERK                         "Ve-jerk"
95
 #define MSG_VE_JERK                         "Ve-jerk"
96
 #define MSG_VMAX                            "Vmax "
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
 #define MSG_VMIN                            "Vmin"
101
 #define MSG_VMIN                            "Vmin"
102
 #define MSG_VTRAV_MIN                       "VTrav min"
102
 #define MSG_VTRAV_MIN                       "VTrav min"
103
 #define MSG_AMAX                            "Amax"
103
 #define MSG_AMAX                            "Amax"

+ 21
- 40
Marlin/ultralcd_implementation_hitachi_HD44780.h 查看文件

569
 
569
 
570
 #endif // SHOW_BOOTSCREEN
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
 Possible status screens:
590
 Possible status screens:
574
 16x2   |000/000 B000/000|
591
 16x2   |000/000 B000/000|
692
         // When axis is homed but axis_known_position is false the axis letters are blinking 'X' <-> ' '.
709
         // When axis is homed but axis_known_position is false the axis letters are blinking 'X' <-> ' '.
693
         // When everything is ok you see a constant 'X'.
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
         lcd.print(ftostr4sign(current_position[X_AXIS]));
713
         lcd.print(ftostr4sign(current_position[X_AXIS]));
710
 
714
 
711
         lcd_printPGM(PSTR(" "));
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
         lcd.print(ftostr4sign(current_position[Y_AXIS]));
718
         lcd.print(ftostr4sign(current_position[Y_AXIS]));
726
 
719
 
727
       #endif // EXTRUDERS > 1 || TEMP_SENSOR_BED != 0
720
       #endif // EXTRUDERS > 1 || TEMP_SENSOR_BED != 0
729
     #endif // LCD_WIDTH >= 20
722
     #endif // LCD_WIDTH >= 20
730
 
723
 
731
     lcd.setCursor(LCD_WIDTH - 8, 1);
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
     lcd.print(ftostr32sp(current_position[Z_AXIS] + 0.00001));
726
     lcd.print(ftostr32sp(current_position[Z_AXIS] + 0.00001));
746
 
727
 
747
   #endif // LCD_HEIGHT > 2
728
   #endif // LCD_HEIGHT > 2

正在加载...
取消
保存