Sfoglia il codice sorgente

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 9 anni fa
parent
commit
5b0f659355
2 ha cambiato i file con 50 aggiunte e 16 eliminazioni
  1. 3
    1
      Marlin/Configuration.h
  2. 47
    15
      Marlin/dogm_lcd_implementation.h

+ 3
- 1
Marlin/Configuration.h Vedi File

349
 #define Z_ENABLE_ON 0
349
 #define Z_ENABLE_ON 0
350
 #define E_ENABLE_ON 0 // For all extruders
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
 // WARNING: When motors turn off there is a chance of losing position accuracy!
353
 // WARNING: When motors turn off there is a chance of losing position accuracy!
354
 #define DISABLE_X false
354
 #define DISABLE_X false
355
 #define DISABLE_Y false
355
 #define DISABLE_Y false
356
 #define DISABLE_Z false
356
 #define DISABLE_Z false
357
+// Warn on display about possibly reduced accuracy
358
+//#define WARN_REDUCED_ACCURACY
357
 
359
 
358
 // @section extruder
360
 // @section extruder
359
 
361
 

+ 47
- 15
Marlin/dogm_lcd_implementation.h Vedi File

338
     }
338
     }
339
 
339
 
340
   // X, Y, Z-Coordinates
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
   #define XYZ_BASELINE 38
344
   #define XYZ_BASELINE 38
342
   lcd_setFont(FONT_STATUSMENU);
345
   lcd_setFont(FONT_STATUSMENU);
343
 
346
 
348
   #endif
351
   #endif
349
   u8g.setColorIndex(0); // white on black
352
   u8g.setColorIndex(0); // white on black
350
   u8g.setPrintPos(2, XYZ_BASELINE);
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
   u8g.drawPixel(8, XYZ_BASELINE - 5);
367
   u8g.drawPixel(8, XYZ_BASELINE - 5);
353
   u8g.drawPixel(8, XYZ_BASELINE - 3);
368
   u8g.drawPixel(8, XYZ_BASELINE - 3);
354
   u8g.setPrintPos(10, XYZ_BASELINE);
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
   u8g.setPrintPos(43, XYZ_BASELINE);
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
   u8g.drawPixel(49, XYZ_BASELINE - 5);
386
   u8g.drawPixel(49, XYZ_BASELINE - 5);
362
   u8g.drawPixel(49, XYZ_BASELINE - 3);
387
   u8g.drawPixel(49, XYZ_BASELINE - 3);
363
   u8g.setPrintPos(51, XYZ_BASELINE);
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
   u8g.setPrintPos(83, XYZ_BASELINE);
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
   u8g.drawPixel(89, XYZ_BASELINE - 5);
405
   u8g.drawPixel(89, XYZ_BASELINE - 5);
371
   u8g.drawPixel(89, XYZ_BASELINE - 3);
406
   u8g.drawPixel(89, XYZ_BASELINE - 3);
372
   u8g.setPrintPos(91, XYZ_BASELINE);
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
   u8g.setColorIndex(1); // black on white
409
   u8g.setColorIndex(1); // black on white
378
 
410
 
379
   // Feedrate
411
   // Feedrate

Loading…
Annulla
Salva