|
166 | 166 | int8_t i, j;
|
167 | 167 | UNUSED(map_type);
|
168 | 168 |
|
169 |
| - SERIAL_PROTOCOLLNPGM("\nBed Topography Report:\n"); |
| 169 | + if (map_type==0) { |
| 170 | + SERIAL_PROTOCOLLNPGM("\nBed Topography Report:\n"); |
170 | 171 |
|
171 |
| - SERIAL_ECHOPAIR("(", 0); |
172 |
| - SERIAL_ECHOPAIR(", ", UBL_MESH_NUM_Y_POINTS - 1); |
173 |
| - SERIAL_ECHOPGM(") "); |
| 172 | + SERIAL_ECHOPAIR("(", 0); |
| 173 | + SERIAL_ECHOPAIR(", ", UBL_MESH_NUM_Y_POINTS - 1); |
| 174 | + SERIAL_ECHOPGM(") "); |
| 175 | + } |
174 | 176 |
|
175 | 177 | current_xi = ubl.get_cell_index_x(current_position[X_AXIS] + (MESH_X_DIST) / 2.0);
|
176 | 178 | current_yi = ubl.get_cell_index_y(current_position[Y_AXIS] + (MESH_Y_DIST) / 2.0);
|
177 | 179 |
|
178 |
| - for (i = 0; i < UBL_MESH_NUM_X_POINTS - 1; i++) { |
179 |
| - SERIAL_ECHOPGM(" "); |
180 |
| - #if TX_BUFFER_SIZE>0 |
181 |
| - MYSERIAL.flushTX(); |
182 |
| - #endif |
183 |
| - delay(15); |
184 |
| - } |
185 |
| - |
186 |
| - SERIAL_ECHOPAIR("(", UBL_MESH_NUM_X_POINTS - 1); |
187 |
| - SERIAL_ECHOPAIR(",", UBL_MESH_NUM_Y_POINTS - 1); |
188 |
| - SERIAL_ECHOLNPGM(")"); |
189 |
| - |
190 |
| - // if (map_type || 1) { |
| 180 | + if (map_type==0) { |
| 181 | + for (i = 0; i < UBL_MESH_NUM_X_POINTS - 1; i++) { |
| 182 | + SERIAL_ECHOPGM(" "); |
| 183 | + #if TX_BUFFER_SIZE>0 |
| 184 | + MYSERIAL.flushTX(); |
| 185 | + #endif |
| 186 | + delay(15); |
| 187 | + } |
| 188 | + |
| 189 | + SERIAL_ECHOPAIR("(", UBL_MESH_NUM_X_POINTS - 1); |
| 190 | + SERIAL_ECHOPAIR(",", UBL_MESH_NUM_Y_POINTS - 1); |
| 191 | + SERIAL_ECHOLNPGM(")"); |
191 | 192 |
|
192 | 193 | SERIAL_ECHOPAIR("(", UBL_MESH_MIN_X);
|
193 | 194 | SERIAL_ECHOPAIR(",", UBL_MESH_MAX_Y);
|
194 | 195 | SERIAL_CHAR(')');
|
| 196 | + delay(15); |
195 | 197 |
|
196 | 198 | for (i = 0; i < UBL_MESH_NUM_X_POINTS - 1; i++) {
|
197 | 199 | SERIAL_ECHOPGM(" ");
|
|
204 | 206 | SERIAL_ECHOPAIR("(", UBL_MESH_MAX_X);
|
205 | 207 | SERIAL_ECHOPAIR(",", UBL_MESH_MAX_Y);
|
206 | 208 | SERIAL_ECHOLNPGM(")");
|
207 |
| - |
208 |
| - // } |
| 209 | + delay(15); |
| 210 | + } |
209 | 211 |
|
210 | 212 | for (j = UBL_MESH_NUM_Y_POINTS - 1; j >= 0; j--) {
|
211 | 213 | for (i = 0; i < UBL_MESH_NUM_X_POINTS; i++) {
|
212 | 214 | f = z_values[i][j];
|
213 | 215 |
|
214 | 216 | // is the nozzle here? if so, mark the number
|
215 |
| - SERIAL_CHAR(i == current_xi && j == current_yi ? '[' : ' '); |
| 217 | + if (map_type==0) |
| 218 | + SERIAL_CHAR(i == current_xi && j == current_yi ? '[' : ' '); |
216 | 219 |
|
217 | 220 | if (isnan(f))
|
218 |
| - SERIAL_PROTOCOLPGM(" . "); |
| 221 | + if (map_type==0) { |
| 222 | + SERIAL_PROTOCOLPGM(" . "); |
| 223 | + } else |
| 224 | + SERIAL_PROTOCOLPGM("NAN"); |
219 | 225 | else {
|
220 | 226 | // if we don't do this, the columns won't line up nicely
|
221 |
| - if (f >= 0.0) SERIAL_CHAR(' '); |
| 227 | + if (f>=0.0 && map_type==0) SERIAL_CHAR(' '); |
222 | 228 | SERIAL_PROTOCOL_F(f, 3);
|
223 | 229 | idle();
|
224 | 230 | }
|
| 231 | + if (map_type!=0 && i<UBL_MESH_NUM_X_POINTS-1) |
| 232 | + SERIAL_PROTOCOLPGM(","); |
| 233 | + |
225 | 234 | #if TX_BUFFER_SIZE>0
|
226 | 235 | MYSERIAL.flushTX();
|
227 | 236 | #endif
|
228 | 237 | delay(15);
|
229 |
| - if (i == current_xi && j == current_yi) // is the nozzle here? if so, finish marking the number |
230 |
| - SERIAL_CHAR(']'); |
231 |
| - else |
232 |
| - SERIAL_PROTOCOL(" "); |
233 |
| - |
234 |
| - SERIAL_CHAR(' '); |
| 238 | + if (map_type==0) { |
| 239 | + if (i == current_xi && j == current_yi) // is the nozzle here? if so, finish marking the number |
| 240 | + SERIAL_CHAR(']'); |
| 241 | + else |
| 242 | + SERIAL_PROTOCOL(" "); |
| 243 | + SERIAL_CHAR(' '); |
| 244 | + } |
235 | 245 | }
|
236 | 246 | SERIAL_EOL;
|
237 |
| - if (j) { // we want the (0,0) up tight against the block of numbers |
| 247 | + if (j && map_type==0) { // we want the (0,0) up tight against the block of numbers |
238 | 248 | SERIAL_CHAR(' ');
|
239 | 249 | SERIAL_EOL;
|
240 | 250 | }
|
241 | 251 | }
|
242 | 252 |
|
243 |
| - // if (map_type) { |
244 |
| - SERIAL_ECHOPAIR("(", int(UBL_MESH_MIN_X)); |
245 |
| - SERIAL_ECHOPAIR(",", int(UBL_MESH_MIN_Y)); |
246 |
| - SERIAL_ECHOPGM(") "); |
| 253 | + if (map_type==0) { |
| 254 | + SERIAL_ECHOPAIR("(", int(UBL_MESH_MIN_X)); |
| 255 | + SERIAL_ECHOPAIR(",", int(UBL_MESH_MIN_Y)); |
| 256 | + SERIAL_ECHOPGM(") "); |
247 | 257 |
|
248 |
| - for (i = 0; i < UBL_MESH_NUM_X_POINTS - 1; i++) { |
249 |
| - SERIAL_ECHOPGM(" "); |
250 |
| - #if TX_BUFFER_SIZE>0 |
251 |
| - MYSERIAL.flushTX(); |
252 |
| - #endif |
253 |
| - delay(15); |
254 |
| - } |
255 |
| - |
256 |
| - SERIAL_ECHOPAIR("(", int(UBL_MESH_MAX_X)); |
257 |
| - SERIAL_ECHOPAIR(",", int(UBL_MESH_MIN_Y)); |
258 |
| - SERIAL_CHAR(')'); |
259 |
| - SERIAL_EOL; |
| 258 | + for (i = 0; i < UBL_MESH_NUM_X_POINTS - 1; i++) { |
| 259 | + SERIAL_ECHOPGM(" "); |
| 260 | + #if TX_BUFFER_SIZE>0 |
| 261 | + MYSERIAL.flushTX(); |
| 262 | + #endif |
| 263 | + delay(15); |
| 264 | + } |
| 265 | + SERIAL_ECHOPAIR("(", int(UBL_MESH_MAX_X)); |
| 266 | + SERIAL_ECHOPAIR(",", int(UBL_MESH_MIN_Y)); |
| 267 | + SERIAL_CHAR(')'); |
| 268 | + SERIAL_EOL; |
260 | 269 |
|
261 |
| - SERIAL_ECHOPAIR("(", 0); |
262 |
| - SERIAL_ECHOPAIR(",", 0); |
263 |
| - SERIAL_ECHOPGM(") "); |
| 270 | + SERIAL_ECHOPAIR("(", 0); |
| 271 | + SERIAL_ECHOPAIR(",", 0); |
| 272 | + SERIAL_ECHOPGM(") "); |
264 | 273 |
|
265 |
| - for (i = 0; i < UBL_MESH_NUM_X_POINTS - 1; i++) { |
266 |
| - SERIAL_ECHOPGM(" "); |
267 |
| - #if TX_BUFFER_SIZE>0 |
268 |
| - MYSERIAL.flushTX(); |
269 |
| - #endif |
270 |
| - delay(15); |
| 274 | + for (i = 0; i < UBL_MESH_NUM_X_POINTS - 1; i++) { |
| 275 | + SERIAL_ECHOPGM(" "); |
| 276 | + #if TX_BUFFER_SIZE>0 |
| 277 | + MYSERIAL.flushTX(); |
| 278 | + #endif |
| 279 | + delay(15); |
| 280 | + } |
| 281 | + SERIAL_ECHOPAIR("(", UBL_MESH_NUM_X_POINTS-1); |
| 282 | + SERIAL_ECHOPAIR(",", 0); |
| 283 | + SERIAL_ECHOLNPGM(")"); |
271 | 284 | }
|
272 |
| - |
273 |
| - SERIAL_ECHOPAIR("(", UBL_MESH_NUM_X_POINTS-1); |
274 |
| - SERIAL_ECHOPAIR(",", 0); |
275 |
| - SERIAL_ECHOLNPGM(")"); |
276 | 285 | }
|
277 | 286 |
|
278 | 287 | bool unified_bed_leveling::sanity_check() {
|
|
0 commit comments