|
@@ -38,10 +38,11 @@
|
38
|
38
|
#include "../../module/motion.h"
|
39
|
39
|
#include "../../module/temperature.h"
|
40
|
40
|
|
|
41
|
+#include "../../gcode/parser.h" // for units (and volumetric)
|
|
42
|
+
|
41
|
43
|
#if ENABLED(FILAMENT_LCD_DISPLAY)
|
42
|
44
|
#include "../../feature/filwidth.h"
|
43
|
45
|
#include "../../module/planner.h"
|
44
|
|
- #include "../../gcode/parser.h"
|
45
|
46
|
#endif
|
46
|
47
|
|
47
|
48
|
#if HAS_CUTTER
|
|
@@ -67,6 +68,11 @@
|
67
|
68
|
#define X_LABEL_POS 3
|
68
|
69
|
#define X_VALUE_POS 11
|
69
|
70
|
#define XYZ_SPACING 37
|
|
71
|
+
|
|
72
|
+#define X_LABEL_POS_IN (X_LABEL_POS - 2)
|
|
73
|
+#define X_VALUE_POS_IN (X_VALUE_POS - 5)
|
|
74
|
+#define XYZ_SPACING_IN (XYZ_SPACING + 9)
|
|
75
|
+
|
70
|
76
|
#define XYZ_BASELINE (30 + INFO_FONT_ASCENT)
|
71
|
77
|
#define EXTRAS_BASELINE (40 + INFO_FONT_ASCENT)
|
72
|
78
|
#define STATUS_BASELINE (LCD_PIXEL_HEIGHT - INFO_FONT_DESCENT)
|
|
@@ -370,10 +376,12 @@ FORCE_INLINE void _draw_centered_temp(const int16_t temp, const uint8_t tx, cons
|
370
|
376
|
// Homed and known, display constantly.
|
371
|
377
|
//
|
372
|
378
|
FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const bool blink) {
|
|
379
|
+ const bool is_inch = parser.using_inch_units();
|
373
|
380
|
const AxisEnum a = TERN(LCD_SHOW_E_TOTAL, axis == E_AXIS ? X_AXIS : axis, axis);
|
374
|
|
- const uint8_t offs = (XYZ_SPACING) * a;
|
375
|
|
- lcd_put_wchar(X_LABEL_POS + offs, XYZ_BASELINE, axis_codes[axis]);
|
376
|
|
- lcd_moveto(X_VALUE_POS + offs, XYZ_BASELINE);
|
|
381
|
+ const uint8_t offs = a * (is_inch ? XYZ_SPACING_IN : XYZ_SPACING);
|
|
382
|
+ lcd_put_wchar((is_inch ? X_LABEL_POS_IN : X_LABEL_POS) + offs, XYZ_BASELINE, axis_codes[axis]);
|
|
383
|
+ lcd_moveto((is_inch ? X_VALUE_POS_IN : X_VALUE_POS) + offs, XYZ_BASELINE);
|
|
384
|
+
|
377
|
385
|
if (blink)
|
378
|
386
|
lcd_put_u8str(value);
|
379
|
387
|
else {
|
|
@@ -390,9 +398,16 @@ FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const
|
390
|
398
|
}
|
391
|
399
|
}
|
392
|
400
|
|
|
401
|
+/**
|
|
402
|
+ * Draw the Status Screen for a 128x64 DOGM (U8glib) display.
|
|
403
|
+ *
|
|
404
|
+ * Called as needed to update the current display stripe.
|
|
405
|
+ * Use the PAGE_CONTAINS macros to avoid pointless draw calls.
|
|
406
|
+ */
|
393
|
407
|
void MarlinUI::draw_status_screen() {
|
|
408
|
+ constexpr int xystorage = TERN(INCH_MODE_SUPPORT, 8, 5);
|
|
409
|
+ static char xstring[TERN(LCD_SHOW_E_TOTAL, 12, xystorage)], ystring[xystorage], zstring[8];
|
394
|
410
|
|
395
|
|
- static char xstring[TERN(LCD_SHOW_E_TOTAL, 12, 5)], ystring[5], zstring[8];
|
396
|
411
|
#if ENABLED(FILAMENT_LCD_DISPLAY)
|
397
|
412
|
static char wstring[5], mstring[4];
|
398
|
413
|
#endif
|
|
@@ -439,7 +454,8 @@ void MarlinUI::draw_status_screen() {
|
439
|
454
|
#endif
|
440
|
455
|
|
441
|
456
|
const xyz_pos_t lpos = current_position.asLogical();
|
442
|
|
- strcpy(zstring, ftostr52sp(lpos.z));
|
|
457
|
+ const bool is_inch = parser.using_inch_units();
|
|
458
|
+ strcpy(zstring, is_inch ? ftostr42_52(LINEAR_UNIT(lpos.z)) : ftostr52sp(lpos.z));
|
443
|
459
|
|
444
|
460
|
if (show_e_total) {
|
445
|
461
|
#if ENABLED(LCD_SHOW_E_TOTAL)
|
|
@@ -448,8 +464,8 @@ void MarlinUI::draw_status_screen() {
|
448
|
464
|
#endif
|
449
|
465
|
}
|
450
|
466
|
else {
|
451
|
|
- strcpy(xstring, ftostr4sign(lpos.x));
|
452
|
|
- strcpy(ystring, ftostr4sign(lpos.y));
|
|
467
|
+ strcpy(xstring, is_inch ? ftostr53_63(LINEAR_UNIT(lpos.x)) : ftostr4sign(lpos.x));
|
|
468
|
+ strcpy(ystring, is_inch ? ftostr53_63(LINEAR_UNIT(lpos.y)) : ftostr4sign(lpos.y));
|
453
|
469
|
}
|
454
|
470
|
|
455
|
471
|
#if ENABLED(FILAMENT_LCD_DISPLAY)
|
|
@@ -854,6 +870,9 @@ void MarlinUI::draw_status_screen() {
|
854
|
870
|
}
|
855
|
871
|
}
|
856
|
872
|
|
|
873
|
+/**
|
|
874
|
+ * Draw the Status Message area
|
|
875
|
+ */
|
857
|
876
|
void MarlinUI::draw_status_message(const bool blink) {
|
858
|
877
|
|
859
|
878
|
// Get the UTF8 character count of the string
|