ZGrid
authorQuentin Harley <quentin.harley@gmail.com>
Wed, 27 Jan 2016 10:15:36 +0000 (12:15 +0200)
committerQuentin Harley <quentin.harley@gmail.com>
Wed, 27 Jan 2016 10:15:36 +0000 (12:15 +0200)
Remove/comment debug code

src/modules/tools/zprobe/ZGridStrategy.cpp
src/modules/tools/zprobe/ZGridStrategy.h

index 1642439..689ac8e 100644 (file)
@@ -308,7 +308,6 @@ bool ZGridStrategy::handleGcode(Gcode *gcode)
             // M373: finalize calibration
             case 373: {
                  // normalize the grid
-                 //this->normalize_grid();
                  this->normalize_grid_2home();
 
                  this->in_cal = false;
@@ -353,7 +352,7 @@ bool ZGridStrategy::handleGcode(Gcode *gcode)
             }
             return true;
 
-          case 376: { // Check grid value calculations: For debug only.
+/*          case 376: { // Check grid value calculations: For debug only.
                 float target[3];
 
                 for(char letter = 'X'; letter <= 'Z'; letter++) {
@@ -365,7 +364,7 @@ bool ZGridStrategy::handleGcode(Gcode *gcode)
 
             }
             return true;
-
+*/
             case 565: { // M565: Set Z probe offsets
                 float x= 0, y= 0, z= 0;
                 if(gcode->has_letter('X')) x = gcode->get_value('X');
@@ -554,29 +553,6 @@ bool ZGridStrategy::doProbing(StreamOutput *stream)  // probed calibration
     return true;
 }
 
-//TODO: normalize to set home position zero - this required to prevent the large z movement bug when home position is off print area
-void ZGridStrategy::normalize_grid()
-{
-    float min = 100.0F,    // set large start value
-          norm_offset = 0;
-
-    // find minimum value in offset grid
-    for (int i = 0; i < probe_points; i++)
-        if (this->pData[i] < min)
-          min = this->pData[i];
-
-    // creates addition offset to set minimum value to zero.
-    norm_offset = -min;
-
-    // adds the offset to create a table of deltas, normalzed to minimum zero
-    for (int i = 0; i < probe_points; i++)
-        this->pData[i] += norm_offset;
-
-   // add the offset to the current Z homing offset to preserve full probed offset.
-   this->setZoffset(this->getZhomeoffset() - norm_offset);
-
-}
-
 
 void ZGridStrategy::normalize_grid_2home()
 {
index fad5319..13be866 100644 (file)
@@ -30,7 +30,6 @@ private:
 
     void setAdjustFunction(bool);
     bool doProbing(StreamOutput *stream);
-    void normalize_grid();
     void normalize_grid_2home();
 
     bool loadGrid(std::string args);