示例#1
0
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' )
示例#2
0
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' )
示例#3
0
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')
示例#4
0
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')
示例#5
0
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' )
示例#6
0
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' )