Skip to content

Commit

Permalink
Fixed an issue with calculating print time
Browse files Browse the repository at this point in the history
  • Loading branch information
Eberhard Rensch committed Dec 14, 2013
1 parent bc8c40e commit 8189914
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/Classes/ParsedGCode.m
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,11 @@ - (void)updateLocation:(Vector3*)currentLocation

- (void)updateStats:(GCodeStatistics*)gCodeStatistics with:(Vector3*)currentLocation
{
PSLog(@"parseGCode", PSPrioLow, @" ## Previous : %@", [gCodeStatistics.currentLocation description]);
PSLog(@"parseGCode", PSPrioLow, @" ## Current : %@", [currentLocation description]);

// Travelling
Vector3* previousLocation = gCodeStatistics.currentLocation;
Vector3* travelVector = [currentLocation sub:gCodeStatistics.currentLocation];
[gCodeStatistics.currentLocation setToVector3:currentLocation];
gCodeStatistics.movementLinesCount++;

Expand Down Expand Up @@ -107,10 +110,6 @@ - (void)updateStats:(GCodeStatistics*)gCodeStatistics with:(Vector3*)currentLoca
gCodeStatistics.usingToolB = YES;
}

PSLog(@"parseGCode", PSPrioLow, @" ## Previous : %@", [previousLocation description]);
PSLog(@"parseGCode", PSPrioLow, @" ## Current : %@", [gCodeStatistics.currentLocation description]);

Vector3* travelVector = [gCodeStatistics.currentLocation sub:previousLocation];
float longestDistanceToMove = MAX(ABS(travelVector.x), ABS(travelVector.y)); // mm
float cartesianDistance = [travelVector abs]; // mm

Expand Down

0 comments on commit 8189914

Please sign in to comment.