Browse Source

Allow faux leveling

Scott Lahteine 8 years ago
parent
commit
81ffd98dd9
1 changed files with 15 additions and 4 deletions
  1. 15
    4
      Marlin/Marlin_main.cpp

+ 15
- 4
Marlin/Marlin_main.cpp View File

4035
    *  L  Set the Left limit of the probing grid
4035
    *  L  Set the Left limit of the probing grid
4036
    *  R  Set the Right limit of the probing grid
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
    * Parameters with BILINEAR leveling only:
4043
    * Parameters with BILINEAR leveling only:
4039
    *
4044
    *
4040
    *  Z  Supply an additional Z probe offset
4045
    *  Z  Supply an additional Z probe offset
4077
       #endif
4082
       #endif
4078
     #endif
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
     // Don't allow auto-leveling without homing first
4091
     // Don't allow auto-leveling without homing first
4081
     if (axis_unhomed_error(true, true, true)) return;
4092
     if (axis_unhomed_error(true, true, true)) return;
4082
 
4093
 
4292
         SYNC_PLAN_POSITION_KINEMATIC();
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
       //xProbe = yProbe = measured_z = 0;
4308
       //xProbe = yProbe = measured_z = 0;
4298
 
4309
 
4550
               if (!position_is_reachable(pos, true)) continue;
4561
               if (!position_is_reachable(pos, true)) continue;
4551
             #endif
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
             if (isnan(measured_z)) {
4566
             if (isnan(measured_z)) {
4556
               planner.abl_enabled = abl_should_enable;
4567
               planner.abl_enabled = abl_should_enable;
4585
           // Retain the last probe position
4596
           // Retain the last probe position
4586
           xProbe = LOGICAL_X_POSITION(points[i].x);
4597
           xProbe = LOGICAL_X_POSITION(points[i].x);
4587
           yProbe = LOGICAL_Y_POSITION(points[i].y);
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
         if (isnan(measured_z)) {
4602
         if (isnan(measured_z)) {
4624
     //
4635
     //
4625
 
4636
 
4626
     // Restore state after probing
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
     #if ENABLED(DEBUG_LEVELING_FEATURE)
4640
     #if ENABLED(DEBUG_LEVELING_FEATURE)
4630
       if (DEBUGGING(LEVELING)) DEBUG_POS("> probing complete", current_position);
4641
       if (DEBUGGING(LEVELING)) DEBUG_POS("> probing complete", current_position);

Loading…
Cancel
Save