|
@@ -58,12 +58,12 @@
|
58
|
58
|
* Prepare a mesh-leveled linear move in a Cartesian setup,
|
59
|
59
|
* splitting the move where it crosses mesh borders.
|
60
|
60
|
*/
|
61
|
|
- void mesh_line_to_destination(const float fr_mm_s, uint8_t x_splits, uint8_t y_splits) {
|
|
61
|
+ void mesh_bed_leveling::line_to_destination(const float fr_mm_s, uint8_t x_splits, uint8_t y_splits) {
|
62
|
62
|
// Get current and destination cells for this line
|
63
|
|
- int cx1 = mbl.cell_index_x(current_position[X_AXIS]),
|
64
|
|
- cy1 = mbl.cell_index_y(current_position[Y_AXIS]),
|
65
|
|
- cx2 = mbl.cell_index_x(destination[X_AXIS]),
|
66
|
|
- cy2 = mbl.cell_index_y(destination[Y_AXIS]);
|
|
63
|
+ int cx1 = cell_index_x(current_position[X_AXIS]),
|
|
64
|
+ cy1 = cell_index_y(current_position[Y_AXIS]),
|
|
65
|
+ cx2 = cell_index_x(destination[X_AXIS]),
|
|
66
|
+ cy2 = cell_index_y(destination[Y_AXIS]);
|
67
|
67
|
NOMORE(cx1, GRID_MAX_POINTS_X - 2);
|
68
|
68
|
NOMORE(cy1, GRID_MAX_POINTS_Y - 2);
|
69
|
69
|
NOMORE(cx2, GRID_MAX_POINTS_X - 2);
|
|
@@ -71,7 +71,7 @@
|
71
|
71
|
|
72
|
72
|
// Start and end in the same cell? No split needed.
|
73
|
73
|
if (cx1 == cx2 && cy1 == cy2) {
|
74
|
|
- buffer_line_to_destination(fr_mm_s);
|
|
74
|
+ line_to_destination(fr_mm_s);
|
75
|
75
|
set_current_from_destination();
|
76
|
76
|
return;
|
77
|
77
|
}
|
|
@@ -87,7 +87,7 @@
|
87
|
87
|
// Split on the X grid line
|
88
|
88
|
CBI(x_splits, gcx);
|
89
|
89
|
COPY(end, destination);
|
90
|
|
- destination[X_AXIS] = mbl.index_to_xpos[gcx];
|
|
90
|
+ destination[X_AXIS] = index_to_xpos[gcx];
|
91
|
91
|
normalized_dist = (destination[X_AXIS] - current_position[X_AXIS]) / (end[X_AXIS] - current_position[X_AXIS]);
|
92
|
92
|
destination[Y_AXIS] = MBL_SEGMENT_END(Y);
|
93
|
93
|
}
|
|
@@ -96,14 +96,14 @@
|
96
|
96
|
// Split on the Y grid line
|
97
|
97
|
CBI(y_splits, gcy);
|
98
|
98
|
COPY(end, destination);
|
99
|
|
- destination[Y_AXIS] = mbl.index_to_ypos[gcy];
|
|
99
|
+ destination[Y_AXIS] = index_to_ypos[gcy];
|
100
|
100
|
normalized_dist = (destination[Y_AXIS] - current_position[Y_AXIS]) / (end[Y_AXIS] - current_position[Y_AXIS]);
|
101
|
101
|
destination[X_AXIS] = MBL_SEGMENT_END(X);
|
102
|
102
|
}
|
103
|
103
|
else {
|
104
|
104
|
// Must already have been split on these border(s)
|
105
|
105
|
// This should be a rare case.
|
106
|
|
- buffer_line_to_destination(fr_mm_s);
|
|
106
|
+ line_to_destination(fr_mm_s);
|
107
|
107
|
set_current_from_destination();
|
108
|
108
|
return;
|
109
|
109
|
}
|
|
@@ -112,21 +112,21 @@
|
112
|
112
|
destination[E_AXIS] = MBL_SEGMENT_END(E);
|
113
|
113
|
|
114
|
114
|
// Do the split and look for more borders
|
115
|
|
- mesh_line_to_destination(fr_mm_s, x_splits, y_splits);
|
|
115
|
+ line_to_destination(fr_mm_s, x_splits, y_splits);
|
116
|
116
|
|
117
|
117
|
// Restore destination from stack
|
118
|
118
|
COPY(destination, end);
|
119
|
|
- mesh_line_to_destination(fr_mm_s, x_splits, y_splits);
|
|
119
|
+ line_to_destination(fr_mm_s, x_splits, y_splits);
|
120
|
120
|
}
|
121
|
121
|
|
122
|
122
|
#endif // IS_CARTESIAN && !SEGMENT_LEVELED_MOVES
|
123
|
123
|
|
124
|
|
- void mbl_mesh_report() {
|
|
124
|
+ void mesh_bed_leveling::report_mesh() {
|
125
|
125
|
SERIAL_PROTOCOLLNPGM("Num X,Y: " STRINGIFY(GRID_MAX_POINTS_X) "," STRINGIFY(GRID_MAX_POINTS_Y));
|
126
|
|
- SERIAL_PROTOCOLPGM("Z offset: "); SERIAL_PROTOCOL_F(mbl.z_offset, 5);
|
|
126
|
+ SERIAL_PROTOCOLPGM("Z offset: "); SERIAL_PROTOCOL_F(z_offset, 5);
|
127
|
127
|
SERIAL_PROTOCOLLNPGM("\nMeasured points:");
|
128
|
128
|
print_2d_array(GRID_MAX_POINTS_X, GRID_MAX_POINTS_Y, 5,
|
129
|
|
- [](const uint8_t ix, const uint8_t iy) { return mbl.z_values[ix][iy]; }
|
|
129
|
+ [](const uint8_t ix, const uint8_t iy) { return z_values[ix][iy]; }
|
130
|
130
|
);
|
131
|
131
|
}
|
132
|
132
|
|