diff options
author | David Crocker <dcrocker@eschertech.com> | 2021-09-08 21:27:38 +0300 |
---|---|---|
committer | David Crocker <dcrocker@eschertech.com> | 2021-09-08 21:27:38 +0300 |
commit | 7d449836123f59ef1c587cd981a88ea7c63518ac (patch) | |
tree | e2f7ee39df44ba1a12bf5d318f96fe3cc977ee28 /src/Movement | |
parent | 43119b53b6751d628b105f40382c8e686c807ab7 (diff) |
Work on restartable macros + preparatory work for multiple streams
Diffstat (limited to 'src/Movement')
-rw-r--r-- | src/Movement/RawMove.cpp | 2 | ||||
-rw-r--r-- | src/Movement/RawMove.h | 9 |
2 files changed, 9 insertions, 2 deletions
diff --git a/src/Movement/RawMove.cpp b/src/Movement/RawMove.cpp index cb99c734..bdcdba51 100644 --- a/src/Movement/RawMove.cpp +++ b/src/Movement/RawMove.cpp @@ -27,7 +27,7 @@ void RawMove::SetDefaults(size_t firstDriveToZero) noexcept } } -float ExtendedRawMove::GetProportionDone() const noexcept +float MovementState::GetProportionDone() const noexcept { return (float)(totalSegments - segmentsLeft)/(float)totalSegments; } diff --git a/src/Movement/RawMove.h b/src/Movement/RawMove.h index 13c628a2..eab52841 100644 --- a/src/Movement/RawMove.h +++ b/src/Movement/RawMove.h @@ -56,11 +56,18 @@ enum class SegmentedMoveState : uint8_t }; // Details of a move that are needed only by GCodes -struct ExtendedRawMove : public RawMove +struct MovementState : public RawMove { + // The current user position now holds the requested user position after applying workplace coordinate offsets. + // So we must subtract the workplace coordinate offsets when we want to display them. + // We have chosen this approach because it allows us to switch workplace coordinates systems or turn off applying workplace offsets without having to update currentUserPosition. + float currentUserPosition[MaxAxes]; // The current position of the axes as commanded by the input gcode, after accounting for workplace offset, + // before accounting for tool offset and Z hop + float currentZHop; // The amount of Z hop that is currently applied float initialCoords[MaxAxes]; // the initial positions of the axes float previousX, previousY; // the initial X and Y coordinates in user space of the previous move float previousXYDistance; // the XY length of that previous move + unsigned int currentCoordinateSystem; // This is zero-based, where as the P parameter in the G10 command is 1-based unsigned int segmentsLeft; // the number of segments left to do in the current move, or 0 if no move available unsigned int totalSegments; // the total number of segments left in the complete move unsigned int arcAxis0, arcAxis1; // the axis numbers of the arc before we apply axis mapping |