Browse Source

Add leveling type and details to machine_info

Scott Lahteine 8 years ago
parent
commit
1fceda4fb0
1 changed files with 41 additions and 0 deletions
  1. 41
    0
      Marlin/Marlin_main.cpp

+ 41
- 0
Marlin/Marlin_main.cpp View File

@@ -2850,6 +2850,47 @@ inline void gcode_G4() {
2850 2850
         SERIAL_ECHOPGM(" & Same Z as");
2851 2851
       SERIAL_ECHOLNPGM(" Nozzle)");
2852 2852
     #endif
2853
+
2854
+    #if HAS_ABL
2855
+      SERIAL_ECHOPGM("Auto Bed Leveling: ");
2856
+      #if ENABLED(AUTO_BED_LEVELING_LINEAR)
2857
+        SERIAL_ECHOPGM("LINEAR");
2858
+      #elif ENABLED(AUTO_BED_LEVELING_BILINEAR)
2859
+        SERIAL_ECHOPGM("BILINEAR");
2860
+      #elif ENABLED(AUTO_BED_LEVELING_3POINT)
2861
+        SERIAL_ECHOPGM("3POINT");
2862
+      #endif
2863
+      if (planner.abl_enabled) {
2864
+        SERIAL_ECHOLNPGM(" (enabled)");
2865
+        #if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_3POINT)
2866
+          float diff[XYZ] = {
2867
+            stepper.get_axis_position_mm(X_AXIS) - current_position[X_AXIS],
2868
+            stepper.get_axis_position_mm(Y_AXIS) - current_position[Y_AXIS],
2869
+            stepper.get_axis_position_mm(Z_AXIS) - current_position[Z_AXIS]
2870
+          };
2871
+          SERIAL_ECHOPGM("ABL Adjustment X");
2872
+          if (diff[X_AXIS] > 0) SERIAL_CHAR('+');
2873
+          SERIAL_ECHO(diff[X_AXIS]);
2874
+          SERIAL_ECHOPGM(" Y");
2875
+          if (diff[Y_AXIS] > 0) SERIAL_CHAR('+');
2876
+          SERIAL_ECHO(diff[Y_AXIS]);
2877
+          SERIAL_ECHOPGM(" Z");
2878
+          if (diff[Z_AXIS] > 0) SERIAL_CHAR('+');
2879
+          SERIAL_ECHO(diff[Z_AXIS]);
2880
+        #elif ENABLED(AUTO_BED_LEVELING_BILINEAR)
2881
+          SERIAL_ECHOPAIR("ABL Adjustment Z", bilinear_z_offset(current_position));
2882
+        #endif
2883
+      }
2884
+      SERIAL_EOL;
2885
+    #elif ENABLED(MESH_BED_LEVELING)
2886
+      SERIAL_ECHOPGM("Mesh Bed Leveling");
2887
+      if (mbl.active()) {
2888
+        SERIAL_ECHOLNPGM(" (enabled)");
2889
+        SERIAL_ECHOPAIR("MBL Adjustment Z", mbl.get_z(RAW_CURRENT_POSITION(X_AXIS), RAW_CURRENT_POSITION(Y_AXIS)));
2890
+      }
2891
+      SERIAL_EOL;
2892
+    #endif
2893
+
2853 2894
   }
2854 2895
 
2855 2896
 #endif // DEBUG_LEVELING_FEATURE

Loading…
Cancel
Save