ExtUI Mesh Leveling Extensions (#13363)
This commit is contained in:
committed by
Scott Lahteine
parent
050eac03af
commit
c03df89921
@ -66,8 +66,12 @@ void GcodeSuite::M420() {
|
||||
bilinear_grid_spacing[Y_AXIS] = (MAX_PROBE_Y - (MIN_PROBE_Y)) / (GRID_MAX_POINTS_Y - 1);
|
||||
#endif
|
||||
for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++)
|
||||
for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++)
|
||||
for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++) {
|
||||
Z_VALUES(x, y) = 0.001 * random(-200, 200);
|
||||
#if ENABLED(EXTENSIBLE_UI)
|
||||
ExtUI::onMeshUpdate(x, y, Z_VALUES(x, y));
|
||||
#endif
|
||||
}
|
||||
SERIAL_ECHOPGM("Simulated " STRINGIFY(GRID_MAX_POINTS_X) "x" STRINGIFY(GRID_MAX_POINTS_X) " mesh ");
|
||||
SERIAL_ECHOPAIR(" (", MIN_PROBE_X);
|
||||
SERIAL_CHAR(','); SERIAL_ECHO(MIN_PROBE_Y);
|
||||
@ -176,6 +180,9 @@ void GcodeSuite::M420() {
|
||||
#if ENABLED(ABL_BILINEAR_SUBDIVISION)
|
||||
bed_level_virt_interpolate();
|
||||
#endif
|
||||
#if ENABLED(EXTENSIBLE_UI)
|
||||
ExtUI::onMeshUpdate(x, y, Z_VALUES(x, y));
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -321,6 +321,9 @@ G29_TYPE GcodeSuite::G29() {
|
||||
#if ENABLED(ABL_BILINEAR_SUBDIVISION)
|
||||
bed_level_virt_interpolate();
|
||||
#endif
|
||||
#if ENABLED(EXTENSIBLE_UI)
|
||||
ExtUI::onMeshUpdate(i, j, rz);
|
||||
#endif
|
||||
set_bed_leveling_enabled(abl_should_enable);
|
||||
if (abl_should_enable) report_current_position();
|
||||
}
|
||||
@ -548,6 +551,9 @@ G29_TYPE GcodeSuite::G29() {
|
||||
#elif ENABLED(AUTO_BED_LEVELING_BILINEAR)
|
||||
|
||||
z_values[xCount][yCount] = measured_z + zoffset;
|
||||
#if ENABLED(EXTENSIBLE_UI)
|
||||
ExtUI::onMeshUpdate(xCount, yCount, z_values[xCount][yCount]);
|
||||
#endif
|
||||
|
||||
#if ENABLED(DEBUG_LEVELING_FEATURE)
|
||||
if (DEBUGGING(LEVELING)) {
|
||||
@ -723,6 +729,9 @@ G29_TYPE GcodeSuite::G29() {
|
||||
#elif ENABLED(AUTO_BED_LEVELING_BILINEAR)
|
||||
|
||||
z_values[xCount][yCount] = measured_z + zoffset;
|
||||
#if ENABLED(EXTENSIBLE_UI)
|
||||
ExtUI::onMeshUpdate(xCount, yCount, z_values[xCount][yCount]);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -54,6 +54,9 @@ void GcodeSuite::M421() {
|
||||
#if ENABLED(ABL_BILINEAR_SUBDIVISION)
|
||||
bed_level_virt_interpolate();
|
||||
#endif
|
||||
#if ENABLED(EXTENSIBLE_UI)
|
||||
ExtUI::onMeshUpdate(ix, iy, z_values[ix][iy]);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -173,8 +173,12 @@ void GcodeSuite::G29() {
|
||||
else
|
||||
return echo_not_entered('J');
|
||||
|
||||
if (parser.seenval('Z'))
|
||||
if (parser.seenval('Z')) {
|
||||
mbl.z_values[ix][iy] = parser.value_linear_units();
|
||||
#if ENABLED(EXTENSIBLE_UI)
|
||||
ExtUI::onMeshUpdate(ix, iy, mbl.z_values[ix][iy]);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
return echo_not_entered('Z');
|
||||
break;
|
||||
|
@ -60,8 +60,12 @@ void GcodeSuite::M421() {
|
||||
SERIAL_ERROR_MSG(MSG_ERR_M421_PARAMETERS);
|
||||
else if (!WITHIN(ix, 0, GRID_MAX_POINTS_X - 1) || !WITHIN(iy, 0, GRID_MAX_POINTS_Y - 1))
|
||||
SERIAL_ERROR_MSG(MSG_ERR_MESH_XY);
|
||||
else
|
||||
else {
|
||||
ubl.z_values[ix][iy] = hasN ? NAN : parser.value_linear_units() + (hasQ ? ubl.z_values[ix][iy] : 0);
|
||||
#if ENABLED(EXTENSIBLE_UI)
|
||||
ExtUI::onMeshUpdate(ix, iy, ubl.z_values[ix][iy]);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
#endif // AUTO_BED_LEVELING_UBL
|
||||
|
Reference in New Issue
Block a user