diff options
author | Christian Hammacher <bmasterc@gmail.com> | 2021-11-02 23:03:41 +0300 |
---|---|---|
committer | Christian Hammacher <bmasterc@gmail.com> | 2021-11-02 23:03:41 +0300 |
commit | aa850feea05f552cc915abbc13e6870df31df3f2 (patch) | |
tree | 9d95b49fa54268cbf849b76141390b324731187f /src/Movement | |
parent | e7892b8a2d4609a687fe9acde367fe2ce07e33e2 (diff) |
Removed heightmap code for SBC mode
Removed various bits that were previously needed for heightmap handling in SBC mode
Diffstat (limited to 'src/Movement')
-rw-r--r-- | src/Movement/BedProbing/Grid.cpp | 26 | ||||
-rw-r--r-- | src/Movement/BedProbing/Grid.h | 12 | ||||
-rw-r--r-- | src/Movement/Move.cpp | 12 | ||||
-rw-r--r-- | src/Movement/Move.h | 6 |
4 files changed, 5 insertions, 51 deletions
diff --git a/src/Movement/BedProbing/Grid.cpp b/src/Movement/BedProbing/Grid.cpp index 45b81a92..81211fa7 100644 --- a/src/Movement/BedProbing/Grid.cpp +++ b/src/Movement/BedProbing/Grid.cpp @@ -372,7 +372,7 @@ unsigned int HeightMap::GetMinimumSegments(float deltaAxis0, float deltaAxis1) c return max<unsigned int>(axis0Segments, axis1Segments); } -#if HAS_MASS_STORAGE +#if HAS_MASS_STORAGE || HAS_SBC_INTERFACE // Save the grid to file returning true if an error occurred bool HeightMap::SaveToFile(FileStore *f, const char *fname, float zOffset) noexcept @@ -527,30 +527,6 @@ bool HeightMap::LoadFromFile(FileStore *f, const char *fname, const StringRef& r #endif -#if HAS_SBC_INTERFACE - -// Update the filename -void HeightMap::SetFileName(const char *name) noexcept -{ - fileName.copy(name); -} - -// Save the grid to a sequential array in the same way as to a regular CSV file -void HeightMap::SaveToArray(float *arr, float zOffset) const noexcept -{ - size_t index = 0; - for (size_t i = 0; i < def.nums[1]; ++i) - { - for (size_t j = 0; j < def.nums[0]; ++j) - { - arr[index] = gridHeightSet.IsBitSet(index) ? (gridHeights[index] + zOffset) : std::numeric_limits<float>::quiet_NaN(); - index++; - } - } -} - -#endif - // Return number of points probed, mean and RMS deviation, min and max error unsigned int HeightMap::GetStatistics(Deviation& deviation, float& minError, float& maxError) const noexcept { diff --git a/src/Movement/BedProbing/Grid.h b/src/Movement/BedProbing/Grid.h index b7366d32..cd8bd857 100644 --- a/src/Movement/BedProbing/Grid.h +++ b/src/Movement/BedProbing/Grid.h @@ -79,24 +79,15 @@ public: float GetInterpolatedHeightError(float axis0, float axis1) const noexcept; // Compute the interpolated height error at the specified point void ClearGridHeights() noexcept; // Clear all grid height corrections void SetGridHeight(size_t axis0Index, size_t axis1Index, float height) noexcept; // Set the height of a grid point - void SetGridHeight(size_t index, float height) noexcept; // Set the height of a grid point -#if HAS_MASS_STORAGE +#if HAS_MASS_STORAGE || HAS_SBC_INTERFACE bool SaveToFile(FileStore *f, const char *fname, float zOffset) noexcept // Save the grid to file returning true if an error occurred pre(IsValid()); bool LoadFromFile(FileStore *f, const char *fname, const StringRef& r) noexcept; // Load the grid from file returning true if an error occurred -#endif -#if HAS_MASS_STORAGE || HAS_SBC_INTERFACE const char *GetFileName() const noexcept { return fileName.c_str(); } #endif -#if HAS_SBC_INTERFACE - void SetFileName(const char *name) noexcept; // Update the filename - void SaveToArray(float *array, float zOffset) const noexcept // Save the grid Z coordinates to an array - pre(IsValid()); -#endif - unsigned int GetMinimumSegments(float deltaAxis0, float deltaAxis1) const noexcept; // Return the minimum number of segments for a move by this X or Y amount bool UseHeightMap(bool b) noexcept; @@ -118,6 +109,7 @@ private: bool useMap; // True to do bed compensation uint32_t GetMapIndex(uint32_t axis0Index, uint32_t axis1Index) const noexcept { return (axis1Index * def.NumAxisPoints(0)) + axis0Index; } + void SetGridHeight(size_t index, float height) noexcept; // Set the height of a grid point float InterpolateAxis0Axis1(uint32_t axis0Index, uint32_t axis1Index, float axis0Frac, float axis1Frac) const noexcept; }; diff --git a/src/Movement/Move.cpp b/src/Movement/Move.cpp index f3bbc97e..cceaf23e 100644 --- a/src/Movement/Move.cpp +++ b/src/Movement/Move.cpp @@ -747,7 +747,7 @@ void Move::SetIdentityTransform() noexcept reprap.MoveUpdated(); } -#if HAS_MASS_STORAGE +#if HAS_MASS_STORAGE || HAS_SBC_INTERFACE // Load the height map from file, returning true if an error occurred with the error reason appended to the buffer bool Move::LoadHeightMapFromFile(FileStore *f, const char *fname, const StringRef& r) noexcept @@ -773,16 +773,6 @@ bool Move::SaveHeightMapToFile(FileStore *f, const char *fname) noexcept #endif -#if HAS_SBC_INTERFACE - -// Save the height map Z coordinates to an array -void Move::SaveHeightMapToArray(float *arr) const noexcept -{ - return heightMap.SaveToArray(arr, zShift); -} - -#endif - void Move::SetTaperHeight(float h) noexcept { useTaper = (h > 1.0); diff --git a/src/Movement/Move.h b/src/Movement/Move.h index 8d4e560e..1eafa9b9 100644 --- a/src/Movement/Move.h +++ b/src/Movement/Move.h @@ -147,15 +147,11 @@ public: HeightMap& AccessHeightMap() noexcept { return heightMap; } // Access the bed probing grid const GridDefinition& GetGrid() const noexcept { return heightMap.GetGrid(); } // Get the grid definition -#if HAS_MASS_STORAGE +#if HAS_MASS_STORAGE || HAS_SBC_INTERFACE bool LoadHeightMapFromFile(FileStore *f, const char *fname, const StringRef& r) noexcept; // Load the height map from a file returning true if an error occurred bool SaveHeightMapToFile(FileStore *f, const char *fname) noexcept; // Save the height map to a file returning true if an error occurred #endif -#if HAS_SBC_INTERFACE - void SaveHeightMapToArray(float *arr) const noexcept; // Save the height map Z coordinates to an array -#endif - const RandomProbePointSet& GetProbePoints() const noexcept { return probePoints; } // Return the probe point set constructed from G30 commands DDARing& GetMainDDARing() noexcept { return mainDDARing; } |