Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Duet3D/RepRapFirmware.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Crocker <dcrocker@eschertech.com>2022-08-02 14:17:05 +0300
committerDavid Crocker <dcrocker@eschertech.com>2022-08-02 14:17:05 +0300
commita12ad9479783cd95da65cfa1f427f19c1cbad730 (patch)
tree0073ba4d13b3b318e45695ec4ce896c0599d0966
parentb25bd2d2152105d0edc53c53b5121e53176e69cd (diff)
Eliminated some variables that were not needed
-rw-r--r--src/Movement/Move.cpp16
-rw-r--r--src/Movement/Move.h9
2 files changed, 13 insertions, 12 deletions
diff --git a/src/Movement/Move.cpp b/src/Movement/Move.cpp
index 754f141e..d94901a9 100644
--- a/src/Movement/Move.cpp
+++ b/src/Movement/Move.cpp
@@ -161,9 +161,9 @@ constexpr ObjectModelTableEntry Move::objectModelTable[] =
// 8. move.compensation.skew members
{ "compensateXY", OBJECT_MODEL_FUNC(self->compensateXY), ObjectModelEntryFlags::none },
- { "tanXY", OBJECT_MODEL_FUNC(self->tanXY, 4), ObjectModelEntryFlags::none },
- { "tanXZ", OBJECT_MODEL_FUNC(self->tanXZ, 4), ObjectModelEntryFlags::none },
- { "tanYZ", OBJECT_MODEL_FUNC(self->tanYZ, 4), ObjectModelEntryFlags::none },
+ { "tanXY", OBJECT_MODEL_FUNC(self->tanXY(), 4), ObjectModelEntryFlags::none },
+ { "tanXZ", OBJECT_MODEL_FUNC(self->tanXZ(), 4), ObjectModelEntryFlags::none },
+ { "tanYZ", OBJECT_MODEL_FUNC(self->tanYZ(), 4), ObjectModelEntryFlags::none },
#if SUPPORT_COORDINATE_ROTATION
// 8. move.rotation members
@@ -228,7 +228,7 @@ void Move::Init() noexcept
// Clear the transforms
SetIdentityTransform();
compensateXY = true;
- tanXY = tanYZ = tanXZ = 0.0;
+ tangents[0] = tangents[1] = tangents[2] = 0.0;
usingMesh = useTaper = false;
zShift = 0.0;
@@ -618,11 +618,11 @@ void Move::AxisTransform(float xyzPoint[MaxAxes], const Tool *tool) const noexce
{
if (xAxes.IsBitSet(axis))
{
- xyzPoint[axis] += (compensateXY ? tanXY*xyzPoint[lowestYAxis] : 0.0) + tanXZ*xyzPoint[Z_AXIS];
+ xyzPoint[axis] += (compensateXY ? tanXY() * xyzPoint[lowestYAxis] : 0.0) + tanXZ() * xyzPoint[Z_AXIS];
}
if (yAxes.IsBitSet(axis))
{
- xyzPoint[axis] += (compensateXY ? 0.0 : tanXY*xyzPoint[lowestXAxis]) + tanYZ*xyzPoint[Z_AXIS];
+ xyzPoint[axis] += (compensateXY ? 0.0 : tanXY() * xyzPoint[lowestXAxis]) + tanYZ() * xyzPoint[Z_AXIS];
}
}
}
@@ -644,11 +644,11 @@ void Move::InverseAxisTransform(float xyzPoint[MaxAxes], const Tool *tool) const
{
if (yAxes.IsBitSet(axis))
{
- xyzPoint[axis] -= ((compensateXY ? 0.0 : tanXY*xyzPoint[lowestXAxis]) + tanYZ*xyzPoint[Z_AXIS]);
+ xyzPoint[axis] -= ((compensateXY ? 0.0 : tanXY() * xyzPoint[lowestXAxis]) + tanYZ() * xyzPoint[Z_AXIS]);
}
if (xAxes.IsBitSet(axis))
{
- xyzPoint[axis] -= ((compensateXY ? tanXY*xyzPoint[lowestYAxis] : 0.0) + tanXZ*xyzPoint[Z_AXIS]);
+ xyzPoint[axis] -= ((compensateXY ? tanXY() * xyzPoint[lowestYAxis] : 0.0) + tanXZ() * xyzPoint[Z_AXIS]);
}
}
}
diff --git a/src/Movement/Move.h b/src/Movement/Move.h
index d16b3e7e..a1414ada 100644
--- a/src/Movement/Move.h
+++ b/src/Movement/Move.h
@@ -283,10 +283,11 @@ private:
uint32_t longestGcodeWaitInterval; // the longest we had to wait for a new GCode
float tangents[3]; // Axis compensation - 90 degrees + angle gives angle between axes
- float& tanXY = tangents[0];
- float& tanYZ = tangents[1];
- float& tanXZ = tangents[2];
- bool compensateXY;
+ bool compensateXY; // If true then we compensate for XY skew by adjusting the Y coordinate; else we adjust the X coordinate
+
+ float tanXY() const noexcept { return tangents[0]; }
+ float tanYZ() const noexcept { return tangents[1]; }
+ float tanXZ() const noexcept { return tangents[2]; }
HeightMap heightMap; // The grid definition in use and height map for G29 bed probing
RandomProbePointSet probePoints; // G30 bed probe points