Пример #1
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('File ' + filename + ' is being extruded.')
    fileText = archive.getFileText(filename)
    gcodec.writeFileMessageSuffix(filename, extrudeText(fileText),
                                  'The gcode log file is saved as ', '_log')
Пример #2
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( "There are no unmodified gcode files in this folder." )
			return
		fileName = unmodified[ 0 ]
	filletPreferences = FilletPreferences()
	preferences.readPreferences( filletPreferences )
	print( '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' )
Пример #3
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( "There are no unmodified gcode files in this folder." )
			return
		fileName = unmodified[ 0 ]
	filletPreferences = FilletPreferences()
	preferences.readPreferences( filletPreferences )
	print( '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' )
Пример #4
0
def displayFile(filename):
    "Parse a gcode file and display the commands."
    print('File ' + filename + ' is being displayed.')
    fileText = archive.getFileText(filename)
    gcodec.writeFileMessageSuffix(filename, displayText(fileText),
                                  'The gcode log file is saved as ', '_log')
Пример #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('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('File ' + filename + ' is being displayed.')
	fileText = gcodec.getFileText( filename )
	gcodec.writeFileMessageSuffix( filename, displayText( fileText ), 'The gcode log file is saved as ', '_log')