Browse Source

_buffer_line => buffer_segment

Scott Lahteine 7 years ago
parent
commit
3db5303bfe

+ 13
- 13
Marlin/src/feature/bedlevel/ubl/ubl_motion.cpp View File

139
         // Note: There is no Z Correction in this case. We are off the grid and don't know what
139
         // Note: There is no Z Correction in this case. We are off the grid and don't know what
140
         // a reasonable correction would be.
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
         set_current_from_destination();
143
         set_current_from_destination();
144
 
144
 
145
         if (g26_debug_flag)
145
         if (g26_debug_flag)
183
        */
183
        */
184
       if (isnan(z0)) z0 = 0.0;
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
       if (g26_debug_flag)
188
       if (g26_debug_flag)
189
         debug_current_and_destination(PSTR("FINAL_MOVE in ubl.line_to_destination()"));
189
         debug_current_and_destination(PSTR("FINAL_MOVE in ubl.line_to_destination()"));
274
          * Without this check, it is possible for the algorithm to generate a zero length move in the case
274
          * Without this check, it is possible for the algorithm to generate a zero length move in the case
275
          * where the line is heading down and it is starting right on a Mesh Line boundary. For how often that
275
          * where the line is heading down and it is starting right on a Mesh Line boundary. For how often that
276
          * happens, it might be best to remove the check and always 'schedule' the move because
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
         if (ry != start[Y_AXIS]) {
279
         if (ry != start[Y_AXIS]) {
280
           if (!inf_normalized_flag) {
280
           if (!inf_normalized_flag) {
287
             z_position = end[Z_AXIS];
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
         } //else printf("FIRST MOVE PRUNED  ");
291
         } //else printf("FIRST MOVE PRUNED  ");
292
       }
292
       }
293
 
293
 
338
          * Without this check, it is possible for the algorithm to generate a zero length move in the case
338
          * Without this check, it is possible for the algorithm to generate a zero length move in the case
339
          * where the line is heading left and it is starting right on a Mesh Line boundary. For how often
339
          * where the line is heading left and it is starting right on a Mesh Line boundary. For how often
340
          * that happens, it might be best to remove the check and always 'schedule' the move because
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
         if (rx != start[X_AXIS]) {
343
         if (rx != start[X_AXIS]) {
344
           if (!inf_normalized_flag) {
344
           if (!inf_normalized_flag) {
351
             z_position = end[Z_AXIS];
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
         } //else printf("FIRST MOVE PRUNED  ");
355
         } //else printf("FIRST MOVE PRUNED  ");
356
       }
356
       }
357
 
357
 
413
           e_position = end[E_AXIS];
413
           e_position = end[E_AXIS];
414
           z_position = end[Z_AXIS];
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
         current_yi += dyi;
417
         current_yi += dyi;
418
         yi_cnt--;
418
         yi_cnt--;
419
       }
419
       }
441
           z_position = end[Z_AXIS];
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
         current_xi += dxi;
445
         current_xi += dxi;
446
         xi_cnt--;
446
         xi_cnt--;
447
       }
447
       }
465
     #endif
465
     #endif
466
 
466
 
467
     // We don't want additional apply_leveling() performed by regular buffer_line or buffer_line_kinematic,
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
     inline void _O2 ubl_buffer_segment_raw(const float (&raw)[XYZE], const float &fr) {
470
     inline void _O2 ubl_buffer_segment_raw(const float (&raw)[XYZE], const float &fr) {
471
 
471
 
472
       #if ENABLED(DELTA)  // apply delta inverse_kinematics
472
       #if ENABLED(DELTA)  // apply delta inverse_kinematics
473
 
473
 
474
         DELTA_RAW_IK();
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
       #elif IS_SCARA  // apply scara inverse_kinematics (should be changed to save raw->logical->raw)
477
       #elif IS_SCARA  // apply scara inverse_kinematics (should be changed to save raw->logical->raw)
478
 
478
 
485
         scara_oldB = delta[B_AXIS];
485
         scara_oldB = delta[B_AXIS];
486
         float s_feedrate = max(adiff, bdiff) * scara_feed_factor;
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
       #else // CARTESIAN
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
       #endif
494
       #endif
495
     }
495
     }
508
 
508
 
509
     /**
509
     /**
510
      * Prepare a segmented linear move for DELTA/SCARA/CARTESIAN with UBL and FADE semantics.
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
      * Returns true if did NOT move, false if moved (requires current_position update).
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 View File

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

+ 6
- 6
Marlin/src/module/planner.h View File

146
      *            head!=tail : blocks are in the buffer
146
      *            head!=tail : blocks are in the buffer
147
      *   head==(tail-1)%size : the buffer is full
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
      *  Reader of tail is Stepper::isr(). Always consider tail busy / read-only
150
      *  Reader of tail is Stepper::isr(). Always consider tail busy / read-only
151
      */
151
      */
152
     static block_t block_buffer[BLOCK_BUFFER_SIZE];
152
     static block_t block_buffer[BLOCK_BUFFER_SIZE];
379
     static void _buffer_steps(const int32_t (&target)[XYZE], float fr_mm_s, const uint8_t extruder);
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
      * Add a new linear movement to the buffer in axis units.
384
      * Add a new linear movement to the buffer in axis units.
385
      *
385
      *
389
      *  fr_mm_s   - (target) speed of the move
389
      *  fr_mm_s   - (target) speed of the move
390
      *  extruder  - target extruder
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
     static void _set_position_mm(const float &a, const float &b, const float &c, const float &e);
394
     static void _set_position_mm(const float &a, const float &b, const float &c, const float &e);
395
 
395
 
409
       #if PLANNER_LEVELING && IS_CARTESIAN
409
       #if PLANNER_LEVELING && IS_CARTESIAN
410
         apply_leveling(rx, ry, rz);
410
         apply_leveling(rx, ry, rz);
411
       #endif
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
       #endif
430
       #endif
431
       #if IS_KINEMATIC
431
       #if IS_KINEMATIC
432
         inverse_kinematics(raw);
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
       #else
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
       #endif
436
       #endif
437
     }
437
     }
438
 
438
 

Loading…
Cancel
Save