Quellcode durchsuchen

Changes for graphics displays

Replaced displaying "---" instead of the value of a coordinate when
unhomed or with reduced precision
with blinking the coordinate-prefix-character ('X','Y','Z').
For "unhomed" a '?' is shown every second second - until that axis is
homed. The value displayed is, as before the "---" where displayed, the
relative to the reset position coordinate value.
When the axis stepper was disabled, now we can display a hint on that,
by showing a blinking ' ' instead of the axis letter, when
WARN_REDUCED_ACCURACY is defined.

I suppose the code itself is here the better documentation.

A '+/-' character is in non of our charsets so i decided for a '?' for
now to reduce the work.
There is no additional space on the displays one could use to display
the information, so replacing something is the only option. As the axis
letters are totally redundant with their positions on the display they
contain the least information.
So my decision was to overwrite them.
AnHardt vor 9 Jahren
Ursprung
Commit
5b0f659355
2 geänderte Dateien mit 50 neuen und 16 gelöschten Zeilen
  1. 3
    1
      Marlin/Configuration.h
  2. 47
    15
      Marlin/dogm_lcd_implementation.h

+ 3
- 1
Marlin/Configuration.h Datei anzeigen

@@ -349,11 +349,13 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
349 349
 #define Z_ENABLE_ON 0
350 350
 #define E_ENABLE_ON 0 // For all extruders
351 351
 
352
-// Disables axis stepper immediately  when it's not being used.
352
+// Disables axis stepper immediately when it's not being used.
353 353
 // WARNING: When motors turn off there is a chance of losing position accuracy!
354 354
 #define DISABLE_X false
355 355
 #define DISABLE_Y false
356 356
 #define DISABLE_Z false
357
+// Warn on display about possibly reduced accuracy
358
+//#define WARN_REDUCED_ACCURACY
357 359
 
358 360
 // @section extruder
359 361
 

+ 47
- 15
Marlin/dogm_lcd_implementation.h Datei anzeigen

@@ -338,6 +338,9 @@ static void lcd_implementation_status_screen() {
338 338
     }
339 339
 
340 340
   // X, Y, Z-Coordinates
341
+  // Before homing the axis letters are blinking 'X' <-> '?'.
342
+  // When axis is homed but axis_known_position is false the axis letters are blinking 'X' <-> ' '.
343
+  // When everything is ok you see a constant 'X'.
341 344
   #define XYZ_BASELINE 38
342 345
   lcd_setFont(FONT_STATUSMENU);
343 346
 
@@ -348,32 +351,61 @@ static void lcd_implementation_status_screen() {
348 351
   #endif
349 352
   u8g.setColorIndex(0); // white on black
350 353
   u8g.setPrintPos(2, XYZ_BASELINE);
351
-  lcd_print('X');
354
+  if (blink & 1)
355
+    lcd_printPGM(PSTR("X"));
356
+  else {
357
+    if (!axis_homed[X_AXIS])
358
+      lcd_printPGM(PSTR("?"));
359
+    else
360
+      #if ENABLED(WARN_REDUCED_ACCURACY)
361
+        if (!axis_known_position[X_AXIS])
362
+          lcd_printPGM(PSTR(" "));
363
+        else
364
+      #endif
365
+      lcd_printPGM(PSTR("X"));
366
+  }
352 367
   u8g.drawPixel(8, XYZ_BASELINE - 5);
353 368
   u8g.drawPixel(8, XYZ_BASELINE - 3);
354 369
   u8g.setPrintPos(10, XYZ_BASELINE);
355
-  if (axis_homed[X_AXIS] || (blink & 1))
356
-    lcd_print(ftostr31ns(current_position[X_AXIS]));
357
-  else
358
-    lcd_printPGM(PSTR("---"));
370
+  lcd_print(ftostr31ns(current_position[X_AXIS]));
371
+
359 372
   u8g.setPrintPos(43, XYZ_BASELINE);
360
-  lcd_print('Y');
373
+  if (blink & 1)
374
+    lcd_printPGM(PSTR("Y"));
375
+  else {
376
+    if (!axis_homed[Y_AXIS])
377
+      lcd_printPGM(PSTR("?"));
378
+    else
379
+      #if ENABLED(WARN_REDUCED_ACCURACY)
380
+        if (!axis_known_position[Y_AXIS])
381
+          lcd_printPGM(PSTR(" "));
382
+        else
383
+      #endif
384
+      lcd_printPGM(PSTR("Y"));
385
+  }
361 386
   u8g.drawPixel(49, XYZ_BASELINE - 5);
362 387
   u8g.drawPixel(49, XYZ_BASELINE - 3);
363 388
   u8g.setPrintPos(51, XYZ_BASELINE);
364
-  if (axis_homed[Y_AXIS] || (blink & 1))
365
-    lcd_print(ftostr31ns(current_position[Y_AXIS]));
366
-  else
367
-    lcd_printPGM(PSTR("---"));
389
+  lcd_print(ftostr31ns(current_position[Y_AXIS]));
390
+
368 391
   u8g.setPrintPos(83, XYZ_BASELINE);
369
-  lcd_print('Z');
392
+  if (blink & 1)
393
+    lcd_printPGM(PSTR("Z"));
394
+  else {
395
+    if (!axis_homed[Z_AXIS])
396
+      lcd_printPGM(PSTR("?"));
397
+    else
398
+      #if ENABLED(WARN_REDUCED_ACCURACY)
399
+        if (!axis_known_position[Z_AXIS])
400
+          lcd_printPGM(PSTR(" "));
401
+        else
402
+      #endif
403
+      lcd_printPGM(PSTR("Z"));
404
+  }
370 405
   u8g.drawPixel(89, XYZ_BASELINE - 5);
371 406
   u8g.drawPixel(89, XYZ_BASELINE - 3);
372 407
   u8g.setPrintPos(91, XYZ_BASELINE);
373
-  if (axis_homed[Z_AXIS] || (blink & 1))
374
-    lcd_print(ftostr32sp(current_position[Z_AXIS]));
375
-  else
376
-    lcd_printPGM(PSTR("---.--"));
408
+  lcd_print(ftostr32sp(current_position[Z_AXIS]));
377 409
   u8g.setColorIndex(1); // black on white
378 410
 
379 411
   // Feedrate

Laden…
Abbrechen
Speichern