chiark / gitweb /
Add layer number to output comments
authordaid <daid303@gmail.com>
Mon, 19 Mar 2012 16:58:30 +0000 (17:58 +0100)
committerdaid <daid303@gmail.com>
Mon, 19 Mar 2012 16:58:30 +0000 (17:58 +0100)
SkeinPyPy/skeinforge_application/skeinforge_plugins/craft_plugins/export_plugins/static_plugins/gcode_small.py

index a09e0a01ecfbbe2c16fe7e80d5a5f5779d3a038f..8837e377bde057a3e44b986a1abcaeb0a73ef039 100644 (file)
@@ -68,6 +68,7 @@ class GcodeSmallSkein:
                self.lastFeedRateString = None
                self.lastZString = None
                self.output = cStringIO.StringIO()
+               self.layerNr = 0
 
        def getCraftedGcode( self, gcodeText ):
                "Parse gcode text and store the gcode."
@@ -125,4 +126,7 @@ class GcodeSmallSkein:
                        self.output.write(';TYPE:FILL\n');
                elif line.startswith('(<alteration>'):
                        self.output.write(';TYPE:CUSTOM\n');
+               elif line.startswith('(<layer>'):
+                       self.output.write(';LAYER:%d\n' % (self.layerNr));
+                       self.layerNr += 1