Browse Source

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

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
72156a2029

+ 1
- 1
Marlin/src/Marlin.cpp View File

@@ -502,7 +502,7 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) {
502 502
     if (delayed_move_time && ELAPSED(ms, delayed_move_time + 1000UL) && IsRunning()) {
503 503
       // travel moves have been received so enact them
504 504
       delayed_move_time = 0xFFFFFFFFUL; // force moves to be done
505
-      set_destination_to_current();
505
+      set_destination_from_current();
506 506
       prepare_move_to_destination();
507 507
     }
508 508
   #endif

+ 2
- 2
Marlin/src/feature/bedlevel/abl/abl.cpp View File

@@ -378,7 +378,7 @@ float bilinear_z_offset(const float logical[XYZ]) {
378 378
     if (cx1 == cx2 && cy1 == cy2) {
379 379
       // Start and end on same mesh square
380 380
       line_to_destination(fr_mm_s);
381
-      set_current_to_destination();
381
+      set_current_from_destination();
382 382
       return;
383 383
     }
384 384
 
@@ -405,7 +405,7 @@ float bilinear_z_offset(const float logical[XYZ]) {
405 405
     else {
406 406
       // Already split on a border
407 407
       line_to_destination(fr_mm_s);
408
-      set_current_to_destination();
408
+      set_current_from_destination();
409 409
       return;
410 410
     }
411 411
 

+ 2
- 2
Marlin/src/feature/bedlevel/mbl/mesh_bed_leveling.cpp View File

@@ -69,7 +69,7 @@
69 69
     if (cx1 == cx2 && cy1 == cy2) {
70 70
       // Start and end on same mesh square
71 71
       line_to_destination(fr_mm_s);
72
-      set_current_to_destination();
72
+      set_current_from_destination();
73 73
       return;
74 74
     }
75 75
 
@@ -96,7 +96,7 @@
96 96
     else {
97 97
       // Already split on a border
98 98
       line_to_destination(fr_mm_s);
99
-      set_current_to_destination();
99
+      set_current_from_destination();
100 100
       return;
101 101
     }
102 102
 

+ 8
- 8
Marlin/src/feature/bedlevel/ubl/G26_Mesh_Validation_Tool.cpp View File

@@ -222,7 +222,7 @@ void unified_bed_leveling::G26() {
222 222
   if (current_position[Z_AXIS] < Z_CLEARANCE_BETWEEN_PROBES) {
223 223
     do_blocking_move_to_z(Z_CLEARANCE_BETWEEN_PROBES);
224 224
     stepper.synchronize();
225
-    set_current_to_destination();
225
+    set_current_from_destination();
226 226
   }
227 227
 
228 228
   if (turn_on_heaters()) goto LEAVE;
@@ -247,7 +247,7 @@ void unified_bed_leveling::G26() {
247 247
   ZERO(vertical_mesh_line_flags);
248 248
 
249 249
   // Move nozzle to the specified height for the first layer
250
-  set_destination_to_current();
250
+  set_destination_from_current();
251 251
   destination[Z_AXIS] = g26_layer_height;
252 252
   move_to(destination, 0.0);
253 253
   move_to(destination, g26_ooze_amount);
@@ -531,7 +531,7 @@ void unified_bed_leveling::move_to(const float &x, const float &y, const float &
531 531
     G26_line_to_destination(feed_value);
532 532
 
533 533
     stepper.synchronize();
534
-    set_destination_to_current();
534
+    set_destination_from_current();
535 535
   }
536 536
 
537 537
   // Check if X or Y is involved in the movement.
@@ -547,7 +547,7 @@ void unified_bed_leveling::move_to(const float &x, const float &y, const float &
547 547
   G26_line_to_destination(feed_value);
548 548
 
549 549
   stepper.synchronize();
550
-  set_destination_to_current();
550
+  set_destination_from_current();
551 551
 
552 552
 }
553 553
 
@@ -829,7 +829,7 @@ bool unified_bed_leveling::prime_nozzle() {
829 829
       lcd_setstatusPGM(PSTR("User-Controlled Prime"), 99);
830 830
       chirp_at_user();
831 831
 
832
-      set_destination_to_current();
832
+      set_destination_from_current();
833 833
 
834 834
       recover_filament(destination); // Make sure G26 doesn't think the filament is retracted().
835 835
 
@@ -846,7 +846,7 @@ bool unified_bed_leveling::prime_nozzle() {
846 846
                                   // but because the planner has a buffer, we won't be able
847 847
                                   // to stop as quickly. So we put up with the less smooth
848 848
                                   // action to give the user a more responsive 'Stop'.
849
-        set_destination_to_current();
849
+        set_destination_from_current();
850 850
         idle();
851 851
       }
852 852
 
@@ -870,11 +870,11 @@ bool unified_bed_leveling::prime_nozzle() {
870 870
       lcd_setstatusPGM(PSTR("Fixed Length Prime."), 99);
871 871
       lcd_quick_feedback();
872 872
     #endif
873
-    set_destination_to_current();
873
+    set_destination_from_current();
874 874
     destination[E_AXIS] += g26_prime_length;
875 875
     G26_line_to_destination(planner.max_feedrate_mm_s[E_AXIS] / 15.0);
876 876
     stepper.synchronize();
877
-    set_destination_to_current();
877
+    set_destination_from_current();
878 878
     retract_filament(destination);
879 879
   }
880 880
 

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

@@ -39,9 +39,9 @@
39 39
   extern float destination[XYZE];
40 40
 
41 41
   #if AVR_AT90USB1286_FAMILY  // Teensyduino & Printrboard IDE extensions have compile errors without this
42
-    inline void set_current_to_destination() { COPY(current_position, destination); }
42
+    inline void set_current_from_destination() { COPY(current_position, destination); }
43 43
   #else
44
-    extern void set_current_to_destination();
44
+    extern void set_current_from_destination();
45 45
   #endif
46 46
 
47 47
   static void debug_echo_axis(const AxisEnum axis) {
@@ -141,7 +141,7 @@
141 141
         // a reasonable correction would be.
142 142
 
143 143
         planner._buffer_line(end[X_AXIS], end[Y_AXIS], end[Z_AXIS], end[E_AXIS], feed_rate, extruder);
144
-        set_current_to_destination();
144
+        set_current_from_destination();
145 145
 
146 146
         if (g26_debug_flag)
147 147
           debug_current_and_destination(PSTR("out of bounds in ubl.line_to_destination()"));
@@ -189,7 +189,7 @@
189 189
       if (g26_debug_flag)
190 190
         debug_current_and_destination(PSTR("FINAL_MOVE in ubl.line_to_destination()"));
191 191
 
192
-      set_current_to_destination();
192
+      set_current_from_destination();
193 193
       return;
194 194
     }
195 195
 
@@ -301,7 +301,7 @@
301 301
       if (current_position[X_AXIS] != end[X_AXIS] || current_position[Y_AXIS] != end[Y_AXIS])
302 302
         goto FINAL_MOVE;
303 303
 
304
-      set_current_to_destination();
304
+      set_current_from_destination();
305 305
       return;
306 306
     }
307 307
 
@@ -362,7 +362,7 @@
362 362
       if (current_position[X_AXIS] != end[X_AXIS] || current_position[Y_AXIS] != end[Y_AXIS])
363 363
         goto FINAL_MOVE;
364 364
 
365
-      set_current_to_destination();
365
+      set_current_from_destination();
366 366
       return;
367 367
     }
368 368
 
@@ -456,7 +456,7 @@
456 456
     if (current_position[X_AXIS] != end[X_AXIS] || current_position[Y_AXIS] != end[Y_AXIS])
457 457
       goto FINAL_MOVE;
458 458
 
459
-    set_current_to_destination();
459
+    set_current_from_destination();
460 460
   }
461 461
 
462 462
   #if UBL_DELTA
@@ -598,7 +598,7 @@
598 598
 
599 599
         } while (segments);
600 600
 
601
-        return false; // moved but did not set_current_to_destination();
601
+        return false; // moved but did not set_current_from_destination();
602 602
       }
603 603
 
604 604
       // Otherwise perform per-segment leveling
@@ -681,7 +681,7 @@
681 681
           ubl_buffer_segment_raw( seg_rx, seg_ry, seg_rz + z_cxcy, seg_le, feedrate );
682 682
 
683 683
           if (segments == 0 )                       // done with last segment
684
-            return false;                           // did not set_current_to_destination()
684
+            return false;                           // did not set_current_from_destination()
685 685
 
686 686
           seg_rx += seg_dx;
687 687
           seg_ry += seg_dy;

+ 1
- 1
Marlin/src/feature/fwretract.cpp View File

@@ -129,7 +129,7 @@ void FWRetract::retract(const bool retracting
129 129
   planner.flow_percentage[active_extruder] = 100;
130 130
 
131 131
   // The current position will be the destination for E and Z moves
132
-  set_destination_to_current();
132
+  set_destination_from_current();
133 133
 
134 134
   stepper.synchronize();  // Wait for buffered moves to complete
135 135
 

+ 3
- 3
Marlin/src/feature/pause.cpp View File

@@ -146,7 +146,7 @@ bool pause_print(const float &retract, const float &z_lift, const float &x_pos,
146 146
 
147 147
   if (retract) {
148 148
     // Initial retract before move to filament change position
149
-    set_destination_to_current();
149
+    set_destination_from_current();
150 150
     destination[E_AXIS] += retract;
151 151
     RUNPLAN(PAUSE_PARK_RETRACT_FEEDRATE);
152 152
     stepper.synchronize();
@@ -168,7 +168,7 @@ bool pause_print(const float &retract, const float &z_lift, const float &x_pos,
168 168
     }
169 169
 
170 170
     // Unload filament
171
-    set_destination_to_current();
171
+    set_destination_from_current();
172 172
     destination[E_AXIS] += unload_length;
173 173
     RUNPLAN(FILAMENT_CHANGE_UNLOAD_FEEDRATE);
174 174
     stepper.synchronize();
@@ -272,7 +272,7 @@ void resume_print(const float &load_length/*=0*/, const float &initial_extrude_l
272 272
     filament_change_beep(max_beep_count, true);
273 273
   #endif
274 274
 
275
-  set_destination_to_current();
275
+  set_destination_from_current();
276 276
 
277 277
   if (load_length != 0) {
278 278
     #if ENABLED(ULTIPANEL)

+ 1
- 1
Marlin/src/gcode/bedlevel/G42.cpp View File

@@ -55,7 +55,7 @@ void GcodeSuite::G42() {
55 55
       #define _GET_MESH_Y(J) mbl.index_to_ypos[J]
56 56
     #endif
57 57
 
58
-    set_destination_to_current();
58
+    set_destination_from_current();
59 59
     if (hasI) destination[X_AXIS] = LOGICAL_X_POSITION(_GET_MESH_X(ix));
60 60
     if (hasJ) destination[Y_AXIS] = LOGICAL_Y_POSITION(_GET_MESH_Y(iy));
61 61
     if (parser.boolval('P')) {

+ 1
- 1
Marlin/src/gcode/bedlevel/mbl/G29.cpp View File

@@ -47,7 +47,7 @@ void mesh_probing_done() {
47 47
   set_bed_leveling_enabled(true);
48 48
   #if ENABLED(MESH_G28_REST_ORIGIN)
49 49
     current_position[Z_AXIS] = LOGICAL_Z_POSITION(Z_MIN_POS);
50
-    set_destination_to_current();
50
+    set_destination_from_current();
51 51
     line_to_destination(homing_feedrate(Z_AXIS));
52 52
     stepper.synchronize();
53 53
   #endif

+ 1
- 1
Marlin/src/gcode/calibrate/G28.cpp View File

@@ -194,7 +194,7 @@ void GcodeSuite::G28(const bool always_home_all) {
194 194
                homeZ = always_home_all || parser.seen('Z'),
195 195
                home_all = (!homeX && !homeY && !homeZ) || (homeX && homeY && homeZ);
196 196
 
197
-    set_destination_to_current();
197
+    set_destination_from_current();
198 198
 
199 199
     #if Z_HOME_DIR > 0  // If homing away from BED do Z first
200 200
 

+ 1
- 1
Marlin/src/gcode/motion/G2_G3.cpp View File

@@ -181,7 +181,7 @@ void plan_arc(
181 181
   // As far as the parser is concerned, the position is now == target. In reality the
182 182
   // motion control system might still be processing the action and the real tool position
183 183
   // in any intermediate location.
184
-  set_current_to_destination();
184
+  set_current_from_destination();
185 185
 } // plan_arc
186 186
 
187 187
 /**

+ 1
- 1
Marlin/src/gcode/motion/G5.cpp View File

@@ -33,7 +33,7 @@ void plan_cubic_move(const float offset[4]) {
33 33
   // As far as the parser is concerned, the position is now == destination. In reality the
34 34
   // motion control system might still be processing the action and the real tool position
35 35
   // in any intermediate location.
36
-  set_current_to_destination();
36
+  set_current_from_destination();
37 37
 }
38 38
 
39 39
 /**

+ 1
- 1
Marlin/src/gcode/probe/G38.cpp View File

@@ -64,7 +64,7 @@ static bool G38_run_probe() {
64 64
 
65 65
     #if ENABLED(PROBE_DOUBLE_TOUCH)
66 66
       // Move away by the retract distance
67
-      set_destination_to_current();
67
+      set_destination_from_current();
68 68
       LOOP_XYZ(i) destination[i] += retract_mm[i];
69 69
       endstops.enable(false);
70 70
       prepare_move_to_destination();

+ 2
- 2
Marlin/src/lcd/ultralcd.cpp View File

@@ -2810,7 +2810,7 @@ void kill_screen(const char* lcd_msg) {
2810 2810
         #endif
2811 2811
 
2812 2812
         // Set movement on a single axis
2813
-        set_destination_to_current();
2813
+        set_destination_from_current();
2814 2814
         destination[manual_move_axis] += manual_move_offset;
2815 2815
 
2816 2816
         // Reset for the next move
@@ -2819,7 +2819,7 @@ void kill_screen(const char* lcd_msg) {
2819 2819
 
2820 2820
         // Set a blocking flag so no new moves can be added until all segments are done
2821 2821
         processing_manual_move = true;
2822
-        prepare_move_to_destination(); // will call set_current_to_destination
2822
+        prepare_move_to_destination(); // will call set_current_from_destination()
2823 2823
         processing_manual_move = false;
2824 2824
 
2825 2825
         feedrate_mm_s = old_feedrate;

+ 12
- 12
Marlin/src/module/motion.cpp View File

@@ -82,7 +82,7 @@ float current_position[XYZE] = { 0.0 };
82 82
 /**
83 83
  * Cartesian Destination
84 84
  *   A temporary position, usually applied to 'current_position'.
85
- *   Set with 'get_destination_from_command' or 'set_destination_to_current'.
85
+ *   Set with 'get_destination_from_command' or 'set_destination_from_current'.
86 86
  *   'line_to_destination' sets 'current_position' to 'destination'.
87 87
  */
88 88
 float destination[XYZE] = { 0.0 };
@@ -279,7 +279,7 @@ void line_to_destination(const float fr_mm_s) {
279 279
       planner.buffer_line_kinematic(destination, MMS_SCALED(fr_mm_s ? fr_mm_s : feedrate_mm_s), active_extruder);
280 280
     #endif
281 281
 
282
-    set_current_to_destination();
282
+    set_current_from_destination();
283 283
   }
284 284
 
285 285
 #endif // IS_KINEMATIC
@@ -301,10 +301,10 @@ void do_blocking_move_to(const float &lx, const float &ly, const float &lz, cons
301 301
 
302 302
     feedrate_mm_s = fr_mm_s ? fr_mm_s : XY_PROBE_FEEDRATE_MM_S;
303 303
 
304
-    set_destination_to_current();          // sync destination at the start
304
+    set_destination_from_current();          // sync destination at the start
305 305
 
306 306
     #if ENABLED(DEBUG_LEVELING_FEATURE)
307
-      if (DEBUGGING(LEVELING)) DEBUG_POS("set_destination_to_current", destination);
307
+      if (DEBUGGING(LEVELING)) DEBUG_POS("set_destination_from_current", destination);
308 308
     #endif
309 309
 
310 310
     // when in the danger zone
@@ -313,7 +313,7 @@ void do_blocking_move_to(const float &lx, const float &ly, const float &lz, cons
313 313
         destination[X_AXIS] = lx;           // move directly (uninterpolated)
314 314
         destination[Y_AXIS] = ly;
315 315
         destination[Z_AXIS] = lz;
316
-        prepare_uninterpolated_move_to_destination(); // set_current_to_destination
316
+        prepare_uninterpolated_move_to_destination(); // set_current_from_destination()
317 317
         #if ENABLED(DEBUG_LEVELING_FEATURE)
318 318
           if (DEBUGGING(LEVELING)) DEBUG_POS("danger zone move", current_position);
319 319
         #endif
@@ -321,7 +321,7 @@ void do_blocking_move_to(const float &lx, const float &ly, const float &lz, cons
321 321
       }
322 322
       else {
323 323
         destination[Z_AXIS] = delta_clip_start_height;
324
-        prepare_uninterpolated_move_to_destination(); // set_current_to_destination
324
+        prepare_uninterpolated_move_to_destination(); // set_current_from_destination()
325 325
         #if ENABLED(DEBUG_LEVELING_FEATURE)
326 326
           if (DEBUGGING(LEVELING)) DEBUG_POS("zone border move", current_position);
327 327
         #endif
@@ -330,7 +330,7 @@ void do_blocking_move_to(const float &lx, const float &ly, const float &lz, cons
330 330
 
331 331
     if (lz > current_position[Z_AXIS]) {    // raising?
332 332
       destination[Z_AXIS] = lz;
333
-      prepare_uninterpolated_move_to_destination();   // set_current_to_destination
333
+      prepare_uninterpolated_move_to_destination();   // set_current_from_destination()
334 334
       #if ENABLED(DEBUG_LEVELING_FEATURE)
335 335
         if (DEBUGGING(LEVELING)) DEBUG_POS("z raise move", current_position);
336 336
       #endif
@@ -338,14 +338,14 @@ void do_blocking_move_to(const float &lx, const float &ly, const float &lz, cons
338 338
 
339 339
     destination[X_AXIS] = lx;
340 340
     destination[Y_AXIS] = ly;
341
-    prepare_move_to_destination();         // set_current_to_destination
341
+    prepare_move_to_destination();         // set_current_from_destination()
342 342
     #if ENABLED(DEBUG_LEVELING_FEATURE)
343 343
       if (DEBUGGING(LEVELING)) DEBUG_POS("xy move", current_position);
344 344
     #endif
345 345
 
346 346
     if (lz < current_position[Z_AXIS]) {    // lowering?
347 347
       destination[Z_AXIS] = lz;
348
-      prepare_uninterpolated_move_to_destination();   // set_current_to_destination
348
+      prepare_uninterpolated_move_to_destination();   // set_current_from_destination()
349 349
       #if ENABLED(DEBUG_LEVELING_FEATURE)
350 350
         if (DEBUGGING(LEVELING)) DEBUG_POS("z lower move", current_position);
351 351
       #endif
@@ -355,7 +355,7 @@ void do_blocking_move_to(const float &lx, const float &ly, const float &lz, cons
355 355
 
356 356
     if (!position_is_reachable_xy(lx, ly)) return;
357 357
 
358
-    set_destination_to_current();
358
+    set_destination_from_current();
359 359
 
360 360
     // If Z needs to raise, do it before moving XY
361 361
     if (destination[Z_AXIS] < lz) {
@@ -701,7 +701,7 @@ float soft_endstop_min[XYZ] = { X_MIN_BED, Y_MIN_BED, Z_MIN_POS },
701 701
             // Skip it, but keep track of the current position
702 702
             // (so it can be used as the start of the next non-travel move)
703 703
             if (delayed_move_time != 0xFFFFFFFFUL) {
704
-              set_current_to_destination();
704
+              set_current_from_destination();
705 705
               NOLESS(raised_parked_position[Z_AXIS], destination[Z_AXIS]);
706 706
               delayed_move_time = millis();
707 707
               return true;
@@ -807,7 +807,7 @@ void prepare_move_to_destination() {
807 807
     #endif
808 808
   ) return;
809 809
 
810
-  set_current_to_destination();
810
+  set_current_from_destination();
811 811
 }
812 812
 
813 813
 #if HAS_AXIS_UNHOMED_ERR

+ 2
- 2
Marlin/src/module/motion.h View File

@@ -106,8 +106,8 @@ XYZ_DEFS(signed char, home_dir, HOME_DIR);
106 106
 
107 107
 void report_current_position();
108 108
 
109
-inline void set_current_to_destination() { COPY(current_position, destination); }
110
-inline void set_destination_to_current() { COPY(destination, current_position); }
109
+inline void set_current_from_destination() { COPY(current_position, destination); }
110
+inline void set_destination_from_current() { COPY(destination, current_position); }
111 111
 
112 112
 void get_cartesian_from_steppers();
113 113
 void set_current_from_steppers_for_axis(const AxisEnum axis);

+ 1
- 1
Marlin/src/module/tool_change.cpp View File

@@ -176,7 +176,7 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n
176 176
         }
177 177
 
178 178
         // Save current position to destination, for use later
179
-        set_destination_to_current();
179
+        set_destination_from_current();
180 180
 
181 181
         #if ENABLED(DUAL_X_CARRIAGE)
182 182
 

Loading…
Cancel
Save