analyze ($Date: 2008/21/04 $)
index
/home/enrique/Desktop/backup/babbleold/script/reprap/pyRepRap_v0.1/analyze.py

Analyze is a script to analyze and comment a gcode file.
 
To run analyze, install python 2.x on your machine, which is avaliable from http://www.python.org/download/
 
Then in the folder which analyze is in, type 'python' in a shell to run the python interpreter.  Finally type
'from analyze import *' to import this program.
To get documentation for this program, open a shell in the fill.py directory, then type 'pydoc fill.py'.
 
An explanation of the gcodes is at:
http://reprap.org/bin/view/Main/Arduino_GCode_Interpreter
 
A gode example is at:
http://forums.reprap.org/file.php?12,file=565
 
This example analyzes and comments the gcode file Screw Holder_comb.gcode.  This example is run in a terminal in the folder which contains Screw Holder_comb.gcode and analyze.py.
 
>>> import analyze
Fillet has been imported.
The gcode files in this directory that are not comment files are the following:
['Screw Holder_comb.gcode']
 
>>> analyze.comment()
File Screw Holder_comb.gcode is being commented.
..
many lines of commented gcode
..
The commented file is saved as Screw Holder_comb_comment.gcode
 
 
>>> analyze.statisticFile()
Statistics are being generated for the file Screw Holder_comb.gcode
 
On the X axis, the extrusion starts at -30 mm and ends at 30 mm, for a width of 59 mm
On the Y axis, the extrusion starts at -20 mm and ends at 20 mm, for a depth of 39 mm
On the Z axis, the extrusion starts at -4 mm and ends at 11 mm, for a height of 14 mm
The average feedrate is 10 mm/s, (600 mm/min).
The extruder speed is 210
The extruder was extruding 86% of the time.
The extruder was toggled 830 times.
The extrusion diameter is 0.8 mm.
The extrusion width is 0.747 mm.
The following procedures have been performed on the skein:
slice)
fill)
comb)
The layer thickness is 0.747 mm.
The text has 10163 lines and a size of 292.0 KB.
The total build time is 3090 s.
The total distance extruded is 26468 mm.
The total distance traveled is 30896 mm.
The volume extruded is 13 cc.
 
The statistics file is saved as Screw Holder_comb.txt

 
Modules
       
cStringIO
euclidean
gcodec
math
os

 
Classes
       
commentSkein
statisticSkein

 
class commentSkein
    A class to comment a gcode skein.
 
  Methods defined here:
__init__(self)
addComment(self, comment)
Add a gcode comment and a newline to the output.
linearMove(self, splitLine)
Comment a linear move.
parseGcode(self, gcodeText)
Parse gcode text and store the commented gcode.
parseLine(self, line)
Parse a gcode line and add it to the commented gcode.
setHelicalMoveEndpoint(self, splitLine)
Get the endpoint of a helical move.

 
class statisticSkein(commentSkein)
    A class to get statistics for a gcode skein.
 
  Methods defined here:
addLine(self, line)
Add a line of text and a newline to the output.
addToPath(self, location)
Add a point to travel and maybe extrusion.
extruderSet(self, active)
Maybe increment the number of times the extruder was toggled.
getLocationSetFeedrateToSplitLine(self, splitLine)
helicalMove(self, isCounterclockwise, splitLine)
Get statistics for a helical move.
linearMove(self, splitLine)
Get statistics for a linear move.
parseGcode(self, gcodeText)
Parse gcode text and store the commented gcode.
parseLine(self, line)
Parse a gcode line and add it to the commented gcode.

Methods inherited from commentSkein:
__init__(self)
addComment(self, comment)
Add a gcode comment and a newline to the output.
setHelicalMoveEndpoint(self, splitLine)
Get the endpoint of a helical move.

 
Functions
       
commentFile(filename='')
Comment a gcode file.  If no filename is specified, comment the first gcode file in this folder that is not a comment file.
getCommentGcode(gcodeText)
Get gcode text with added comments.
getStatisticGcode(gcodeText)
Get statistics for a gcode text.
getUncommentedGcodeFiles()
Get gcode files which are not generated by this script.
statisticFile(filename='')
Write statistics for a gcode file.  If no filename is specified, write statistics for the first gcode file in this folder that is not a comment or log file.

 
Data
        __author__ = 'Enrique Perez (perez_enrique@yahoo.com)'
__date__ = '$Date: 2008/21/04 $'
__license__ = 'GPL 3.0'

 
Author
        Enrique Perez (perez_enrique@yahoo.com)