Permalink
Browse files

move build percentage addition to infill rather than at layer tag

  • Loading branch information...
1 parent 8345a57 commit a4f0c32180926896a0c24bb6e46970a102a0f4d9 @aleonard aleonard committed Oct 26, 2012
Showing with 7 additions and 2 deletions.
  1. +1 −1 changelog.txt
  2. +6 −1 src/replicatorg/app/gcode/MutableGCodeSource.java
View
@@ -1,4 +1,4 @@
-0040-Beta ReplicatorG
+0040 ReplicatorG
* Replicator 2 profile now more robust
* support for selecting between s3g, x3g file formats (future bots)
* minor profile updates
@@ -262,16 +262,21 @@ public void addProgressUpdates()
// and M73 P100. is required at the end. These are in TheReplicator start.gcode
// and end.gcode. P0 and P100 are flags to send the build_start and build_end notifications
// to the firmware. A possible less tricky fix is to make a separate command for these
+ boolean new_layer = false;
for(String line : source)
{
- if( line.startsWith("(<layer>") )
+ if((line.startsWith("(<layer>)") || line.startsWith("(<infill>")) && new_layer==true)
{
int percentDone = (int)(index*100)/sourceSize;
if(percentDone == 0) percentDone = 1;
if(percentDone == 100) percentDone = 99;
//^^See Footnote 1
newSource.add("M73 P"+percentDone+" (display progress)");
+ new_layer = false;
}
+ if( line.startsWith("(<layer>")){
+ new_layer = true;
+ }
newSource.add(line);
index++;
}

0 comments on commit a4f0c32

Please sign in to comment.