diff options
author | David Crocker <dcrocker@eschertech.com> | 2021-10-18 17:56:43 +0300 |
---|---|---|
committer | David Crocker <dcrocker@eschertech.com> | 2021-10-18 17:56:43 +0300 |
commit | c0f47d671496f5ada26fc3094441ec2ff80a48ae (patch) | |
tree | 1468c613272128bea6018daaf06097d6a166221f /src/GCodes/GCodes.h | |
parent | 4e15856c84b9378d3336c5c6b7ddea9de59305ae (diff) |
Initial implementation of G68/69
Diffstat (limited to 'src/GCodes/GCodes.h')
-rw-r--r-- | src/GCodes/GCodes.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/GCodes/GCodes.h b/src/GCodes/GCodes.h index 261a069d..add5506e 100644 --- a/src/GCodes/GCodes.h +++ b/src/GCodes/GCodes.h @@ -242,6 +242,10 @@ public: unsigned int GetWorkplaceCoordinateSystemNumber() const noexcept { return moveState.currentCoordinateSystem + 1; } +#if SUPPORT_COORDINATE_ROTATION + void RotateCoordinates(float angleDegrees, float coords[2]) const noexcept; // Account for coordinate rotation +#endif + // This function is called by other functions to account correctly for workplace coordinates float GetWorkplaceOffset(size_t axis) const noexcept { @@ -254,6 +258,11 @@ public: return workplaceCoordinates[workplaceNumber][axis]; } +# if SUPPORT_COORDINATE_ROTATION + float GetRotationAngle() const noexcept { return g68Angle; } + float GetRotationCentre(size_t index) const noexcept pre(index < 2) { return g68Centre[index]; } +# endif + size_t GetNumInputs() const noexcept { return NumGCodeChannels; } const GCodeBuffer* GetInput(size_t n) const noexcept { return gcodeSources[n]; } const GCodeBuffer* GetInput(GCodeChannel n) const noexcept { return gcodeSources[n.RawValue()]; } @@ -509,6 +518,10 @@ private: void SetMoveBufferDefaults() noexcept; // Set up default values in the move buffer void ChangeExtrusionFactor(unsigned int extruder, float factor) noexcept; // Change a live extrusion factor +#if SUPPORT_COORDINATE_ROTATION + GCodeResult HandleG68(GCodeBuffer& gb, const StringRef& reply) THROWS(GCodeException); // Handle G68 +#endif + #if SUPPORT_12864_LCD int GetHeaterNumber(unsigned int itemNumber) const noexcept; #endif @@ -604,6 +617,11 @@ private: float workplaceCoordinates[NumCoordinateSystems][MaxAxes]; // Workplace coordinate offsets +#if SUPPORT_COORDINATE_ROTATION + float g68Angle; // the G68 rotation angle in radians + float g68Centre[2]; // the XY coordinates of the centre to rotate about +#endif + #if HAS_MASS_STORAGE || HAS_EMBEDDED_FILES FileData fileToPrint; // The next file to print #endif |