Пример #1
0
def writeOutput(fileName=''):
    "Alternate shell file."
    fileName = fabmetheus_interpret.getFirstTranslatorFileNameUnmodified(
        fileName)
    if fileName == '':
        return
    skeinforge_craft.writeChainTextWithNounMessage(fileName, 'altshell')
Пример #2
0
def writeOutput(fileName=''):
    "Chamber a gcode linear move file."
    fileName = fabmetheus_interpret.getFirstTranslatorFileNameUnmodified(
        fileName)
    if fileName == '':
        return
    skeinforge_craft.writeChainTextWithNounMessage(fileName, 'chamber')
Пример #3
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 = fabmetheus_interpret.getFirstTranslatorFileNameUnmodified(
        fileName)
    if fileName == '':
        return
    skeinforge_craft.writeChainTextWithNounMessage(fileName, 'preface')
Пример #4
0
def writeOutput(fileName=''):
    "Export a gcode linear move file."
    fileName = fabmetheus_interpret.getFirstTranslatorFileNameUnmodified(
        fileName)
    if fileName == '':
        return
    exportRepository = ExportRepository()
    settings.getReadRepository(exportRepository)
    startTime = time.time()
    print('File ' + gcodec.getSummarizedFileName(fileName) +
          ' is being chain exported.')
    Filehandle = open('report.txt', 'w')
    Filehandle.write('File ' + gcodec.getSummarizedFileName(fileName) +
                     ' is being chain exported.\n')
    Filehandle.close()
    suffixFileName = fileName[:fileName.rfind(
        '.')] + '_export.' + exportRepository.fileExtension.value
    gcodeText = gcodec.getGcodeFileText(fileName, '')
    procedures = skeinforge_craft.getProcedures('export', gcodeText)
    gcodeText = skeinforge_craft.getChainTextFromProcedures(
        fileName, procedures[:-1], gcodeText)
    if gcodeText == '':
        return
    skeinforge_analyze.writeOutput(suffixFileName, gcodeText)
    if exportRepository.savePenultimateGcode.value:
        penultimateFileName = fileName[:fileName.
                                       rfind('.')] + '_penultimate.gcode'
        gcodec.writeFileText(penultimateFileName, gcodeText)
        print('The penultimate file is saved as ' +
              gcodec.getSummarizedFileName(penultimateFileName))
    exportChainGcode = getCraftedTextFromText(gcodeText, exportRepository)
    replaceableExportChainGcode = None
    selectedPluginModule = getSelectedPluginModule(
        exportRepository.exportPlugins)
    if selectedPluginModule == None:
        replaceableExportChainGcode = exportChainGcode
    else:
        if selectedPluginModule.isReplaceable():
            replaceableExportChainGcode = selectedPluginModule.getOutput(
                exportChainGcode)
        else:
            selectedPluginModule.writeOutput(suffixFileName, exportChainGcode)
    if replaceableExportChainGcode != None:
        replaceableExportChainGcode = getReplaced(replaceableExportChainGcode)
        gcodec.writeFileText(suffixFileName, replaceableExportChainGcode)
        print('The exported file is saved as ' +
              gcodec.getSummarizedFileName(suffixFileName))
    if exportRepository.alsoSendOutputTo.value != '':
        if replaceableExportChainGcode == None:
            replaceableExportChainGcode = selectedPluginModule.getOutput(
                exportChainGcode)
        exec('print >> ' + exportRepository.alsoSendOutputTo.value +
             ', replaceableExportChainGcode')
    print('It took ' + str(int(round(time.time() - startTime))) +
          ' seconds to export the file.')
    Filehandle = open('report.txt', 'a')
    Filehandle.write('It took ' + str(int(round(time.time() - startTime))) +
                     ' seconds to export the file.')
    Filehandle.close()
Пример #5
0
def writeOutput(fileName=''):
    'Export a gcode linear move file.'
    fileName = fabmetheus_interpret.getFirstTranslatorFileNameUnmodified(
        fileName)
    if fileName == '':
        return
    repository = ExportRepository()
    settings.getReadRepository(repository)
    startTime = time.time()
    print('File ' + archive.getSummarizedFileName(fileName) +
          ' is being chain exported.')
    suffixFileName = fileName[:fileName.rfind('.')]
    if repository.addExportSuffix.value:
        suffixFileName += '_export'
    suffixFileName += '.' + repository.fileExtension.value
    gcodeText = gcodec.getGcodeFileText(fileName, '')
    procedures = skeinforge_craft.getProcedures('export', gcodeText)
    gcodeText = skeinforge_craft.getChainTextFromProcedures(
        fileName, procedures[:-1], gcodeText)
    if gcodeText == '':
        return
    window = skeinforge_analyze.writeOutput(fileName, suffixFileName,
                                            gcodeText)
    if repository.savePenultimateGcode.value:
        penultimateFileName = fileName[:fileName.
                                       rfind('.')] + '_penultimate.gcode'
        archive.writeFileText(penultimateFileName, gcodeText)
        print('The penultimate file is saved as ' +
              archive.getSummarizedFileName(penultimateFileName))
    exportChainGcode = getCraftedTextFromText(gcodeText, repository)
    replaceableExportChainGcode = None
    selectedPluginModule = getSelectedPluginModule(repository.exportPlugins)
    if selectedPluginModule == None:
        replaceableExportChainGcode = exportChainGcode
    else:
        if selectedPluginModule.globalIsReplaceable:
            replaceableExportChainGcode = selectedPluginModule.getOutput(
                exportChainGcode)
        else:
            selectedPluginModule.writeOutput(suffixFileName, exportChainGcode)
    if replaceableExportChainGcode != None:
        replaceableExportChainGcode = getReplaced(replaceableExportChainGcode)
        archive.writeFileText(suffixFileName, replaceableExportChainGcode)
        print('The exported file is saved as ' +
              archive.getSummarizedFileName(suffixFileName))
    if repository.alsoSendOutputTo.value != '':
        if replaceableExportChainGcode == None:
            replaceableExportChainGcode = selectedPluginModule.getOutput(
                exportChainGcode)
        exec('print >> ' + repository.alsoSendOutputTo.value +
             ', replaceableExportChainGcode')
    print('It took %s to export the file.' %
          euclidean.getDurationString(time.time() - startTime))
    return window
Пример #6
0
def writeOutput( fileName = '' ):
	"Export a gcode linear move file."
	fileName = fabmetheus_interpret.getFirstTranslatorFileNameUnmodified( fileName )
	if fileName == '':
		return
	exportRepository = ExportRepository()
	settings.getReadRepository( exportRepository )
	startTime = time.time()
	print( 'File ' + gcodec.getSummarizedFileName( fileName ) + ' is being chain exported.' )
	Filehandle = open ('report.txt', 'w')
	Filehandle.write ('File ' + gcodec.getSummarizedFileName( fileName ) + ' is being chain exported.\n')
	Filehandle.close ()
	suffixFileName = fileName[ : fileName.rfind( '.' ) ] + '_export.' + exportRepository.fileExtension.value
	gcodeText = gcodec.getGcodeFileText( fileName, '' )
	procedures = skeinforge_craft.getProcedures( 'export', gcodeText )
	gcodeText = skeinforge_craft.getChainTextFromProcedures( fileName, procedures[ : - 1 ], gcodeText )
	if gcodeText == '':
		return
	skeinforge_analyze.writeOutput( suffixFileName, gcodeText )
	if exportRepository.savePenultimateGcode.value:
		penultimateFileName = fileName[ : fileName.rfind( '.' ) ] + '_penultimate.gcode'
		gcodec.writeFileText( penultimateFileName, gcodeText )
		print( 'The penultimate file is saved as ' + gcodec.getSummarizedFileName( penultimateFileName ) )
	exportChainGcode = getCraftedTextFromText( gcodeText, exportRepository )
	replaceableExportChainGcode = None
	selectedPluginModule = getSelectedPluginModule( exportRepository.exportPlugins )
	if selectedPluginModule == None:
		replaceableExportChainGcode = exportChainGcode
	else:
		if selectedPluginModule.isReplaceable():
			replaceableExportChainGcode = selectedPluginModule.getOutput( exportChainGcode )
		else:
			selectedPluginModule.writeOutput( suffixFileName, exportChainGcode )
	if replaceableExportChainGcode != None:
		replaceableExportChainGcode = getReplaced( replaceableExportChainGcode )
		gcodec.writeFileText( suffixFileName, replaceableExportChainGcode )
		print( 'The exported file is saved as ' + gcodec.getSummarizedFileName( suffixFileName ) )
	if exportRepository.alsoSendOutputTo.value != '':
		if replaceableExportChainGcode == None:
			replaceableExportChainGcode = selectedPluginModule.getOutput( exportChainGcode )
		exec( 'print >> ' + exportRepository.alsoSendOutputTo.value + ', replaceableExportChainGcode' )
	print( 'It took ' + str( int( round( time.time() - startTime ) ) ) + ' seconds to export the file.' )
	Filehandle = open ('report.txt', 'a')
	Filehandle.write ('It took '+ str( int( round( time.time() - startTime ) ) )+' seconds to export the file.')
	Filehandle.close ()
Пример #7
0
def writeOutput(fileName=''):
	'Export a gcode linear move file.'
	fileName = fabmetheus_interpret.getFirstTranslatorFileNameUnmodified(fileName)
	if fileName == '':
		return
	repository = ExportRepository()
	settings.getReadRepository(repository)
	startTime = time.time()
	print('File ' + archive.getSummarizedFileName(fileName) + ' is being chain exported.')
	suffixFileName = fileName[: fileName.rfind('.')]
	if repository.addExportSuffix.value:
		suffixFileName += '_export'
	suffixFileName += '.' + repository.fileExtension.value
	gcodeText = gcodec.getGcodeFileText(fileName, '')
	procedures = skeinforge_craft.getProcedures('export', gcodeText)
	gcodeText = skeinforge_craft.getChainTextFromProcedures(fileName, procedures[ : - 1 ], gcodeText)
	if gcodeText == '':
		return
	window = skeinforge_analyze.writeOutput(fileName, suffixFileName, gcodeText)
	if repository.savePenultimateGcode.value:
		penultimateFileName = fileName[: fileName.rfind('.')] + '_penultimate.gcode'
		archive.writeFileText(penultimateFileName, gcodeText)
		print('The penultimate file is saved as ' + archive.getSummarizedFileName(penultimateFileName))
	exportChainGcode = getCraftedTextFromText(gcodeText, repository)
	replaceableExportChainGcode = None
	selectedPluginModule = getSelectedPluginModule(repository.exportPlugins)
	if selectedPluginModule == None:
		replaceableExportChainGcode = exportChainGcode
	else:
		if selectedPluginModule.globalIsReplaceable:
			replaceableExportChainGcode = selectedPluginModule.getOutput(exportChainGcode)
		else:
			selectedPluginModule.writeOutput(suffixFileName, exportChainGcode)
	if replaceableExportChainGcode != None:
		replaceableExportChainGcode = getReplaced(replaceableExportChainGcode)
		archive.writeFileText( suffixFileName, replaceableExportChainGcode )
		print('The exported file is saved as ' + archive.getSummarizedFileName(suffixFileName))
	if repository.alsoSendOutputTo.value != '':
		if replaceableExportChainGcode == None:
			replaceableExportChainGcode = selectedPluginModule.getOutput(exportChainGcode)
		exec('print >> ' + repository.alsoSendOutputTo.value + ', replaceableExportChainGcode')
	print('It took %s to export the file.' % euclidean.getDurationString(time.time() - startTime))
	return window
Пример #8
0
def writeOutput(fileName=''):
	'Cool a gcode linear move file.  Chain cool the gcode if it is not already cooled.'
	fileName = fabmetheus_interpret.getFirstTranslatorFileNameUnmodified(fileName)
	if fileName != '':
		skeinforge_craft.writeChainTextWithNounMessage(fileName, 'cool')
Пример #9
0
def writeOutput(fileName=''):
	"Mill a gcode linear move file."
	fileName = fabmetheus_interpret.getFirstTranslatorFileNameUnmodified(fileName)
	if fileName == '':
		return
	skeinforge_craft.writeChainTextWithNounMessage( fileName, 'mill')
Пример #10
0
def writeOutput(fileName=""):
    "Speed a gcode linear move file."
    fileName = fabmetheus_interpret.getFirstTranslatorFileNameUnmodified(fileName)
    if fileName != "":
        skeinforge_craft.writeChainTextWithNounMessage(fileName, "speed")
Пример #11
0
def writeOutput(fileName=''):
    "Fillet a gcode linear move file. Depending on the settings, either arcPoint, arcRadius, arcSegment, bevel or do nothing."
    fileName = fabmetheus_interpret.getFirstTranslatorFileNameUnmodified(
        fileName)
    if fileName != '':
        skeinforge_craft.writeChainTextWithNounMessage(fileName, 'fillet')
Пример #12
0
def writeOutput( fileName = ''):
	"Alternate shell file."
	fileName = fabmetheus_interpret.getFirstTranslatorFileNameUnmodified(fileName)
	if fileName == '':
		return
	skeinforge_craft.writeChainTextWithNounMessage( fileName, 'altshell')
Пример #13
0
def writeOutput(fileName=''):
	'Limit a gcode file.'
	fileName = fabmetheus_interpret.getFirstTranslatorFileNameUnmodified(fileName)
	if fileName != '':
		skeinforge_craft.writeChainTextWithNounMessage( fileName, 'limit')
Пример #14
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 = fabmetheus_interpret.getFirstTranslatorFileNameUnmodified(
        fileName)
    if fileName != '':
        skeinforge_craft.writeChainTextWithNounMessage(fileName, 'hop')
Пример #15
0
def writeOutput(fileName=''):
	"Home a gcode linear move file.  Chain home the gcode if it is not already homed. If no fileName is specified, home the first unmodified gcode file in this folder."
	fileName = fabmetheus_interpret.getFirstTranslatorFileNameUnmodified(fileName)
	if fileName != '':
		skeinforge_craft.writeChainTextWithNounMessage( fileName, 'home')
Пример #16
0
def writeOutput(fileName=''):
	"Oozebane a gcode linear move file."
	fileName = fabmetheus_interpret.getFirstTranslatorFileNameUnmodified(fileName)
	if fileName != '':
		skeinforge_craft.writeChainTextWithNounMessage( fileName, 'oozebane')
Пример #17
0
def writeOutput( fileName = '' ):
	"Dimension a gcode file."
	fileName = fabmetheus_interpret.getFirstTranslatorFileNameUnmodified( fileName )
	if fileName != '':
		skeinforge_craft.writeChainTextWithNounMessage( fileName, 'dimension' )
Пример #18
0
	def writeOutput( self, fileName = ''):
		"Fillet a gcode linear move file. Depending on the settings, either arcPoint, arcRadius, arcSegment, bevel or do nothing."
		fileName = fabmetheus_interpret.getFirstTranslatorFileNameUnmodified(fileName)
		if fileName != '':
			skeinforge_craft.writeChainTextWithNounMessage( fileName, 'fillet')
Пример #19
0
def writeOutput(fileName=''):
    "Dimension a gcode file."
    fileName = fabmetheus_interpret.getFirstTranslatorFileNameUnmodified(
        fileName)
    if fileName != '':
        skeinforge_craft.writeChainTextWithNounMessage(fileName, 'dimension')
Пример #20
0
def writeOutput(fileName=''):
	"Inset the carving of a gcode file."
	fileName = fabmetheus_interpret.getFirstTranslatorFileNameUnmodified(fileName)
	if fileName != '':
		skeinforge_craft.writeChainTextWithNounMessage( fileName, 'inset')
Пример #21
0
	def writeOutput( self, fileName = ''):
		"Whittle the carving of a gcode file.  If no fileName is specified, whittle the first unmodified gcode file in this folder."
		fileName = fabmetheus_interpret.getFirstTranslatorFileNameUnmodified(fileName)
		if fileName == '':
			return
		skeinforge_craft.writeChainTextWithNounMessage( fileName, 'whittle')
Пример #22
0
def writeOutput(fileName=''):
    "Unpause a gcode linear move file."
    fileName = fabmetheus_interpret.getFirstTranslatorFileNameUnmodified(
        fileName)
    if fileName != '':
        skeinforge_craft.writeChainTextWithNounMessage(fileName, 'unpause')
Пример #23
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 = fabmetheus_interpret.getFirstTranslatorFileNameUnmodified(fileName)
	if fileName != '':
		skeinforge_craft.writeChainTextWithNounMessage( fileName, 'outset')
Пример #24
0
def writeOutput(fileName=''):
    "Lift the carving of a gcode file."
    fileName = fabmetheus_interpret.getFirstTranslatorFileNameUnmodified(
        fileName)
    if fileName != '':
        skeinforge_craft.writeChainTextWithNounMessage(fileName, 'lift')
Пример #25
0
def writeOutput(fileName=''):
    'Cool a gcode linear move file.  Chain cool the gcode if it is not already cooled.'
    fileName = fabmetheus_interpret.getFirstTranslatorFileNameUnmodified(
        fileName)
    if fileName != '':
        skeinforge_craft.writeChainTextWithNounMessage(fileName, 'cool')