Browse Source

change to better (more clear) names (#8049)

set_destination_to_current() changed to set_destination_from_current()

set_current_to_destination() changed to set_current_from_destination()
Roxy-3D 6 years ago
parent
commit
e9bc9a2ab4
4 changed files with 53 additions and 53 deletions
  1. 10
    10
      Marlin/G26_Mesh_Validation_Tool.cpp
  2. 31
    31
      Marlin/Marlin_main.cpp
  3. 9
    9
      Marlin/ubl_motion.cpp
  4. 3
    3
      Marlin/ultralcd.cpp

+ 10
- 10
Marlin/G26_Mesh_Validation_Tool.cpp View File

@@ -134,10 +134,10 @@
134 134
     extern char lcd_status_message[];
135 135
   #endif
136 136
   extern float destination[XYZE];
137
-  void set_destination_to_current();
137
+  void set_destination_from_current();
138 138
   void prepare_move_to_destination();
139 139
   inline void sync_plan_position_e() { planner.set_e_position_mm(current_position[E_AXIS]); }
140
-  inline void set_current_to_destination() { COPY(current_position, destination); }
140
+  inline void set_current_from_destination() { COPY(current_position, destination); }
141 141
   #if ENABLED(NEWPANEL)
142 142
     void lcd_setstatusPGM(const char* const message, const int8_t level);
143 143
     void chirp_at_user();
@@ -225,7 +225,7 @@
225 225
     if (current_position[Z_AXIS] < Z_CLEARANCE_BETWEEN_PROBES) {
226 226
       do_blocking_move_to_z(Z_CLEARANCE_BETWEEN_PROBES);
227 227
       stepper.synchronize();
228
-      set_current_to_destination();
228
+      set_current_from_destination();
229 229
     }
230 230
 
231 231
     if (turn_on_heaters()) goto LEAVE;
@@ -250,7 +250,7 @@
250 250
     ZERO(vertical_mesh_line_flags);
251 251
 
252 252
     // Move nozzle to the specified height for the first layer
253
-    set_destination_to_current();
253
+    set_destination_from_current();
254 254
     destination[Z_AXIS] = g26_layer_height;
255 255
     move_to(destination, 0.0);
256 256
     move_to(destination, g26_ooze_amount);
@@ -534,7 +534,7 @@
534 534
       G26_line_to_destination(feed_value);
535 535
 
536 536
       stepper.synchronize();
537
-      set_destination_to_current();
537
+      set_destination_from_current();
538 538
     }
539 539
 
540 540
     // Check if X or Y is involved in the movement.
@@ -550,7 +550,7 @@
550 550
     G26_line_to_destination(feed_value);
551 551
 
552 552
     stepper.synchronize();
553
-    set_destination_to_current();
553
+    set_destination_from_current();
554 554
 
555 555
   }
556 556
 
@@ -832,7 +832,7 @@
832 832
         lcd_setstatusPGM(PSTR("User-Controlled Prime"), 99);
833 833
         chirp_at_user();
834 834
 
835
-        set_destination_to_current();
835
+        set_destination_from_current();
836 836
 
837 837
         recover_filament(destination); // Make sure G26 doesn't think the filament is retracted().
838 838
 
@@ -849,7 +849,7 @@
849 849
                                     // but because the planner has a buffer, we won't be able
850 850
                                     // to stop as quickly. So we put up with the less smooth
851 851
                                     // action to give the user a more responsive 'Stop'.
852
-          set_destination_to_current();
852
+          set_destination_from_current();
853 853
           idle();
854 854
         }
855 855
 
@@ -873,11 +873,11 @@
873 873
         lcd_setstatusPGM(PSTR("Fixed Length Prime."), 99);
874 874
         lcd_quick_feedback();
875 875
       #endif
876
-      set_destination_to_current();
876
+      set_destination_from_current();
877 877
       destination[E_AXIS] += g26_prime_length;
878 878
       G26_line_to_destination(planner.max_feedrate_mm_s[E_AXIS] / 15.0);
879 879
       stepper.synchronize();
880
-      set_destination_to_current();
880
+      set_destination_from_current();
881 881
       retract_filament(destination);
882 882
     }
883 883
 

+ 31
- 31
Marlin/Marlin_main.cpp View File

@@ -350,7 +350,7 @@
350 350
                            || isnan(ubl.z_values[0][0]))
351 351
 #endif
352 352
 
353
-#if ENABLED(NEOPIXEL_LED) 
353
+#if ENABLED(NEOPIXEL_LED)
354 354
   #if NEOPIXEL_TYPE == NEO_RGB || NEOPIXEL_TYPE == NEO_RBG || NEOPIXEL_TYPE == NEO_GRB || NEOPIXEL_TYPE == NEO_GBR || NEOPIXEL_TYPE == NEO_BRG || NEOPIXEL_TYPE == NEO_BGR
355 355
     #define NEO_WHITE 255, 255, 255
356 356
   #else
@@ -379,7 +379,7 @@ float current_position[XYZE] = { 0.0 };
379 379
 /**
380 380
  * Cartesian Destination
381 381
  *   A temporary position, usually applied to 'current_position'.
382
- *   Set with 'gcode_get_destination' or 'set_destination_to_current'.
382
+ *   Set with 'gcode_get_destination' or 'set_destination_from_current'.
383 383
  *   'line_to_destination' sets 'current_position' to 'destination'.
384 384
  */
385 385
 float destination[XYZE] = { 0.0 };
@@ -1633,8 +1633,8 @@ inline void line_to_destination(const float fr_mm_s) {
1633 1633
 }
1634 1634
 inline void line_to_destination() { line_to_destination(feedrate_mm_s); }
1635 1635
 
1636
-inline void set_current_to_destination() { COPY(current_position, destination); }
1637
-inline void set_destination_to_current() { COPY(destination, current_position); }
1636
+inline void set_current_from_destination() { COPY(current_position, destination); }
1637
+inline void set_destination_from_current() { COPY(destination, current_position); }
1638 1638
 
1639 1639
 #if IS_KINEMATIC
1640 1640
   /**
@@ -1660,7 +1660,7 @@ inline void set_destination_to_current() { COPY(destination, current_position);
1660 1660
       planner.buffer_line_kinematic(destination, MMS_SCALED(fr_mm_s ? fr_mm_s : feedrate_mm_s), active_extruder);
1661 1661
     #endif
1662 1662
 
1663
-    set_current_to_destination();
1663
+    set_current_from_destination();
1664 1664
   }
1665 1665
 #endif // IS_KINEMATIC
1666 1666
 
@@ -1681,10 +1681,10 @@ void do_blocking_move_to(const float &lx, const float &ly, const float &lz, cons
1681 1681
 
1682 1682
     feedrate_mm_s = fr_mm_s ? fr_mm_s : XY_PROBE_FEEDRATE_MM_S;
1683 1683
 
1684
-    set_destination_to_current();          // sync destination at the start
1684
+    set_destination_from_current();          // sync destination at the start
1685 1685
 
1686 1686
     #if ENABLED(DEBUG_LEVELING_FEATURE)
1687
-      if (DEBUGGING(LEVELING)) DEBUG_POS("set_destination_to_current", destination);
1687
+      if (DEBUGGING(LEVELING)) DEBUG_POS("set_destination_from_current", destination);
1688 1688
     #endif
1689 1689
 
1690 1690
     // when in the danger zone
@@ -1693,7 +1693,7 @@ void do_blocking_move_to(const float &lx, const float &ly, const float &lz, cons
1693 1693
         destination[X_AXIS] = lx;           // move directly (uninterpolated)
1694 1694
         destination[Y_AXIS] = ly;
1695 1695
         destination[Z_AXIS] = lz;
1696
-        prepare_uninterpolated_move_to_destination(); // set_current_to_destination
1696
+        prepare_uninterpolated_move_to_destination(); // set_current_from_destination
1697 1697
         #if ENABLED(DEBUG_LEVELING_FEATURE)
1698 1698
           if (DEBUGGING(LEVELING)) DEBUG_POS("danger zone move", current_position);
1699 1699
         #endif
@@ -1701,7 +1701,7 @@ void do_blocking_move_to(const float &lx, const float &ly, const float &lz, cons
1701 1701
       }
1702 1702
       else {
1703 1703
         destination[Z_AXIS] = delta_clip_start_height;
1704
-        prepare_uninterpolated_move_to_destination(); // set_current_to_destination
1704
+        prepare_uninterpolated_move_to_destination(); // set_current_from_destination
1705 1705
         #if ENABLED(DEBUG_LEVELING_FEATURE)
1706 1706
           if (DEBUGGING(LEVELING)) DEBUG_POS("zone border move", current_position);
1707 1707
         #endif
@@ -1710,7 +1710,7 @@ void do_blocking_move_to(const float &lx, const float &ly, const float &lz, cons
1710 1710
 
1711 1711
     if (lz > current_position[Z_AXIS]) {    // raising?
1712 1712
       destination[Z_AXIS] = lz;
1713
-      prepare_uninterpolated_move_to_destination();   // set_current_to_destination
1713
+      prepare_uninterpolated_move_to_destination();   // set_current_from_destination
1714 1714
       #if ENABLED(DEBUG_LEVELING_FEATURE)
1715 1715
         if (DEBUGGING(LEVELING)) DEBUG_POS("z raise move", current_position);
1716 1716
       #endif
@@ -1718,14 +1718,14 @@ void do_blocking_move_to(const float &lx, const float &ly, const float &lz, cons
1718 1718
 
1719 1719
     destination[X_AXIS] = lx;
1720 1720
     destination[Y_AXIS] = ly;
1721
-    prepare_move_to_destination();         // set_current_to_destination
1721
+    prepare_move_to_destination();         // set_current_from_destination
1722 1722
     #if ENABLED(DEBUG_LEVELING_FEATURE)
1723 1723
       if (DEBUGGING(LEVELING)) DEBUG_POS("xy move", current_position);
1724 1724
     #endif
1725 1725
 
1726 1726
     if (lz < current_position[Z_AXIS]) {    // lowering?
1727 1727
       destination[Z_AXIS] = lz;
1728
-      prepare_uninterpolated_move_to_destination();   // set_current_to_destination
1728
+      prepare_uninterpolated_move_to_destination();   // set_current_from_destination
1729 1729
       #if ENABLED(DEBUG_LEVELING_FEATURE)
1730 1730
         if (DEBUGGING(LEVELING)) DEBUG_POS("z lower move", current_position);
1731 1731
       #endif
@@ -1735,7 +1735,7 @@ void do_blocking_move_to(const float &lx, const float &ly, const float &lz, cons
1735 1735
 
1736 1736
     if (!position_is_reachable_xy(lx, ly)) return;
1737 1737
 
1738
-    set_destination_to_current();
1738
+    set_destination_from_current();
1739 1739
 
1740 1740
     // If Z needs to raise, do it before moving XY
1741 1741
     if (destination[Z_AXIS] < lz) {
@@ -3196,7 +3196,7 @@ static void homeaxis(const AxisEnum axis) {
3196 3196
     flow_percentage[active_extruder] = 100;
3197 3197
 
3198 3198
     // The current position will be the destination for E and Z moves
3199
-    set_destination_to_current();
3199
+    set_destination_from_current();
3200 3200
 
3201 3201
     stepper.synchronize(); // Wait for all moves to finish
3202 3202
 
@@ -3996,7 +3996,7 @@ inline void gcode_G28(const bool always_home_all) {
3996 3996
                homeZ = always_home_all || parser.seen('Z'),
3997 3997
                home_all = (!homeX && !homeY && !homeZ) || (homeX && homeY && homeZ);
3998 3998
 
3999
-    set_destination_to_current();
3999
+    set_destination_from_current();
4000 4000
 
4001 4001
     #if Z_HOME_DIR > 0  // If homing away from BED do Z first
4002 4002
 
@@ -4204,7 +4204,7 @@ void home_all_axes() { gcode_G28(true); }
4204 4204
     set_bed_leveling_enabled(true);
4205 4205
     #if ENABLED(MESH_G28_REST_ORIGIN)
4206 4206
       current_position[Z_AXIS] = LOGICAL_Z_POSITION(Z_MIN_POS);
4207
-      set_destination_to_current();
4207
+      set_destination_from_current();
4208 4208
       line_to_destination(homing_feedrate(Z_AXIS));
4209 4209
       stepper.synchronize();
4210 4210
     #endif
@@ -5818,7 +5818,7 @@ void home_all_axes() { gcode_G28(true); }
5818 5818
 
5819 5819
       #if ENABLED(PROBE_DOUBLE_TOUCH)
5820 5820
         // Move away by the retract distance
5821
-        set_destination_to_current();
5821
+        set_destination_from_current();
5822 5822
         LOOP_XYZ(i) destination[i] += retract_mm[i];
5823 5823
         endstops.enable(false);
5824 5824
         prepare_move_to_destination();
@@ -5906,7 +5906,7 @@ void home_all_axes() { gcode_G28(true); }
5906 5906
         #define _GET_MESH_Y(J) mbl.index_to_ypos[J]
5907 5907
       #endif
5908 5908
 
5909
-      set_destination_to_current();
5909
+      set_destination_from_current();
5910 5910
       if (hasI) destination[X_AXIS] = LOGICAL_X_POSITION(_GET_MESH_X(ix));
5911 5911
       if (hasJ) destination[Y_AXIS] = LOGICAL_Y_POSITION(_GET_MESH_Y(iy));
5912 5912
       if (parser.boolval('P')) {
@@ -6249,7 +6249,7 @@ inline void gcode_M17() {
6249 6249
 
6250 6250
     if (retract) {
6251 6251
       // Initial retract before move to filament change position
6252
-      set_destination_to_current();
6252
+      set_destination_from_current();
6253 6253
       destination[E_AXIS] += retract;
6254 6254
       RUNPLAN(PAUSE_PARK_RETRACT_FEEDRATE);
6255 6255
       stepper.synchronize();
@@ -6271,7 +6271,7 @@ inline void gcode_M17() {
6271 6271
       }
6272 6272
 
6273 6273
       // Unload filament
6274
-      set_destination_to_current();
6274
+      set_destination_from_current();
6275 6275
       destination[E_AXIS] += unload_length;
6276 6276
       RUNPLAN(FILAMENT_CHANGE_UNLOAD_FEEDRATE);
6277 6277
       stepper.synchronize();
@@ -6375,7 +6375,7 @@ inline void gcode_M17() {
6375 6375
       filament_change_beep(max_beep_count, true);
6376 6376
     #endif
6377 6377
 
6378
-    set_destination_to_current();
6378
+    set_destination_from_current();
6379 6379
 
6380 6380
     if (load_length != 0) {
6381 6381
       #if ENABLED(ULTIPANEL)
@@ -10476,7 +10476,7 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n
10476 10476
         }
10477 10477
 
10478 10478
         // Save current position to destination, for use later
10479
-        set_destination_to_current();
10479
+        set_destination_from_current();
10480 10480
 
10481 10481
         #if ENABLED(DUAL_X_CARRIAGE)
10482 10482
 
@@ -12240,7 +12240,7 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) {
12240 12240
     if (cx1 == cx2 && cy1 == cy2) {
12241 12241
       // Start and end on same mesh square
12242 12242
       line_to_destination(fr_mm_s);
12243
-      set_current_to_destination();
12243
+      set_current_from_destination();
12244 12244
       return;
12245 12245
     }
12246 12246
 
@@ -12267,7 +12267,7 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) {
12267 12267
     else {
12268 12268
       // Already split on a border
12269 12269
       line_to_destination(fr_mm_s);
12270
-      set_current_to_destination();
12270
+      set_current_from_destination();
12271 12271
       return;
12272 12272
     }
12273 12273
 
@@ -12303,7 +12303,7 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) {
12303 12303
     if (cx1 == cx2 && cy1 == cy2) {
12304 12304
       // Start and end on same mesh square
12305 12305
       line_to_destination(fr_mm_s);
12306
-      set_current_to_destination();
12306
+      set_current_from_destination();
12307 12307
       return;
12308 12308
     }
12309 12309
 
@@ -12330,7 +12330,7 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) {
12330 12330
     else {
12331 12331
       // Already split on a border
12332 12332
       line_to_destination(fr_mm_s);
12333
-      set_current_to_destination();
12333
+      set_current_from_destination();
12334 12334
       return;
12335 12335
     }
12336 12336
 
@@ -12521,7 +12521,7 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) {
12521 12521
             // Skip it, but keep track of the current position
12522 12522
             // (so it can be used as the start of the next non-travel move)
12523 12523
             if (delayed_move_time != 0xFFFFFFFFUL) {
12524
-              set_current_to_destination();
12524
+              set_current_from_destination();
12525 12525
               NOLESS(raised_parked_position[Z_AXIS], destination[Z_AXIS]);
12526 12526
               delayed_move_time = millis();
12527 12527
               return true;
@@ -12627,7 +12627,7 @@ void prepare_move_to_destination() {
12627 12627
     #endif
12628 12628
   ) return;
12629 12629
 
12630
-  set_current_to_destination();
12630
+  set_current_from_destination();
12631 12631
 }
12632 12632
 
12633 12633
 #if ENABLED(ARC_SUPPORT)
@@ -12784,7 +12784,7 @@ void prepare_move_to_destination() {
12784 12784
     // As far as the parser is concerned, the position is now == target. In reality the
12785 12785
     // motion control system might still be processing the action and the real tool position
12786 12786
     // in any intermediate location.
12787
-    set_current_to_destination();
12787
+    set_current_from_destination();
12788 12788
   } // plan_arc
12789 12789
 
12790 12790
 #endif // ARC_SUPPORT
@@ -12797,7 +12797,7 @@ void prepare_move_to_destination() {
12797 12797
     // As far as the parser is concerned, the position is now == destination. In reality the
12798 12798
     // motion control system might still be processing the action and the real tool position
12799 12799
     // in any intermediate location.
12800
-    set_current_to_destination();
12800
+    set_current_from_destination();
12801 12801
   }
12802 12802
 
12803 12803
 #endif // BEZIER_CURVE_SUPPORT
@@ -13321,7 +13321,7 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) {
13321 13321
     if (delayed_move_time && ELAPSED(ms, delayed_move_time + 1000UL) && IsRunning()) {
13322 13322
       // travel moves have been received so enact them
13323 13323
       delayed_move_time = 0xFFFFFFFFUL; // force moves to be done
13324
-      set_destination_to_current();
13324
+      set_destination_from_current();
13325 13325
       prepare_move_to_destination();
13326 13326
     }
13327 13327
   #endif

+ 9
- 9
Marlin/ubl_motion.cpp View File

@@ -33,9 +33,9 @@
33 33
   extern float destination[XYZE];
34 34
 
35 35
   #if AVR_AT90USB1286_FAMILY  // Teensyduino & Printrboard IDE extensions have compile errors without this
36
-    inline void set_current_to_destination() { COPY(current_position, destination); }
36
+    inline void set_current_from_destination() { COPY(current_position, destination); }
37 37
   #else
38
-    extern void set_current_to_destination();
38
+    extern void set_current_from_destination();
39 39
   #endif
40 40
 
41 41
 #if ENABLED(DELTA)
@@ -154,7 +154,7 @@
154 154
         // a reasonable correction would be.
155 155
 
156 156
         planner._buffer_line(end[X_AXIS], end[Y_AXIS], end[Z_AXIS], end[E_AXIS], feed_rate, extruder);
157
-        set_current_to_destination();
157
+        set_current_from_destination();
158 158
 
159 159
         if (g26_debug_flag)
160 160
           debug_current_and_destination(PSTR("out of bounds in ubl.line_to_destination()"));
@@ -202,7 +202,7 @@
202 202
       if (g26_debug_flag)
203 203
         debug_current_and_destination(PSTR("FINAL_MOVE in ubl.line_to_destination()"));
204 204
 
205
-      set_current_to_destination();
205
+      set_current_from_destination();
206 206
       return;
207 207
     }
208 208
 
@@ -314,7 +314,7 @@
314 314
       if (current_position[X_AXIS] != end[X_AXIS] || current_position[Y_AXIS] != end[Y_AXIS])
315 315
         goto FINAL_MOVE;
316 316
 
317
-      set_current_to_destination();
317
+      set_current_from_destination();
318 318
       return;
319 319
     }
320 320
 
@@ -375,7 +375,7 @@
375 375
       if (current_position[X_AXIS] != end[X_AXIS] || current_position[Y_AXIS] != end[Y_AXIS])
376 376
         goto FINAL_MOVE;
377 377
 
378
-      set_current_to_destination();
378
+      set_current_from_destination();
379 379
       return;
380 380
     }
381 381
 
@@ -469,7 +469,7 @@
469 469
     if (current_position[X_AXIS] != end[X_AXIS] || current_position[Y_AXIS] != end[Y_AXIS])
470 470
       goto FINAL_MOVE;
471 471
 
472
-    set_current_to_destination();
472
+    set_current_from_destination();
473 473
   }
474 474
 
475 475
   #if UBL_DELTA
@@ -619,7 +619,7 @@
619 619
 
620 620
         } while (segments);
621 621
 
622
-        return false; // moved but did not set_current_to_destination();
622
+        return false; // moved but did not set_current_from_destination();
623 623
       }
624 624
 
625 625
       // Otherwise perform per-segment leveling
@@ -700,7 +700,7 @@
700 700
           ubl_buffer_segment_raw( seg_rx, seg_ry, seg_rz + z_cxcy, seg_le, feedrate );
701 701
 
702 702
           if (segments == 0 )                       // done with last segment
703
-            return false;                           // did not set_current_to_destination()
703
+            return false;                           // did not set_current_from_destination()
704 704
 
705 705
           seg_rx += seg_dx;
706 706
           seg_ry += seg_dy;

+ 3
- 3
Marlin/ultralcd.cpp View File

@@ -2794,7 +2794,7 @@ void kill_screen(const char* lcd_msg) {
2794 2794
   #if IS_KINEMATIC
2795 2795
     extern float feedrate_mm_s;
2796 2796
     extern float destination[XYZE];
2797
-    void set_destination_to_current();
2797
+    void set_destination_from_current();
2798 2798
     void prepare_move_to_destination();
2799 2799
   #endif
2800 2800
 
@@ -2819,7 +2819,7 @@ void kill_screen(const char* lcd_msg) {
2819 2819
         #endif
2820 2820
 
2821 2821
         // Set movement on a single axis
2822
-        set_destination_to_current();
2822
+        set_destination_from_current();
2823 2823
         destination[manual_move_axis] += manual_move_offset;
2824 2824
 
2825 2825
         // Reset for the next move
@@ -2831,7 +2831,7 @@ void kill_screen(const char* lcd_msg) {
2831 2831
         // previous invocation is being blocked. Modifications to manual_move_offset shouldn't be made while
2832 2832
         // processing_manual_move is true or the planner will get out of sync.
2833 2833
         processing_manual_move = true;
2834
-        prepare_move_to_destination(); // will call set_current_to_destination
2834
+        prepare_move_to_destination(); // will call set_current_from_destination()
2835 2835
         processing_manual_move = false;
2836 2836
 
2837 2837
         feedrate_mm_s = old_feedrate;

Loading…
Cancel
Save