def bevelFile( filename = '' ): "Bevel a gcode linear move file. If no filename is specified, bevel the first unmodified gcode file in this folder." if filename == '': unmodified = gcodec.getUnmodifiedGCodeFiles() if len( unmodified ) == 0: print >> sys.stderr, ( "There are no unmodified gcode files in this folder." ) return filename = unmodified[ 0 ] filletPreferences = FilletPreferences() preferences.readPreferences( filletPreferences ) print >> sys.stderr, ( 'File ' + gcodec.getSummarizedFilename( filename ) + ' is being beveled.' ) gcodeText = gcodec.getFileText( filename ) if gcodeText == '': return gcodec.writeFileMessageSuffix( filename, getBevelGcode( filletPreferences, gcodeText ), 'The beveled file is saved as ', '_fillet' )
def arcRadiusFile( filename = '' ): "Fillet a gcode linear move file into a helical radius move file. If no filename is specified, arc radius the first unmodified gcode file in this folder." if filename == '': unmodified = gcodec.getUnmodifiedGCodeFiles() if len( unmodified ) == 0: print >> sys.stderr, ( "There are no unmodified gcode files in this folder." ) return filename = unmodified[ 0 ] filletPreferences = FilletPreferences() preferences.readPreferences( filletPreferences ) print >> sys.stderr, ( 'File ' + gcodec.getSummarizedFilename( filename ) + ' is being filleted into arc radiuses.' ) gcodeText = gcodec.getFileText( filename ) if gcodeText == '': return gcodec.writeFileMessageSuffix( filename, getArcRadiusGcode( filletPreferences, gcodeText ), 'The arc radius file is saved as ', '_fillet' )
def bevelFile(filename=''): "Bevel a gcode linear move file. If no filename is specified, bevel the first unmodified gcode file in this folder." if filename == '': unmodified = gcodec.getUnmodifiedGCodeFiles() if len(unmodified) == 0: print >> sys.stderr, ( "There are no unmodified gcode files in this folder.") return filename = unmodified[0] filletPreferences = FilletPreferences() preferences.readPreferences(filletPreferences) print >> sys.stderr, ('File ' + gcodec.getSummarizedFilename(filename) + ' is being beveled.') gcodeText = gcodec.getFileText(filename) if gcodeText == '': return gcodec.writeFileMessageSuffix(filename, getBevelGcode(filletPreferences, gcodeText), 'The beveled file is saved as ', '_fillet')
def arcRadiusFile(filename=''): "Fillet a gcode linear move file into a helical radius move file. If no filename is specified, arc radius the first unmodified gcode file in this folder." if filename == '': unmodified = gcodec.getUnmodifiedGCodeFiles() if len(unmodified) == 0: print >> sys.stderr, ( "There are no unmodified gcode files in this folder.") return filename = unmodified[0] filletPreferences = FilletPreferences() preferences.readPreferences(filletPreferences) print >> sys.stderr, ('File ' + gcodec.getSummarizedFilename(filename) + ' is being filleted into arc radiuses.') gcodeText = gcodec.getFileText(filename) if gcodeText == '': return gcodec.writeFileMessageSuffix( filename, getArcRadiusGcode(filletPreferences, gcodeText), 'The arc radius file is saved as ', '_fillet')
def extrudeFile( filename ): """Parse a gcode file and send the commands to the extruder. This function requires write access to the serial device, running as root is one way to get that access.""" print >> sys.stderr, ( 'File ' + filename + ' is being extruded.' ) fileText = gcodec.getFileText( filename ) gcodec.writeFileMessageSuffix( filename, extrudeText( fileText ), 'The gcode log file is saved as ', '_log' )
def displayFile( filename ): "Parse a gcode file and display the commands." print >> sys.stderr, ( 'File ' + filename + ' is being displayed.' ) fileText = gcodec.getFileText( filename ) gcodec.writeFileMessageSuffix( filename, displayText( fileText ), 'The gcode log file is saved as ', '_log' )