Bug found by Tony in the offsetting code fixed (I hope).
This commit is contained in:
parent
f0b7da252b
commit
dfbc35d369
3 changed files with 34 additions and 32 deletions
64
GCodes.cpp
64
GCodes.cpp
|
@ -311,36 +311,36 @@ void GCodes::LoadMoveBufferFromGCode(GCodeBuffer *gb)
|
||||||
moveBuffer[DRIVES] = gFeedRate; // We always set it, as Move may have modified the last one.
|
moveBuffer[DRIVES] = gFeedRate; // We always set it, as Move may have modified the last one.
|
||||||
}
|
}
|
||||||
|
|
||||||
void GCodes::LoadMoveBufferFromArray(float m[])
|
//void GCodes::LoadMoveBufferFromArray(float m[])
|
||||||
{
|
//{
|
||||||
float absE;
|
// float absE;
|
||||||
|
//
|
||||||
for(uint8_t i = 0; i < DRIVES; i++)
|
// for(uint8_t i = 0; i < DRIVES; i++)
|
||||||
{
|
// {
|
||||||
if(i < AXES)
|
// if(i < AXES)
|
||||||
{
|
// {
|
||||||
if(axesRelative)
|
// if(axesRelative)
|
||||||
moveBuffer[i] += m[i];
|
// moveBuffer[i] += m[i];
|
||||||
else
|
// else
|
||||||
moveBuffer[i] = m[i];
|
// moveBuffer[i] = m[i];
|
||||||
|
//
|
||||||
} else
|
// } else
|
||||||
{
|
// {
|
||||||
if(drivesRelative)
|
// if(drivesRelative)
|
||||||
moveBuffer[i] = m[i];
|
// moveBuffer[i] = m[i];
|
||||||
else
|
// else
|
||||||
{
|
// {
|
||||||
absE = m[i];
|
// absE = m[i];
|
||||||
moveBuffer[i] = absE - lastPos[i - AXES];
|
// moveBuffer[i] = absE - lastPos[i - AXES];
|
||||||
lastPos[i - AXES] = absE;
|
// lastPos[i - AXES] = absE;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
// Deal with feedrate
|
// // Deal with feedrate
|
||||||
|
//
|
||||||
moveBuffer[DRIVES] = m[DRIVES]; // We always set it, as Move may have modified the last one.
|
// moveBuffer[DRIVES] = m[DRIVES]; // We always set it, as Move may have modified the last one.
|
||||||
}
|
//}
|
||||||
|
|
||||||
|
|
||||||
// This function is called for a G Code that makes a move.
|
// This function is called for a G Code that makes a move.
|
||||||
|
@ -470,7 +470,9 @@ bool GCodes::OffsetAxes(GCodeBuffer* gb)
|
||||||
|
|
||||||
if(DoCannedCycleMove(false))
|
if(DoCannedCycleMove(false))
|
||||||
{
|
{
|
||||||
LoadMoveBufferFromArray(record);
|
//LoadMoveBufferFromArray(record);
|
||||||
|
for(int drive = 0; drive <= DRIVES; drive++)
|
||||||
|
moveBuffer[drive] = record[drive];
|
||||||
reprap.GetMove()->SetLiveCoordinates(record); // This doesn't transform record
|
reprap.GetMove()->SetLiveCoordinates(record); // This doesn't transform record
|
||||||
reprap.GetMove()->SetPositions(record); // This does
|
reprap.GetMove()->SetPositions(record); // This does
|
||||||
offSetSet = false;
|
offSetSet = false;
|
||||||
|
|
2
GCodes.h
2
GCodes.h
|
@ -93,7 +93,7 @@ class GCodes
|
||||||
bool SetOffsets(GCodeBuffer *gb);
|
bool SetOffsets(GCodeBuffer *gb);
|
||||||
bool SetPositions(GCodeBuffer *gb);
|
bool SetPositions(GCodeBuffer *gb);
|
||||||
void LoadMoveBufferFromGCode(GCodeBuffer *gb);
|
void LoadMoveBufferFromGCode(GCodeBuffer *gb);
|
||||||
void LoadMoveBufferFromArray(float m[]);
|
//void LoadMoveBufferFromArray(float m[]);
|
||||||
bool NoHome();
|
bool NoHome();
|
||||||
bool Push();
|
bool Push();
|
||||||
bool Pop();
|
bool Pop();
|
||||||
|
|
Binary file not shown.
Reference in a new issue