diff options
author | David Crocker <dcrocker@eschertech.com> | 2020-06-11 17:11:55 +0300 |
---|---|---|
committer | David Crocker <dcrocker@eschertech.com> | 2020-06-11 17:11:55 +0300 |
commit | 4426e0a8cda63032e6aa72fe4db1c27f2d4264d8 (patch) | |
tree | 603f7a200d2bd45633ea81e42ff73b2674e745b6 | |
parent | 890831241ed1ef7a8cf4584514d79fa546c6d621 (diff) |
Fixed filament usage accumulation when wipe-while-retract used
-rw-r--r-- | src/GCodes/GCodes.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/GCodes/GCodes.cpp b/src/GCodes/GCodes.cpp index a250a823..9e9cf15c 100644 --- a/src/GCodes/GCodes.cpp +++ b/src/GCodes/GCodes.cpp @@ -2506,9 +2506,11 @@ bool GCodes::LoadExtrusionAndFeedrateFromGCode(GCodeBuffer& gb, bool isPrintingM virtualExtruderPosition = moveArg; } - // rawExtruderTotal is used to calculate print progress, so it must be based on the requested extrusion before accounting for mixing, - // otherwise IDEX ditto printing and similar gives strange results - if (isPrintingMove && moveBuffer.moveType == 0 && !doingToolChange) + // rawExtruderTotal is used to calculate print progress, so it must be based on the requested extrusion from the slicer + // before accounting for mixing, extrusion factor etc. + // We used to have 'isPrintingMove &&' in the condition too, but this excluded wipe-while-retracting moves, so it gave wrong results for % print complete. + // We still exclude extrusion during tool changing and other macros, because that is extrusion not known to the slicer. + if (moveBuffer.moveType == 0 && !gb.IsDoingFileMacro()) { rawExtruderTotal += requestedExtrusionAmount; } @@ -2526,7 +2528,7 @@ bool GCodes::LoadExtrusionAndFeedrateFromGCode(GCodeBuffer& gb, bool isPrintingM { extrusionAmount *= volumetricExtrusionFactors[drive]; } - if (isPrintingMove && moveBuffer.moveType == 0 && !doingToolChange) + if (moveBuffer.moveType == 0 && !gb.IsDoingFileMacro()) { rawExtruderTotalByDrive[drive] += extrusionAmount; } @@ -2563,7 +2565,7 @@ bool GCodes::LoadExtrusionAndFeedrateFromGCode(GCodeBuffer& gb, bool isPrintingM extrusionAmount *= volumetricExtrusionFactors[drive]; } - if (isPrintingMove && moveBuffer.moveType == 0 && !doingToolChange) + if (moveBuffer.moveType == 0 && !gb.IsDoingFileMacro()) { rawExtruderTotalByDrive[drive] += extrusionAmount; rawExtruderTotal += extrusionAmount; |