Kaynağa Gözat

Add ALL_AXES manual move for UBL mesh editing

Co-Authored-By: Jason Smith <20053467+sjasonsmith@users.noreply.github.com>

#20620
Scott Lahteine 4 yıl önce
ebeveyn
işleme
1d63fe6542

+ 11
- 4
Marlin/src/lcd/marlinui.cpp Dosyayı Görüntüle

@@ -684,8 +684,11 @@ void MarlinUI::quick_feedback(const bool clear_buttons/*=true*/) {
684 684
 
685 685
   millis_t ManualMove::start_time = 0;
686 686
   float ManualMove::menu_scale = 1;
687
-  TERN_(IS_KINEMATIC, float ManualMove::offset = 0);
688
-  TERN_(IS_KINEMATIC, bool ManualMove::processing = false);
687
+  #if IS_KINEMATIC
688
+    float ManualMove::offset = 0;
689
+    xyze_pos_t ManualMove::all_axes_destination = { 0 };
690
+    bool ManualMove::processing = false;
691
+  #endif
689 692
   TERN_(MULTI_MANUAL, int8_t ManualMove::e_index = 0);
690 693
   AxisEnum ManualMove::axis = NO_AXIS;
691 694
 
@@ -725,8 +728,12 @@ void MarlinUI::quick_feedback(const bool clear_buttons/*=true*/) {
725 728
         #endif
726 729
 
727 730
         // Apply a linear offset to a single axis
728
-        destination = current_position;
729
-        if (axis <= XYZE) destination[axis] += offset;
731
+        if (axis == ALL_AXES)
732
+          destination = all_axes_destination;
733
+        else if (axis <= XYZE) {
734
+          destination = current_position;
735
+          destination[axis] += offset;
736
+        }
730 737
 
731 738
         // Reset for the next move
732 739
         offset = 0;

+ 15
- 0
Marlin/src/lcd/marlinui.h Dosyayı Görüntüle

@@ -23,6 +23,8 @@
23 23
 
24 24
 #include "../inc/MarlinConfig.h"
25 25
 
26
+#include "../module/motion.h"
27
+
26 28
 #if HAS_BUZZER
27 29
   #include "../libs/buzzer.h"
28 30
 #endif
@@ -270,9 +272,22 @@
270 272
       static int8_t constexpr e_index = 0;
271 273
     #endif
272 274
     static millis_t start_time;
275
+    TERN_(IS_KINEMATIC, static xyze_pos_t all_axes_destination);
273 276
   public:
274 277
     static float menu_scale;
275 278
     TERN_(IS_KINEMATIC, static float offset);
279
+    template <typename T>
280
+    void set_destination(const T& dest) {
281
+      #if IS_KINEMATIC
282
+        // Moves are segmented, so the entire move is not submitted at once.
283
+        // Using a separate variable prevents corrupting the in-progress move.
284
+        all_axes_destination = current_position;
285
+        all_axes_destination.set(dest);
286
+      #else
287
+        // Moves are submitted as single line to the planner using buffer_line.
288
+        current_position.set(dest);
289
+      #endif
290
+    }
276 291
     #if IS_KINEMATIC
277 292
       static bool processing;
278 293
     #else

+ 3
- 4
Marlin/src/lcd/menu/menu_ubl.cpp Dosyayı Görüntüle

@@ -426,10 +426,9 @@ void ubl_map_move_to_xy() {
426 426
     }
427 427
   #endif
428 428
 
429
-  // Do an internal move to the mesh point
430
-  destination.set(ubl.mesh_index_to_xpos(x_plot), ubl.mesh_index_to_ypos(y_plot));
431
-  constexpr feedRate_t fr_mm_s = MMM_TO_MMS(XY_PROBE_SPEED);
432
-  prepare_internal_move_to_destination(fr_mm_s); // Set current_position from destination
429
+  // Use the built-in manual move handler to move to the mesh point.
430
+  ui.manual_move.set_destination(xy);
431
+  ui.manual_move.soon(ALL_AXES);
433 432
 }
434 433
 
435 434
 inline int32_t grid_index(const uint8_t x, const uint8_t y) {

Loading…
İptal
Kaydet