@@ -92,7 +92,9 @@ static void drawCurStepValue() {
92
92
tft.canvas (motionAxisState.stepValuePos .x , motionAxisState.stepValuePos .y , CUR_STEP_VALUE_WIDTH, 20 );
93
93
tft.set_background (COLOR_BACKGROUND);
94
94
tft.add_text (CUR_STEP_VALUE_WIDTH - tft_string.width (), 0 , COLOR_AXIS_HOMED, tft_string);
95
+
95
96
tft.queue .sync ();
97
+
96
98
tft_string.set (F (" mm" ));
97
99
tft.canvas (motionAxisState.stepValuePos .x , motionAxisState.stepValuePos .y + 20 , CUR_STEP_VALUE_WIDTH, 20 );
98
100
tft.set_background (COLOR_BACKGROUND);
@@ -105,7 +107,9 @@ static void drawCurStepValue() {
105
107
tft.canvas (motionAxisState.zTypePos .x , motionAxisState.zTypePos .y , tft_string.width (), 20 );
106
108
tft.set_background (COLOR_BACKGROUND);
107
109
tft.add_text (0 , 0 , Z_BTN_COLOR, tft_string);
110
+
108
111
tft.queue .sync ();
112
+
109
113
tft_string.set (F (" Offset" ));
110
114
tft.canvas (motionAxisState.zTypePos .x , motionAxisState.zTypePos .y + 34 , tft_string.width (), 20 );
111
115
tft.set_background (COLOR_BACKGROUND);
@@ -289,9 +293,9 @@ static void moveAxis(const AxisEnum axis, const int8_t direction) {
289
293
// Disable touch until home is done
290
294
touch.disable ();
291
295
TERN_ (HAS_EXTRUDERS, drawAxisValue (E_AXIS));
292
- TERN_ (HAS_X_AXIS, drawAxisValue (X_AXIS));
293
- TERN_ (HAS_Y_AXIS, drawAxisValue (Y_AXIS));
294
- TERN_ (HAS_Z_AXIS, drawAxisValue (Z_AXIS));
296
+ TERN_ (HAS_X_AXIS, drawAxisValue (X_AXIS));
297
+ TERN_ (HAS_Y_AXIS, drawAxisValue (Y_AXIS));
298
+ TERN_ (HAS_Z_AXIS, drawAxisValue (Z_AXIS));
295
299
}
296
300
297
301
static void step_size () {
@@ -358,7 +362,10 @@ void MarlinUI::move_axis_screen() {
358
362
359
363
#if ENABLED(TFT_COLOR_UI_PORTRAIT)
360
364
361
- // ROW 1 -> E+ Y+ Z+
365
+ /* *************************************************************************
366
+ * ROW 1: | [E+] | [Y+] | [Z+] |
367
+ *************************************************************************/
368
+
362
369
int x = X_MARGIN, y = Y_MARGIN, spacing = 0 ;
363
370
364
371
TERN_ (HAS_EXTRUDERS, drawBtn (x, y, " E+" , (intptr_t )e_plus, imgUp, E_BTN_COLOR, !busy));
@@ -376,7 +383,10 @@ void MarlinUI::move_axis_screen() {
376
383
drawBtn (x, y, " Z+" , (intptr_t )z_plus, imgUp, Z_BTN_COLOR, !busy || ENABLED (BABYSTEP_ZPROBE_OFFSET)); // Only enabled when not busy or have baby step
377
384
#endif
378
385
379
- // ROW 2 -> "Ex" CurY "Z"
386
+ /* *************************************************************************
387
+ * ROW 2: | "Ex" | Current Y | "Z" |
388
+ *************************************************************************/
389
+
380
390
x = X_MARGIN;
381
391
y += BTN_HEIGHT + 2 ;
382
392
@@ -396,7 +406,10 @@ void MarlinUI::move_axis_screen() {
396
406
drawCurZSelection ();
397
407
#endif
398
408
399
- // ROW 3 -> X- HOME X+
409
+ /* *************************************************************************
410
+ * ROW 3: | [X-] | [Home] | [X+] | "Z" |
411
+ *************************************************************************/
412
+
400
413
y += (TFT_HEIGHT - Y_MARGIN * 2 - 4 * BTN_HEIGHT) / 3 - 2 ;
401
414
x = X_MARGIN;
402
415
@@ -410,22 +423,28 @@ void MarlinUI::move_axis_screen() {
410
423
if (!busy) touch.add_control (BUTTON, x, y, BTN_WIDTH, 34 * 2 , (intptr_t )z_select);
411
424
#endif
412
425
413
- // ROW 4 -> Cur X
426
+ /* *************************************************************************
427
+ * ROW 4: | Current X |
428
+ *************************************************************************/
429
+
414
430
y += BTN_HEIGHT + 2 ;
415
431
416
432
#if HAS_X_AXIS
417
433
motionAxisState.xValuePos .set (x, y);
418
434
drawAxisValue (X_AXIS);
419
435
#endif
420
436
421
- // ROW 5 -> E- CurX Y- Z-
437
+ /* *************************************************************************
438
+ * ROW 5: | [E-] | [Y-] | [Z-] |
439
+ *************************************************************************/
440
+
422
441
y += (TFT_HEIGHT - Y_MARGIN * 2 - 4 * BTN_HEIGHT) / 3 - 2 ;
423
442
x = X_MARGIN;
424
443
425
444
#if HAS_EXTRUDERS
426
445
drawBtn (x, y, " E-" , (intptr_t )e_minus, imgDown, E_BTN_COLOR, !busy);
427
446
motionAxisState.eValuePos .set (x, y + BTN_HEIGHT + 2 );
428
- TERN_ (HAS_EXTRUDERS, drawAxisValue (E_AXIS) );
447
+ drawAxisValue (E_AXIS);
429
448
#endif
430
449
431
450
x += BTN_WIDTH + spacing;
@@ -435,12 +454,15 @@ void MarlinUI::move_axis_screen() {
435
454
x += BTN_WIDTH + spacing;
436
455
437
456
#if HAS_Z_AXIS
438
- drawBtn (x, y, " Z-" , (intptr_t )z_minus, imgDown, Z_BTN_COLOR, !busy || ENABLED (BABYSTEP_ZPROBE_OFFSET)); // only enabled when not busy or have baby step
457
+ drawBtn (x, y, " Z-" , (intptr_t )z_minus, imgDown, Z_BTN_COLOR, !busy || ENABLED (BABYSTEP_ZPROBE_OFFSET)); // Only enabled when not busy or have baby step
439
458
motionAxisState.zValuePos .set (x, y + BTN_HEIGHT + 2 );
440
459
drawAxisValue (Z_AXIS);
441
460
#endif
442
461
443
- // ROW 6 -> step_size disable steppers back
462
+ /* *************************************************************************
463
+ * ROW 6: | Step Size | [Disable Steppers] | [Back] |
464
+ *************************************************************************/
465
+
444
466
y = TFT_HEIGHT - Y_MARGIN - BTN_HEIGHT;
445
467
x = zplus_x - CUR_STEP_VALUE_WIDTH - 10 ;
446
468
motionAxisState.stepValuePos .set (X_MARGIN + BTN_WIDTH - CUR_STEP_VALUE_WIDTH, y);
@@ -455,7 +477,10 @@ void MarlinUI::move_axis_screen() {
455
477
456
478
#else // !TFT_COLOR_UI_PORTRAIT
457
479
458
- // ROW 1 -> E+ Y+ CurY Z+
480
+ /* *************************************************************************
481
+ * ROW 1: | [E+] | [Y+] | Current Y | [Z+] |
482
+ *************************************************************************/
483
+
459
484
int x = X_MARGIN, y = Y_MARGIN, spacing = 0 ;
460
485
461
486
TERN_ (HAS_EXTRUDERS, drawBtn (x, y, " E+" , (intptr_t )e_plus, imgUp, E_BTN_COLOR, !busy));
@@ -468,6 +493,7 @@ void MarlinUI::move_axis_screen() {
468
493
469
494
x += BTN_WIDTH;
470
495
496
+ // Cur Y
471
497
#if HAS_Y_AXIS
472
498
motionAxisState.yValuePos .set (x + 2 , y);
473
499
drawAxisValue (Y_AXIS);
@@ -476,10 +502,13 @@ void MarlinUI::move_axis_screen() {
476
502
x += spacing;
477
503
478
504
#if HAS_Z_AXIS
479
- drawBtn (x, y, " Z+" , (intptr_t )z_plus, imgUp, Z_BTN_COLOR, !busy || ENABLED (BABYSTEP_ZPROBE_OFFSET)); // only enabled when not busy or have baby step
505
+ drawBtn (x, y, " Z+" , (intptr_t )z_plus, imgUp, Z_BTN_COLOR, !busy || ENABLED (BABYSTEP_ZPROBE_OFFSET)); // Only enabled when not busy or have baby step
480
506
#endif
481
507
482
- // ROW 2 -> "Ex" X- HOME X+ "Z"
508
+ /* *************************************************************************
509
+ * ROW 2: | "Ex" | [X-] | [Home] | [X+] | "Z" |
510
+ *************************************************************************/
511
+
483
512
y += BTN_HEIGHT + (TFT_HEIGHT - Y_MARGIN * 2 - 4 * BTN_HEIGHT) / 3 ;
484
513
x = X_MARGIN;
485
514
spacing = (TFT_WIDTH - X_MARGIN * 2 - 5 * BTN_WIDTH) / 4 ;
@@ -494,7 +523,7 @@ void MarlinUI::move_axis_screen() {
494
523
495
524
TERN_ (HAS_X_AXIS, drawBtn (x, y, " X-" , (intptr_t )x_minus, imgLeft, X_BTN_COLOR, !busy));
496
525
497
- x += BTN_WIDTH + spacing; // imgHome is 64x64
526
+ x += BTN_WIDTH + spacing;
498
527
499
528
#if ALL(HAS_X_AXIS, TOUCH_SCREEN)
500
529
add_control (TFT_WIDTH / 2 - images[imgHome].width / 2 , y - (images[imgHome].width - BTN_HEIGHT) / 2 , BUTTON, (intptr_t )do_home, imgHome, !busy);
@@ -510,21 +539,23 @@ void MarlinUI::move_axis_screen() {
510
539
#if HAS_Z_AXIS
511
540
motionAxisState.zTypePos .set (x, y);
512
541
drawCurZSelection ();
542
+ #if ALL(HAS_BED_PROBE, TOUCH_SCREEN)
543
+ if (!busy) touch.add_control (BUTTON, x, y, BTN_WIDTH, 34 * 2 , (intptr_t )z_select);
544
+ #endif
513
545
#endif
514
546
515
- # if ALL(HAS_BED_PROBE, TOUCH_SCREEN)
516
- if (!busy) touch. add_control (BUTTON, x, y, BTN_WIDTH, 34 * 2 , ( intptr_t )z_select);
517
- # endif
547
+ /* *************************************************************************
548
+ * ROW 3: | [E-] | Current X | [Y-] | [Z-] |
549
+ ************************************************************************ */
518
550
519
- // ROW 3 -> E- CurX Y- Z-
520
551
y += BTN_HEIGHT + (TFT_HEIGHT - Y_MARGIN * 2 - 4 * BTN_HEIGHT) / 3 ;
521
552
x = X_MARGIN;
522
553
spacing = (TFT_WIDTH - X_MARGIN * 2 - 3 * BTN_WIDTH) / 2 ;
523
554
524
555
#if HAS_EXTRUDERS
525
556
drawBtn (x, y, " E-" , (intptr_t )e_minus, imgDown, E_BTN_COLOR, !busy);
526
557
motionAxisState.eValuePos .set (x, y + BTN_HEIGHT + 2 );
527
- TERN_ (HAS_EXTRUDERS, drawAxisValue (E_AXIS) );
558
+ drawAxisValue (E_AXIS);
528
559
#endif
529
560
530
561
// Cur X
@@ -542,12 +573,15 @@ void MarlinUI::move_axis_screen() {
542
573
543
574
// Cur Z
544
575
#if HAS_Z_AXIS
545
- drawBtn (x, y, " Z-" , (intptr_t )z_minus, imgDown, Z_BTN_COLOR, !busy || ENABLED (BABYSTEP_ZPROBE_OFFSET)); // only enabled when not busy or have baby step
576
+ drawBtn (x, y, " Z-" , (intptr_t )z_minus, imgDown, Z_BTN_COLOR, !busy || ENABLED (BABYSTEP_ZPROBE_OFFSET)); // Only enabled when not busy or have baby step
546
577
motionAxisState.zValuePos .set (x, y + BTN_HEIGHT + 2 );
547
578
drawAxisValue (Z_AXIS);
548
579
#endif
549
580
550
- // ROW 4 -> step_size disable steppers back
581
+ /* *************************************************************************
582
+ * ROW 4: | Step Size | [Disable Steppers] | [Back] |
583
+ *************************************************************************/
584
+
551
585
y = TFT_HEIGHT - Y_MARGIN - BTN_HEIGHT;
552
586
x = xplus_x - CUR_STEP_VALUE_WIDTH - 10 ;
553
587
motionAxisState.stepValuePos .set (yplus_x + BTN_WIDTH - CUR_STEP_VALUE_WIDTH, y);
@@ -563,5 +597,6 @@ void MarlinUI::move_axis_screen() {
563
597
564
598
TERN_ (TOUCH_SCREEN, add_control (TFT_WIDTH - X_MARGIN - BTN_WIDTH, y, BACK, imgBack));
565
599
}
600
+
566
601
#endif // MOVE_AXIS_SCREEN
567
602
#endif // HAS_UI_320x240
0 commit comments