Exemple #1
0
def writeOutput(fileName=""):
    "Export a gcode linear move file."
    fileName = interpret.getFirstTranslatorFileNameUnmodified(fileName)
    if fileName == "":
        return
    exportPreferences = ExportPreferences()
    preferences.getReadPreferences(exportPreferences)
    startTime = time.time()
    print("File " + gcodec.getSummarizedFilename(fileName) + " is being chain exported.")
    suffixFilename = fileName[: fileName.rfind(".")] + "_export." + exportPreferences.fileExtension.value
    gcodeText = gcodec.getGcodeFileText(fileName, "")
    procedures = consecution.getProcedures("export", gcodeText)
    gcodeText = consecution.getChainTextFromProcedures(fileName, procedures[:-1], gcodeText)
    if gcodeText == "":
        return
    analyze.writeOutput(suffixFilename, gcodeText)
    exportChainGcode = getCraftedTextFromText(gcodeText, exportPreferences)
    replacableExportChainGcode = None
    selectedPluginModule = getSelectedPluginModule(exportPreferences.exportPlugins)
    if selectedPluginModule == None:
        replacableExportChainGcode = exportChainGcode
    else:
        if selectedPluginModule.isReplacable():
            replacableExportChainGcode = selectedPluginModule.getOutput(exportChainGcode)
        else:
            selectedPluginModule.writeOutput(suffixFilename, exportChainGcode)
    if replacableExportChainGcode != None:
        replacableExportChainGcode = getReplaced(replacableExportChainGcode)
        gcodec.writeFileText(suffixFilename, replacableExportChainGcode)
        print("The exported file is saved as " + gcodec.getSummarizedFilename(suffixFilename))
    if exportPreferences.alsoSendOutputTo.value != "":
        if replacableExportChainGcode == None:
            replacableExportChainGcode = selectedPluginModule.getOutput(exportChainGcode)
        exec("print >> " + exportPreferences.alsoSendOutputTo.value + ", replacableExportChainGcode")
    print("It took " + str(int(round(time.time() - startTime))) + " seconds to export the file.")
Exemple #2
0
def writeOutput( fileName = '' ):
	"Export a gcode linear move file."
	fileName = interpret.getFirstTranslatorFileNameUnmodified( fileName )
	if fileName == '':
		return
	exportRepository = ExportRepository()
	preferences.getReadRepository( exportRepository )
	startTime = time.time()
	print( 'File ' + gcodec.getSummarizedFilename( fileName ) + ' is being chain exported.' )
	suffixFilename = fileName[ : fileName.rfind( '.' ) ] + '_export.' + exportRepository.fileExtension.value
	gcodeText = gcodec.getGcodeFileText( fileName, '' )
	procedures = consecution.getProcedures( 'export', gcodeText )
	gcodeText = consecution.getChainTextFromProcedures( fileName, procedures[ : - 1 ], gcodeText )
	if gcodeText == '':
		return
	analyze.writeOutput( suffixFilename, gcodeText )
	exportChainGcode = getCraftedTextFromText( gcodeText, exportRepository )
	replacableExportChainGcode = None
	selectedPluginModule = getSelectedPluginModule( exportRepository.exportPlugins )
	if selectedPluginModule == None:
		replacableExportChainGcode = exportChainGcode
	else:
		if selectedPluginModule.isReplacable():
			replacableExportChainGcode = selectedPluginModule.getOutput( exportChainGcode )
		else:
			selectedPluginModule.writeOutput( suffixFilename, exportChainGcode )
	if replacableExportChainGcode != None:
		replacableExportChainGcode = getReplaced( replacableExportChainGcode )
		gcodec.writeFileText( suffixFilename, replacableExportChainGcode )
		print( 'The exported file is saved as ' + gcodec.getSummarizedFilename( suffixFilename ) )
	if exportRepository.alsoSendOutputTo.value != '':
		if replacableExportChainGcode == None:
			replacableExportChainGcode = selectedPluginModule.getOutput( exportChainGcode )
		exec( 'print >> ' + exportRepository.alsoSendOutputTo.value + ', replacableExportChainGcode' )
	print( 'It took ' + str( int( round( time.time() - startTime ) ) ) + ' seconds to export the file.' )
Exemple #3
0
def writeOutput( fileName = '' ):
	"Raftless a gcode linear move file."
	fileName = interpret.getFirstTranslatorFileNameUnmodified( fileName )
	if fileName == '':
		return
	consecution.writeChainTextWithNounMessage( fileName, 'raftless' )
Exemple #4
0
def writeOutput( fileName = '' ):
	"Stretch a gcode linear move file.  Chain stretch the gcode if it is not already stretched.  If no fileName is specified, stretch the first unmodified gcode file in this folder."
	fileName = interpret.getFirstTranslatorFileNameUnmodified( fileName )
	if fileName != '':
		consecution.writeChainTextWithNounMessage( fileName, 'stretch' )
Exemple #5
0
def writeOutput( fileName = '' ):
	"Flow a gcode linear move file."
	fileName = interpret.getFirstTranslatorFileNameUnmodified( fileName )
	if fileName != '':
		consecution.writeChainTextWithNounMessage( fileName, 'flow' )
Exemple #6
0
def writeOutput(fileName=""):
    "Comb a gcode linear move file."
    fileName = interpret.getFirstTranslatorFileNameUnmodified(fileName)
    if fileName != "":
        consecution.writeChainTextWithNounMessage(fileName, "comb")
Exemple #7
0
def writeOutput( fileName = '' ):
	"Preface the carving of a gcode file.  If no fileName is specified, preface the first unmodified gcode file in this folder."
	fileName = interpret.getFirstTranslatorFileNameUnmodified( fileName )
	if fileName == '':
		return
	consecution.writeChainTextWithNounMessage( fileName, 'preface' )
Exemple #8
0
def writeOutput( fileName = '' ):
	"Dimension a gcode file."
	fileName = interpret.getFirstTranslatorFileNameUnmodified( fileName )
	if fileName != '':
		consecution.writeChainTextWithNounMessage( fileName, 'dimension' )
Exemple #9
0
def writeOutput( fileName = '' ):
	"Lift the carving of a gcode file."
	fileName = interpret.getFirstTranslatorFileNameUnmodified( fileName )
	if fileName != '':
		consecution.writeChainTextWithNounMessage( fileName, 'lift' )
Exemple #10
0
def writeOutput( fileName = '' ):
	"Outset the carving of a gcode file.  If no fileName is specified, outset the first unmodified gcode file in this folder."
	fileName = interpret.getFirstTranslatorFileNameUnmodified( fileName )
	if fileName != '':
		consecution.writeChainTextWithNounMessage( fileName, 'outset' )
Exemple #11
0
def writeOutput(fileName=""):
    "Hop a gcode linear move file.  Chain hop the gcode if it is not already hopped. If no fileName is specified, hop the first unmodified gcode file in this folder."
    fileName = interpret.getFirstTranslatorFileNameUnmodified(fileName)
    if fileName != "":
        consecution.writeChainTextWithNounMessage(fileName, "hop")
Exemple #12
0
def writeOutput( fileName = '' ):
	"Fillet a gcode linear move file. Depending on the settings, either arcPoint, arcRadius, arcSegment, bevel or do nothing."
	fileName = interpret.getFirstTranslatorFileNameUnmodified( fileName )
	if fileName != '':
		consecution.writeChainTextWithNounMessage( fileName, 'fillet' )
Exemple #13
0
def writeOutput(fileName=""):
    "Whittle the carving of a gcode file.  If no fileName is specified, whittle the first unmodified gcode file in this folder."
    fileName = interpret.getFirstTranslatorFileNameUnmodified(fileName)
    if fileName == "":
        return
    consecution.writeChainTextWithNounMessage(fileName, "whittle")
Exemple #14
0
def writeOutput( fileName = '' ):
	"Splodge a gcode linear move file."
	fileName = interpret.getFirstTranslatorFileNameUnmodified( fileName )
	if fileName != '':
		consecution.writeChainTextWithNounMessage( fileName, 'splodge' )