Bladeren bron

_buffer_line => buffer_segment

Scott Lahteine 6 jaren geleden
bovenliggende
commit
3db5303bfe
3 gewijzigde bestanden met toevoegingen van 23 en 23 verwijderingen
  1. 13
    13
      Marlin/src/feature/bedlevel/ubl/ubl_motion.cpp
  2. 4
    4
      Marlin/src/module/planner.cpp
  3. 6
    6
      Marlin/src/module/planner.h

+ 13
- 13
Marlin/src/feature/bedlevel/ubl/ubl_motion.cpp Bestand weergeven

@@ -139,7 +139,7 @@
139 139
         // Note: There is no Z Correction in this case. We are off the grid and don't know what
140 140
         // a reasonable correction would be.
141 141
 
142
-        planner._buffer_line(end[X_AXIS], end[Y_AXIS], end[Z_AXIS], end[E_AXIS], feed_rate, extruder);
142
+        planner.buffer_segment(end[X_AXIS], end[Y_AXIS], end[Z_AXIS], end[E_AXIS], feed_rate, extruder);
143 143
         set_current_from_destination();
144 144
 
145 145
         if (g26_debug_flag)
@@ -183,7 +183,7 @@
183 183
        */
184 184
       if (isnan(z0)) z0 = 0.0;
185 185
 
186
-      planner._buffer_line(end[X_AXIS], end[Y_AXIS], end[Z_AXIS] + z0, end[E_AXIS], feed_rate, extruder);
186
+      planner.buffer_segment(end[X_AXIS], end[Y_AXIS], end[Z_AXIS] + z0, end[E_AXIS], feed_rate, extruder);
187 187
 
188 188
       if (g26_debug_flag)
189 189
         debug_current_and_destination(PSTR("FINAL_MOVE in ubl.line_to_destination()"));
@@ -274,7 +274,7 @@
274 274
          * Without this check, it is possible for the algorithm to generate a zero length move in the case
275 275
          * where the line is heading down and it is starting right on a Mesh Line boundary. For how often that
276 276
          * happens, it might be best to remove the check and always 'schedule' the move because
277
-         * the planner._buffer_line() routine will filter it if that happens.
277
+         * the planner.buffer_segment() routine will filter it if that happens.
278 278
          */
279 279
         if (ry != start[Y_AXIS]) {
280 280
           if (!inf_normalized_flag) {
@@ -287,7 +287,7 @@
287 287
             z_position = end[Z_AXIS];
288 288
           }
289 289
 
290
-          planner._buffer_line(rx, ry, z_position + z0, e_position, feed_rate, extruder);
290
+          planner.buffer_segment(rx, ry, z_position + z0, e_position, feed_rate, extruder);
291 291
         } //else printf("FIRST MOVE PRUNED  ");
292 292
       }
293 293
 
@@ -338,7 +338,7 @@
338 338
          * Without this check, it is possible for the algorithm to generate a zero length move in the case
339 339
          * where the line is heading left and it is starting right on a Mesh Line boundary. For how often
340 340
          * that happens, it might be best to remove the check and always 'schedule' the move because
341
-         * the planner._buffer_line() routine will filter it if that happens.
341
+         * the planner.buffer_segment() routine will filter it if that happens.
342 342
          */
343 343
         if (rx != start[X_AXIS]) {
344 344
           if (!inf_normalized_flag) {
@@ -351,7 +351,7 @@
351 351
             z_position = end[Z_AXIS];
352 352
           }
353 353
 
354
-          planner._buffer_line(rx, ry, z_position + z0, e_position, feed_rate, extruder);
354
+          planner.buffer_segment(rx, ry, z_position + z0, e_position, feed_rate, extruder);
355 355
         } //else printf("FIRST MOVE PRUNED  ");
356 356
       }
357 357
 
@@ -413,7 +413,7 @@
413 413
           e_position = end[E_AXIS];
414 414
           z_position = end[Z_AXIS];
415 415
         }
416
-        planner._buffer_line(rx, next_mesh_line_y, z_position + z0, e_position, feed_rate, extruder);
416
+        planner.buffer_segment(rx, next_mesh_line_y, z_position + z0, e_position, feed_rate, extruder);
417 417
         current_yi += dyi;
418 418
         yi_cnt--;
419 419
       }
@@ -441,7 +441,7 @@
441 441
           z_position = end[Z_AXIS];
442 442
         }
443 443
 
444
-        planner._buffer_line(next_mesh_line_x, ry, z_position + z0, e_position, feed_rate, extruder);
444
+        planner.buffer_segment(next_mesh_line_x, ry, z_position + z0, e_position, feed_rate, extruder);
445 445
         current_xi += dxi;
446 446
         xi_cnt--;
447 447
       }
@@ -465,14 +465,14 @@
465 465
     #endif
466 466
 
467 467
     // We don't want additional apply_leveling() performed by regular buffer_line or buffer_line_kinematic,
468
-    // so we call _buffer_line directly here.  Per-segmented leveling and kinematics performed first.
468
+    // so we call buffer_segment directly here.  Per-segmented leveling and kinematics performed first.
469 469
 
470 470
     inline void _O2 ubl_buffer_segment_raw(const float (&raw)[XYZE], const float &fr) {
471 471
 
472 472
       #if ENABLED(DELTA)  // apply delta inverse_kinematics
473 473
 
474 474
         DELTA_RAW_IK();
475
-        planner._buffer_line(delta[A_AXIS], delta[B_AXIS], delta[C_AXIS], raw[E_AXIS], fr, active_extruder);
475
+        planner.buffer_segment(delta[A_AXIS], delta[B_AXIS], delta[C_AXIS], raw[E_AXIS], fr, active_extruder);
476 476
 
477 477
       #elif IS_SCARA  // apply scara inverse_kinematics (should be changed to save raw->logical->raw)
478 478
 
@@ -485,11 +485,11 @@
485 485
         scara_oldB = delta[B_AXIS];
486 486
         float s_feedrate = max(adiff, bdiff) * scara_feed_factor;
487 487
 
488
-        planner._buffer_line(delta[A_AXIS], delta[B_AXIS], delta[C_AXIS], raw[E_AXIS], s_feedrate, active_extruder);
488
+        planner.buffer_segment(delta[A_AXIS], delta[B_AXIS], delta[C_AXIS], raw[E_AXIS], s_feedrate, active_extruder);
489 489
 
490 490
       #else // CARTESIAN
491 491
 
492
-        planner._buffer_line(raw[X_AXIS], raw[Y_AXIS], raw[Z_AXIS], raw[E_AXIS], fr, active_extruder);
492
+        planner.buffer_segment(raw[X_AXIS], raw[Y_AXIS], raw[Z_AXIS], raw[E_AXIS], fr, active_extruder);
493 493
 
494 494
       #endif
495 495
     }
@@ -508,7 +508,7 @@
508 508
 
509 509
     /**
510 510
      * Prepare a segmented linear move for DELTA/SCARA/CARTESIAN with UBL and FADE semantics.
511
-     * This calls planner._buffer_line multiple times for small incremental moves.
511
+     * This calls planner.buffer_segment multiple times for small incremental moves.
512 512
      * Returns true if did NOT move, false if moved (requires current_position update).
513 513
      */
514 514
 

+ 4
- 4
Marlin/src/module/planner.cpp Bestand weergeven

@@ -1365,7 +1365,7 @@ void Planner::_buffer_steps(const int32_t (&target)[XYZE], float fr_mm_s, const
1365 1365
 } // _buffer_steps()
1366 1366
 
1367 1367
 /**
1368
- * Planner::_buffer_line
1368
+ * Planner::buffer_segment
1369 1369
  *
1370 1370
  * Add a new linear movement to the buffer in axis units.
1371 1371
  *
@@ -1375,7 +1375,7 @@ void Planner::_buffer_steps(const int32_t (&target)[XYZE], float fr_mm_s, const
1375 1375
  *  fr_mm_s   - (target) speed of the move
1376 1376
  *  extruder  - target extruder
1377 1377
  */
1378
-void Planner::_buffer_line(const float &a, const float &b, const float &c, const float &e, const float &fr_mm_s, const uint8_t extruder) {
1378
+void Planner::buffer_segment(const float &a, const float &b, const float &c, const float &e, const float &fr_mm_s, const uint8_t extruder) {
1379 1379
   // When changing extruders recalculate steps corresponding to the E position
1380 1380
   #if ENABLED(DISTINCT_E_FACTORS)
1381 1381
     if (last_extruder != extruder && axis_steps_per_mm[E_AXIS_N] != axis_steps_per_mm[E_AXIS + last_extruder]) {
@@ -1394,7 +1394,7 @@ void Planner::_buffer_line(const float &a, const float &b, const float &c, const
1394 1394
   };
1395 1395
 
1396 1396
   /* <-- add a slash to enable
1397
-    SERIAL_ECHOPAIR("  _buffer_line FR:", fr_mm_s);
1397
+    SERIAL_ECHOPAIR("  buffer_segment FR:", fr_mm_s);
1398 1398
     #if IS_KINEMATIC
1399 1399
       SERIAL_ECHOPAIR(" A:", a);
1400 1400
       SERIAL_ECHOPAIR(" (", position[A_AXIS]);
@@ -1441,7 +1441,7 @@ void Planner::_buffer_line(const float &a, const float &b, const float &c, const
1441 1441
 
1442 1442
   stepper.wake_up();
1443 1443
 
1444
-} // _buffer_line()
1444
+} // buffer_segment()
1445 1445
 
1446 1446
 /**
1447 1447
  * Directly set the planner XYZ position (and stepper positions)

+ 6
- 6
Marlin/src/module/planner.h Bestand weergeven

@@ -146,7 +146,7 @@ class Planner {
146 146
      *            head!=tail : blocks are in the buffer
147 147
      *   head==(tail-1)%size : the buffer is full
148 148
      *
149
-     *  Writer of head is Planner::_buffer_line().
149
+     *  Writer of head is Planner::buffer_segment().
150 150
      *  Reader of tail is Stepper::isr(). Always consider tail busy / read-only
151 151
      */
152 152
     static block_t block_buffer[BLOCK_BUFFER_SIZE];
@@ -379,7 +379,7 @@ class Planner {
379 379
     static void _buffer_steps(const int32_t (&target)[XYZE], float fr_mm_s, const uint8_t extruder);
380 380
 
381 381
     /**
382
-     * Planner::_buffer_line
382
+     * Planner::buffer_segment
383 383
      *
384 384
      * Add a new linear movement to the buffer in axis units.
385 385
      *
@@ -389,7 +389,7 @@ class Planner {
389 389
      *  fr_mm_s   - (target) speed of the move
390 390
      *  extruder  - target extruder
391 391
      */
392
-    static void _buffer_line(const float &a, const float &b, const float &c, const float &e, const float &fr_mm_s, const uint8_t extruder);
392
+    static void buffer_segment(const float &a, const float &b, const float &c, const float &e, const float &fr_mm_s, const uint8_t extruder);
393 393
 
394 394
     static void _set_position_mm(const float &a, const float &b, const float &c, const float &e);
395 395
 
@@ -409,7 +409,7 @@ class Planner {
409 409
       #if PLANNER_LEVELING && IS_CARTESIAN
410 410
         apply_leveling(rx, ry, rz);
411 411
       #endif
412
-      _buffer_line(rx, ry, rz, e, fr_mm_s, extruder);
412
+      buffer_segment(rx, ry, rz, e, fr_mm_s, extruder);
413 413
     }
414 414
 
415 415
     /**
@@ -430,9 +430,9 @@ class Planner {
430 430
       #endif
431 431
       #if IS_KINEMATIC
432 432
         inverse_kinematics(raw);
433
-        _buffer_line(delta[A_AXIS], delta[B_AXIS], delta[C_AXIS], cart[E_AXIS], fr_mm_s, extruder);
433
+        buffer_segment(delta[A_AXIS], delta[B_AXIS], delta[C_AXIS], cart[E_AXIS], fr_mm_s, extruder);
434 434
       #else
435
-        _buffer_line(raw[X_AXIS], raw[Y_AXIS], raw[Z_AXIS], cart[E_AXIS], fr_mm_s, extruder);
435
+        buffer_segment(raw[X_AXIS], raw[Y_AXIS], raw[Z_AXIS], cart[E_AXIS], fr_mm_s, extruder);
436 436
       #endif
437 437
     }
438 438
 

Laden…
Annuleren
Opslaan