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.")
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.' )
def writeOutput( fileName = '' ): "Raftless a gcode linear move file." fileName = interpret.getFirstTranslatorFileNameUnmodified( fileName ) if fileName == '': return consecution.writeChainTextWithNounMessage( fileName, 'raftless' )
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' )
def writeOutput( fileName = '' ): "Flow a gcode linear move file." fileName = interpret.getFirstTranslatorFileNameUnmodified( fileName ) if fileName != '': consecution.writeChainTextWithNounMessage( fileName, 'flow' )
def writeOutput(fileName=""): "Comb a gcode linear move file." fileName = interpret.getFirstTranslatorFileNameUnmodified(fileName) if fileName != "": consecution.writeChainTextWithNounMessage(fileName, "comb")
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' )
def writeOutput( fileName = '' ): "Dimension a gcode file." fileName = interpret.getFirstTranslatorFileNameUnmodified( fileName ) if fileName != '': consecution.writeChainTextWithNounMessage( fileName, 'dimension' )
def writeOutput( fileName = '' ): "Lift the carving of a gcode file." fileName = interpret.getFirstTranslatorFileNameUnmodified( fileName ) if fileName != '': consecution.writeChainTextWithNounMessage( fileName, 'lift' )
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' )
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")
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' )
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")
def writeOutput( fileName = '' ): "Splodge a gcode linear move file." fileName = interpret.getFirstTranslatorFileNameUnmodified( fileName ) if fileName != '': consecution.writeChainTextWithNounMessage( fileName, 'splodge' )