Scott Lahteine 8 лет назад
Родитель
Сommit
81ffd98dd9
1 измененных файлов: 15 добавлений и 4 удалений
  1. 15
    4
      Marlin/Marlin_main.cpp

+ 15
- 4
Marlin/Marlin_main.cpp Просмотреть файл

@@ -4035,6 +4035,11 @@ inline void gcode_G28() {
4035 4035
    *  L  Set the Left limit of the probing grid
4036 4036
    *  R  Set the Right limit of the probing grid
4037 4037
    *
4038
+   * Parameters with DEBUG_LEVELING_FEATURE only:
4039
+   *
4040
+   *  C  Make a totally fake grid with no actual probing.
4041
+   *     For use in testing when no probing is possible.
4042
+   *
4038 4043
    * Parameters with BILINEAR leveling only:
4039 4044
    *
4040 4045
    *  Z  Supply an additional Z probe offset
@@ -4077,6 +4082,12 @@ inline void gcode_G28() {
4077 4082
       #endif
4078 4083
     #endif
4079 4084
 
4085
+    #if ENABLED(DEBUG_LEVELING_FEATURE) && DISABLED(PROBE_MANUALLY)
4086
+      const bool faux = code_seen('C') && code_value_bool();
4087
+    #else
4088
+      bool constexpr faux = false;
4089
+    #endif
4090
+
4080 4091
     // Don't allow auto-leveling without homing first
4081 4092
     if (axis_unhomed_error(true, true, true)) return;
4082 4093
 
@@ -4292,7 +4303,7 @@ inline void gcode_G28() {
4292 4303
         SYNC_PLAN_POSITION_KINEMATIC();
4293 4304
       }
4294 4305
 
4295
-      setup_for_endstop_or_probe_move();
4306
+      if (!faux) setup_for_endstop_or_probe_move();
4296 4307
 
4297 4308
       //xProbe = yProbe = measured_z = 0;
4298 4309
 
@@ -4550,7 +4561,7 @@ inline void gcode_G28() {
4550 4561
               if (!position_is_reachable(pos, true)) continue;
4551 4562
             #endif
4552 4563
 
4553
-            measured_z = probe_pt(xProbe, yProbe, stow_probe_after_each, verbose_level);
4564
+            measured_z = faux ? 0.001 * random(-100, 101) : probe_pt(xProbe, yProbe, stow_probe_after_each, verbose_level);
4554 4565
 
4555 4566
             if (isnan(measured_z)) {
4556 4567
               planner.abl_enabled = abl_should_enable;
@@ -4585,7 +4596,7 @@ inline void gcode_G28() {
4585 4596
           // Retain the last probe position
4586 4597
           xProbe = LOGICAL_X_POSITION(points[i].x);
4587 4598
           yProbe = LOGICAL_Y_POSITION(points[i].y);
4588
-          measured_z = points[i].z = probe_pt(xProbe, yProbe, stow_probe_after_each, verbose_level);
4599
+          measured_z = points[i].z = faux ? 0.001 * random(-100, 101) : probe_pt(xProbe, yProbe, stow_probe_after_each, verbose_level);
4589 4600
         }
4590 4601
 
4591 4602
         if (isnan(measured_z)) {
@@ -4624,7 +4635,7 @@ inline void gcode_G28() {
4624 4635
     //
4625 4636
 
4626 4637
     // Restore state after probing
4627
-    clean_up_after_endstop_or_probe_move();
4638
+    if (!faux) clean_up_after_endstop_or_probe_move();
4628 4639
 
4629 4640
     #if ENABLED(DEBUG_LEVELING_FEATURE)
4630 4641
       if (DEBUGGING(LEVELING)) DEBUG_POS("> probing complete", current_position);

Загрузка…
Отмена
Сохранить