|
@@ -335,6 +335,9 @@
|
335
|
335
|
break; // No more invalid Mesh Points to populate
|
336
|
336
|
}
|
337
|
337
|
z_values[location.x_index][location.y_index] = NAN;
|
|
338
|
+ #if ENABLED(EXTENSIBLE_UI)
|
|
339
|
+ ExtUI::onMeshUpdate(location.x_index, location.y_index, 0);
|
|
340
|
+ #endif
|
338
|
341
|
cnt++;
|
339
|
342
|
}
|
340
|
343
|
}
|
|
@@ -362,6 +365,9 @@
|
362
|
365
|
const float p1 = 0.5f * (GRID_MAX_POINTS_X) - x,
|
363
|
366
|
p2 = 0.5f * (GRID_MAX_POINTS_Y) - y;
|
364
|
367
|
z_values[x][y] += 2.0f * HYPOT(p1, p2);
|
|
368
|
+ #if ENABLED(EXTENSIBLE_UI)
|
|
369
|
+ ExtUI::onMeshUpdate(x, y, z_values[x][y]);
|
|
370
|
+ #endif
|
365
|
371
|
}
|
366
|
372
|
}
|
367
|
373
|
break;
|
|
@@ -370,6 +376,11 @@
|
370
|
376
|
for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) { // Create a diagonal line several Mesh cells thick that is raised
|
371
|
377
|
z_values[x][x] += 9.999f;
|
372
|
378
|
z_values[x][x + (x < GRID_MAX_POINTS_Y - 1) ? 1 : -1] += 9.999f; // We want the altered line several mesh points thick
|
|
379
|
+ #if ENABLED(EXTENSIBLE_UI)
|
|
380
|
+ ExtUI::onMeshUpdate(x, x, z_values[x][x]);
|
|
381
|
+ ExtUI::onMeshUpdate(x, (x + (x < GRID_MAX_POINTS_Y - 1) ? 1 : -1), z_values[x][x + (x < GRID_MAX_POINTS_Y - 1) ? 1 : -1]);
|
|
382
|
+ #endif
|
|
383
|
+
|
373
|
384
|
}
|
374
|
385
|
break;
|
375
|
386
|
|
|
@@ -378,6 +389,9 @@
|
378
|
389
|
for (uint8_t x = (GRID_MAX_POINTS_X) / 3; x < 2 * (GRID_MAX_POINTS_X) / 3; x++) // Create a rectangular raised area in
|
379
|
390
|
for (uint8_t y = (GRID_MAX_POINTS_Y) / 3; y < 2 * (GRID_MAX_POINTS_Y) / 3; y++) // the center of the bed
|
380
|
391
|
z_values[x][y] += parser.seen('C') ? g29_constant : 9.99f;
|
|
392
|
+ #if ENABLED(EXTENSIBLE_UI)
|
|
393
|
+ ExtUI::onMeshUpdate(x, y, z_values[x][y]);
|
|
394
|
+ #endif
|
381
|
395
|
break;
|
382
|
396
|
}
|
383
|
397
|
}
|
|
@@ -519,6 +533,9 @@
|
519
|
533
|
break; // No more invalid Mesh Points to populate
|
520
|
534
|
}
|
521
|
535
|
z_values[location.x_index][location.y_index] = g29_constant;
|
|
536
|
+ #if ENABLED(EXTENSIBLE_UI)
|
|
537
|
+ ExtUI::onMeshUpdate(location.x_index, location.y_index, z_values[location.x_index][location.y_index]);
|
|
538
|
+ #endif
|
522
|
539
|
}
|
523
|
540
|
}
|
524
|
541
|
}
|
|
@@ -681,15 +698,23 @@
|
681
|
698
|
if (cflag)
|
682
|
699
|
for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++)
|
683
|
700
|
for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++)
|
684
|
|
- if (!isnan(z_values[x][y]))
|
|
701
|
+ if (!isnan(z_values[x][y])) {
|
685
|
702
|
z_values[x][y] -= mean + value;
|
|
703
|
+ #if ENABLED(EXTENSIBLE_UI)
|
|
704
|
+ ExtUI::onMeshUpdate(x, y, z_values[x][y]);
|
|
705
|
+ #endif
|
|
706
|
+ }
|
686
|
707
|
}
|
687
|
708
|
|
688
|
709
|
void unified_bed_leveling::shift_mesh_height() {
|
689
|
710
|
for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++)
|
690
|
711
|
for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++)
|
691
|
|
- if (!isnan(z_values[x][y]))
|
|
712
|
+ if (!isnan(z_values[x][y])) {
|
692
|
713
|
z_values[x][y] += g29_constant;
|
|
714
|
+ #if ENABLED(EXTENSIBLE_UI)
|
|
715
|
+ ExtUI::onMeshUpdate(x, y, z_values[x][y]);
|
|
716
|
+ #endif
|
|
717
|
+ }
|
693
|
718
|
}
|
694
|
719
|
|
695
|
720
|
#if HAS_BED_PROBE
|
|
@@ -736,6 +761,10 @@
|
736
|
761
|
|
737
|
762
|
const float measured_z = probe_pt(rawx, rawy, stow_probe ? PROBE_PT_STOW : PROBE_PT_RAISE, g29_verbose_level); // TODO: Needs error handling
|
738
|
763
|
z_values[location.x_index][location.y_index] = measured_z;
|
|
764
|
+ #if ENABLED(EXTENSIBLE_UI)
|
|
765
|
+ ExtUI::onMeshUpdate(location.x_index, location.y_index, measured_z);
|
|
766
|
+ #endif
|
|
767
|
+
|
739
|
768
|
}
|
740
|
769
|
SERIAL_FLUSH(); // Prevent host M105 buffer overrun.
|
741
|
770
|
} while (location.x_index >= 0 && --count);
|
|
@@ -894,6 +923,10 @@
|
894
|
923
|
}
|
895
|
924
|
|
896
|
925
|
z_values[location.x_index][location.y_index] = current_position[Z_AXIS] - thick;
|
|
926
|
+ #if ENABLED(EXTENSIBLE_UI)
|
|
927
|
+ ExtUI::onMeshUpdate(location.x_index, location.y_index, z_values[location.x_index][location.y_index]);
|
|
928
|
+ #endif
|
|
929
|
+
|
897
|
930
|
if (g29_verbose_level > 2)
|
898
|
931
|
SERIAL_ECHOLNPAIR_F("Mesh Point Measured at: ", z_values[location.x_index][location.y_index], 6);
|
899
|
932
|
SERIAL_FLUSH(); // Prevent host M105 buffer overrun.
|
|
@@ -994,6 +1027,9 @@
|
994
|
1027
|
if (click_and_hold(abort_fine_tune)) goto FINE_TUNE_EXIT; // If the click is held down, abort editing
|
995
|
1028
|
|
996
|
1029
|
z_values[location.x_index][location.y_index] = new_z; // Save the updated Z value
|
|
1030
|
+ #if ENABLED(EXTENSIBLE_UI)
|
|
1031
|
+ ExtUI::onMeshUpdate(location.x_index, location.y_index, new_z);
|
|
1032
|
+ #endif
|
997
|
1033
|
|
998
|
1034
|
serial_delay(20); // No switch noise
|
999
|
1035
|
ui.refresh();
|
|
@@ -1298,6 +1334,11 @@
|
1298
|
1334
|
z_values[x][y] = z_values[x1][y1]; // Use nearest (maybe a little too high.)
|
1299
|
1335
|
else
|
1300
|
1336
|
z_values[x][y] = 2.0f * z_values[x1][y1] - z_values[x2][y2]; // Angled upward...
|
|
1337
|
+
|
|
1338
|
+ #if ENABLED(EXTENSIBLE_UI)
|
|
1339
|
+ ExtUI::onMeshUpdate(x, y, z_values[x][y]);
|
|
1340
|
+ #endif
|
|
1341
|
+
|
1301
|
1342
|
return true;
|
1302
|
1343
|
}
|
1303
|
1344
|
return false;
|
|
@@ -1510,6 +1551,9 @@
|
1510
|
1551
|
#endif
|
1511
|
1552
|
|
1512
|
1553
|
z_values[i][j] = z_tmp - lsf_results.D;
|
|
1554
|
+ #if ENABLED(EXTENSIBLE_UI)
|
|
1555
|
+ ExtUI::onMeshUpdate(i, j, z_values[i][j]);
|
|
1556
|
+ #endif
|
1513
|
1557
|
}
|
1514
|
1558
|
}
|
1515
|
1559
|
|
|
@@ -1619,6 +1663,9 @@
|
1619
|
1663
|
}
|
1620
|
1664
|
const float ez = -lsf_results.D - lsf_results.A * px - lsf_results.B * py;
|
1621
|
1665
|
z_values[ix][iy] = ez;
|
|
1666
|
+ #if ENABLED(EXTENSIBLE_UI)
|
|
1667
|
+ ExtUI::onMeshUpdate(ix, iy, z_values[ix][iy]);
|
|
1668
|
+ #endif
|
1622
|
1669
|
idle(); // housekeeping
|
1623
|
1670
|
}
|
1624
|
1671
|
}
|
|
@@ -1757,8 +1804,12 @@
|
1757
|
1804
|
SERIAL_ECHOLNPAIR("Subtracting mesh in slot ", g29_storage_slot, " from current mesh.");
|
1758
|
1805
|
|
1759
|
1806
|
for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++)
|
1760
|
|
- for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++)
|
|
1807
|
+ for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++) {
|
1761
|
1808
|
z_values[x][y] -= tmp_z_values[x][y];
|
|
1809
|
+ #if ENABLED(EXTENSIBLE_UI)
|
|
1810
|
+ ExtUI::onMeshUpdate(x, y, z_values[x][y]);
|
|
1811
|
+ #endif
|
|
1812
|
+ }
|
1762
|
1813
|
}
|
1763
|
1814
|
|
1764
|
1815
|
#endif // UBL_DEVEL_DEBUGGING
|