Pārlūkot izejas kodu

_buffer_line => buffer_segment

Scott Lahteine 7 gadus atpakaļ
vecāks
revīzija
8244284116
3 mainītis faili ar 23 papildinājumiem un 23 dzēšanām
  1. 4
    4
      Marlin/planner.cpp
  2. 6
    6
      Marlin/planner.h
  3. 13
    13
      Marlin/ubl_motion.cpp

+ 4
- 4
Marlin/planner.cpp Parādīt failu

1354
 } // _buffer_steps()
1354
 } // _buffer_steps()
1355
 
1355
 
1356
 /**
1356
 /**
1357
- * Planner::_buffer_line
1357
+ * Planner::buffer_segment
1358
  *
1358
  *
1359
  * Add a new linear movement to the buffer in axis units.
1359
  * Add a new linear movement to the buffer in axis units.
1360
  *
1360
  *
1364
  *  fr_mm_s   - (target) speed of the move
1364
  *  fr_mm_s   - (target) speed of the move
1365
  *  extruder  - target extruder
1365
  *  extruder  - target extruder
1366
  */
1366
  */
1367
-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) {
1367
+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) {
1368
   // When changing extruders recalculate steps corresponding to the E position
1368
   // When changing extruders recalculate steps corresponding to the E position
1369
   #if ENABLED(DISTINCT_E_FACTORS)
1369
   #if ENABLED(DISTINCT_E_FACTORS)
1370
     if (last_extruder != extruder && axis_steps_per_mm[E_AXIS_N] != axis_steps_per_mm[E_AXIS + last_extruder]) {
1370
     if (last_extruder != extruder && axis_steps_per_mm[E_AXIS_N] != axis_steps_per_mm[E_AXIS + last_extruder]) {
1383
   };
1383
   };
1384
 
1384
 
1385
   /* <-- add a slash to enable
1385
   /* <-- add a slash to enable
1386
-    SERIAL_ECHOPAIR("  _buffer_line FR:", fr_mm_s);
1386
+    SERIAL_ECHOPAIR("  buffer_segment FR:", fr_mm_s);
1387
     #if IS_KINEMATIC
1387
     #if IS_KINEMATIC
1388
       SERIAL_ECHOPAIR(" A:", a);
1388
       SERIAL_ECHOPAIR(" A:", a);
1389
       SERIAL_ECHOPAIR(" (", position[A_AXIS]);
1389
       SERIAL_ECHOPAIR(" (", position[A_AXIS]);
1430
 
1430
 
1431
   stepper.wake_up();
1431
   stepper.wake_up();
1432
 
1432
 
1433
-} // _buffer_line()
1433
+} // buffer_segment()
1434
 
1434
 
1435
 /**
1435
 /**
1436
  * Directly set the planner XYZ position (and stepper positions)
1436
  * Directly set the planner XYZ position (and stepper positions)

+ 6
- 6
Marlin/planner.h Parādīt failu

142
      *            head!=tail : blocks are in the buffer
142
      *            head!=tail : blocks are in the buffer
143
      *   head==(tail-1)%size : the buffer is full
143
      *   head==(tail-1)%size : the buffer is full
144
      *
144
      *
145
-     *  Writer of head is Planner::_buffer_line().
145
+     *  Writer of head is Planner::buffer_segment().
146
      *  Reader of tail is Stepper::isr(). Always consider tail busy / read-only
146
      *  Reader of tail is Stepper::isr(). Always consider tail busy / read-only
147
      */
147
      */
148
     static block_t block_buffer[BLOCK_BUFFER_SIZE];
148
     static block_t block_buffer[BLOCK_BUFFER_SIZE];
375
     static void _buffer_steps(const int32_t (&target)[XYZE], float fr_mm_s, const uint8_t extruder);
375
     static void _buffer_steps(const int32_t (&target)[XYZE], float fr_mm_s, const uint8_t extruder);
376
 
376
 
377
     /**
377
     /**
378
-     * Planner::_buffer_line
378
+     * Planner::buffer_segment
379
      *
379
      *
380
      * Add a new linear movement to the buffer in axis units.
380
      * Add a new linear movement to the buffer in axis units.
381
      *
381
      *
385
      *  fr_mm_s   - (target) speed of the move
385
      *  fr_mm_s   - (target) speed of the move
386
      *  extruder  - target extruder
386
      *  extruder  - target extruder
387
      */
387
      */
388
-    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);
388
+    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);
389
 
389
 
390
     static void _set_position_mm(const float &a, const float &b, const float &c, const float &e);
390
     static void _set_position_mm(const float &a, const float &b, const float &c, const float &e);
391
 
391
 
405
       #if PLANNER_LEVELING && IS_CARTESIAN
405
       #if PLANNER_LEVELING && IS_CARTESIAN
406
         apply_leveling(rx, ry, rz);
406
         apply_leveling(rx, ry, rz);
407
       #endif
407
       #endif
408
-      _buffer_line(rx, ry, rz, e, fr_mm_s, extruder);
408
+      buffer_segment(rx, ry, rz, e, fr_mm_s, extruder);
409
     }
409
     }
410
 
410
 
411
     /**
411
     /**
426
       #endif
426
       #endif
427
       #if IS_KINEMATIC
427
       #if IS_KINEMATIC
428
         inverse_kinematics(raw);
428
         inverse_kinematics(raw);
429
-        _buffer_line(delta[A_AXIS], delta[B_AXIS], delta[C_AXIS], cart[E_AXIS], fr_mm_s, extruder);
429
+        buffer_segment(delta[A_AXIS], delta[B_AXIS], delta[C_AXIS], cart[E_AXIS], fr_mm_s, extruder);
430
       #else
430
       #else
431
-        _buffer_line(raw[X_AXIS], raw[Y_AXIS], raw[Z_AXIS], cart[E_AXIS], fr_mm_s, extruder);
431
+        buffer_segment(raw[X_AXIS], raw[Y_AXIS], raw[Z_AXIS], cart[E_AXIS], fr_mm_s, extruder);
432
       #endif
432
       #endif
433
     }
433
     }
434
 
434
 

+ 13
- 13
Marlin/ubl_motion.cpp Parādīt failu

134
         // Note: There is no Z Correction in this case. We are off the grid and don't know what
134
         // Note: There is no Z Correction in this case. We are off the grid and don't know what
135
         // a reasonable correction would be.
135
         // a reasonable correction would be.
136
 
136
 
137
-        planner._buffer_line(end[X_AXIS], end[Y_AXIS], end[Z_AXIS], end[E_AXIS], feed_rate, extruder);
137
+        planner.buffer_segment(end[X_AXIS], end[Y_AXIS], end[Z_AXIS], end[E_AXIS], feed_rate, extruder);
138
         set_current_from_destination();
138
         set_current_from_destination();
139
 
139
 
140
         if (g26_debug_flag)
140
         if (g26_debug_flag)
178
        */
178
        */
179
       if (isnan(z0)) z0 = 0.0;
179
       if (isnan(z0)) z0 = 0.0;
180
 
180
 
181
-      planner._buffer_line(end[X_AXIS], end[Y_AXIS], end[Z_AXIS] + z0, end[E_AXIS], feed_rate, extruder);
181
+      planner.buffer_segment(end[X_AXIS], end[Y_AXIS], end[Z_AXIS] + z0, end[E_AXIS], feed_rate, extruder);
182
 
182
 
183
       if (g26_debug_flag)
183
       if (g26_debug_flag)
184
         debug_current_and_destination(PSTR("FINAL_MOVE in ubl.line_to_destination()"));
184
         debug_current_and_destination(PSTR("FINAL_MOVE in ubl.line_to_destination()"));
269
          * Without this check, it is possible for the algorithm to generate a zero length move in the case
269
          * Without this check, it is possible for the algorithm to generate a zero length move in the case
270
          * where the line is heading down and it is starting right on a Mesh Line boundary. For how often that
270
          * where the line is heading down and it is starting right on a Mesh Line boundary. For how often that
271
          * happens, it might be best to remove the check and always 'schedule' the move because
271
          * happens, it might be best to remove the check and always 'schedule' the move because
272
-         * the planner._buffer_line() routine will filter it if that happens.
272
+         * the planner.buffer_segment() routine will filter it if that happens.
273
          */
273
          */
274
         if (ry != start[Y_AXIS]) {
274
         if (ry != start[Y_AXIS]) {
275
           if (!inf_normalized_flag) {
275
           if (!inf_normalized_flag) {
282
             z_position = end[Z_AXIS];
282
             z_position = end[Z_AXIS];
283
           }
283
           }
284
 
284
 
285
-          planner._buffer_line(rx, ry, z_position + z0, e_position, feed_rate, extruder);
285
+          planner.buffer_segment(rx, ry, z_position + z0, e_position, feed_rate, extruder);
286
         } //else printf("FIRST MOVE PRUNED  ");
286
         } //else printf("FIRST MOVE PRUNED  ");
287
       }
287
       }
288
 
288
 
333
          * Without this check, it is possible for the algorithm to generate a zero length move in the case
333
          * Without this check, it is possible for the algorithm to generate a zero length move in the case
334
          * where the line is heading left and it is starting right on a Mesh Line boundary. For how often
334
          * where the line is heading left and it is starting right on a Mesh Line boundary. For how often
335
          * that happens, it might be best to remove the check and always 'schedule' the move because
335
          * that happens, it might be best to remove the check and always 'schedule' the move because
336
-         * the planner._buffer_line() routine will filter it if that happens.
336
+         * the planner.buffer_segment() routine will filter it if that happens.
337
          */
337
          */
338
         if (rx != start[X_AXIS]) {
338
         if (rx != start[X_AXIS]) {
339
           if (!inf_normalized_flag) {
339
           if (!inf_normalized_flag) {
346
             z_position = end[Z_AXIS];
346
             z_position = end[Z_AXIS];
347
           }
347
           }
348
 
348
 
349
-          planner._buffer_line(rx, ry, z_position + z0, e_position, feed_rate, extruder);
349
+          planner.buffer_segment(rx, ry, z_position + z0, e_position, feed_rate, extruder);
350
         } //else printf("FIRST MOVE PRUNED  ");
350
         } //else printf("FIRST MOVE PRUNED  ");
351
       }
351
       }
352
 
352
 
408
           e_position = end[E_AXIS];
408
           e_position = end[E_AXIS];
409
           z_position = end[Z_AXIS];
409
           z_position = end[Z_AXIS];
410
         }
410
         }
411
-        planner._buffer_line(rx, next_mesh_line_y, z_position + z0, e_position, feed_rate, extruder);
411
+        planner.buffer_segment(rx, next_mesh_line_y, z_position + z0, e_position, feed_rate, extruder);
412
         current_yi += dyi;
412
         current_yi += dyi;
413
         yi_cnt--;
413
         yi_cnt--;
414
       }
414
       }
436
           z_position = end[Z_AXIS];
436
           z_position = end[Z_AXIS];
437
         }
437
         }
438
 
438
 
439
-        planner._buffer_line(next_mesh_line_x, ry, z_position + z0, e_position, feed_rate, extruder);
439
+        planner.buffer_segment(next_mesh_line_x, ry, z_position + z0, e_position, feed_rate, extruder);
440
         current_xi += dxi;
440
         current_xi += dxi;
441
         xi_cnt--;
441
         xi_cnt--;
442
       }
442
       }
468
     #endif
468
     #endif
469
 
469
 
470
     // We don't want additional apply_leveling() performed by regular buffer_line or buffer_line_kinematic,
470
     // We don't want additional apply_leveling() performed by regular buffer_line or buffer_line_kinematic,
471
-    // so we call _buffer_line directly here.  Per-segmented leveling and kinematics performed first.
471
+    // so we call buffer_segment directly here.  Per-segmented leveling and kinematics performed first.
472
 
472
 
473
     inline void _O2 ubl_buffer_segment_raw(const float raw[XYZE], const float &fr) {
473
     inline void _O2 ubl_buffer_segment_raw(const float raw[XYZE], const float &fr) {
474
 
474
 
475
       #if ENABLED(DELTA)  // apply delta inverse_kinematics
475
       #if ENABLED(DELTA)  // apply delta inverse_kinematics
476
 
476
 
477
         DELTA_RAW_IK();
477
         DELTA_RAW_IK();
478
-        planner._buffer_line(delta[A_AXIS], delta[B_AXIS], delta[C_AXIS], raw[E_AXIS], fr, active_extruder);
478
+        planner.buffer_segment(delta[A_AXIS], delta[B_AXIS], delta[C_AXIS], raw[E_AXIS], fr, active_extruder);
479
 
479
 
480
       #elif IS_SCARA  // apply scara inverse_kinematics (should be changed to save raw->logical->raw)
480
       #elif IS_SCARA  // apply scara inverse_kinematics (should be changed to save raw->logical->raw)
481
 
481
 
488
         scara_oldB = delta[B_AXIS];
488
         scara_oldB = delta[B_AXIS];
489
         float s_feedrate = max(adiff, bdiff) * scara_feed_factor;
489
         float s_feedrate = max(adiff, bdiff) * scara_feed_factor;
490
 
490
 
491
-        planner._buffer_line(delta[A_AXIS], delta[B_AXIS], delta[C_AXIS], raw[E_AXIS], s_feedrate, active_extruder);
491
+        planner.buffer_segment(delta[A_AXIS], delta[B_AXIS], delta[C_AXIS], raw[E_AXIS], s_feedrate, active_extruder);
492
 
492
 
493
       #else // CARTESIAN
493
       #else // CARTESIAN
494
 
494
 
495
-        planner._buffer_line(raw[X_AXIS], raw[Y_AXIS], raw[Z_AXIS], raw[E_AXIS], fr, active_extruder);
495
+        planner.buffer_segment(raw[X_AXIS], raw[Y_AXIS], raw[Z_AXIS], raw[E_AXIS], fr, active_extruder);
496
 
496
 
497
       #endif
497
       #endif
498
     }
498
     }
511
 
511
 
512
     /**
512
     /**
513
      * Prepare a segmented linear move for DELTA/SCARA/CARTESIAN with UBL and FADE semantics.
513
      * Prepare a segmented linear move for DELTA/SCARA/CARTESIAN with UBL and FADE semantics.
514
-     * This calls planner._buffer_line multiple times for small incremental moves.
514
+     * This calls planner.buffer_segment multiple times for small incremental moves.
515
      * Returns true if did NOT move, false if moved (requires current_position update).
515
      * Returns true if did NOT move, false if moved (requires current_position update).
516
      */
516
      */
517
 
517
 

Notiek ielāde…
Atcelt
Saglabāt