Exemple #1
0
 def getCraftedGcode(self, gcodeText, repository):
     'Parse gcode text and store the cool gcode.'
     self.repository = repository
     self.coolEndLines = settings.getAlterationFileLines(
         repository.nameOfCoolEndFile.value)
     self.coolStartLines = settings.getAlterationFileLines(
         repository.nameOfCoolStartFile.value)
     self.halfCorner = complex(repository.minimumOrbitalRadius.value,
                               repository.minimumOrbitalRadius.value)
     self.lines = archive.getTextLines(gcodeText)
     self.minimumArea = 4.0 * repository.minimumOrbitalRadius.value * repository.minimumOrbitalRadius.value
     self.minFeedrate = repository.minimumFeedRate.value * 60
     self.parseInitialization()
     self.boundingRectangle = gcodec.BoundingRectangle().getFromGcodeLines(
         self.lines[self.lineIndex:], 0.5 * self.edgeWidth)
     margin = 0.2 * self.edgeWidth
     halfCornerMargin = self.halfCorner + complex(margin, margin)
     self.boundingRectangle.cornerMaximum -= halfCornerMargin
     self.boundingRectangle.cornerMinimum += halfCornerMargin
     for self.lineIndex in xrange(self.lineIndex, len(self.lines)):
         line = self.lines[self.lineIndex]
         self.parseLine(line)
     if repository.turnFanOffAtEnding.value:
         self.distanceFeedRate.addLine('M107')
     return gcodec.getGcodeWithoutDuplication(
         'M108', self.distanceFeedRate.output.getvalue())
Exemple #2
0
 def addFromUpperLowerFile(self, fileName):
     "Add lines of text from the fileName or the lowercase fileName, if there is no file by the original fileName in the directory."
     alterationFileLines = map(
         lambda l: l.replace('?filename?', self.fileName),
         settings.getAlterationFileLines(fileName))
     self.distanceFeedRate.addLinesSetAbsoluteDistanceMode(
         alterationFileLines)
Exemple #3
0
	def getCraftedGcode(self, gcodeText, repository):
		'Parse gcode text and store the cool gcode.'
		self.repository = repository
		self.coolEndLines = settings.getAlterationFileLines(repository.nameOfCoolEndFile.value)
		self.coolStartLines = settings.getAlterationFileLines(repository.nameOfCoolStartFile.value)
		self.halfCorner = complex(repository.minimumOrbitalRadius.value, repository.minimumOrbitalRadius.value)
		self.lines = archive.getTextLines(gcodeText)
		self.minimumArea = 4.0 * repository.minimumOrbitalRadius.value * repository.minimumOrbitalRadius.value
		self.parseInitialization()
		self.boundingRectangle = gcodec.BoundingRectangle().getFromGcodeLines(self.lines[self.lineIndex :], 0.5 * self.edgeWidth)
		margin = 0.2 * self.edgeWidth
		halfCornerMargin = self.halfCorner + complex(margin, margin)
		self.boundingRectangle.cornerMaximum -= halfCornerMargin
		self.boundingRectangle.cornerMinimum += halfCornerMargin
		for self.lineIndex in xrange(self.lineIndex, len(self.lines)):
			line = self.lines[self.lineIndex]
			self.parseLine(line)
		if repository.turnFanOffAtEnding.value:
			self.distanceFeedRate.addLine('M107')
		return gcodec.getGcodeWithoutDuplication('M108', self.distanceFeedRate.output.getvalue())
Exemple #4
0
	def getCraftedGcode( self, gcodeText, repository ):
		"Parse gcode text and store the home gcode."
		self.repository = repository
		self.homeLines = settings.getAlterationFileLines(repository.nameOfHomeFile.value)
		if len(self.homeLines) < 1:
			return gcodeText
		self.lines = archive.getTextLines(gcodeText)
		self.parseInitialization( repository )
		for self.lineIndex in xrange(self.lineIndex, len(self.lines)):
			line = self.lines[self.lineIndex]
			self.parseLine(line)
		return self.distanceFeedRate.output.getvalue()
Exemple #5
0
	def getCraftedGcode( self, gcodeText, repository ):
		"Parse gcode text and store the home gcode."
		self.repository = repository
		self.homeLines = settings.getAlterationFileLines(repository.nameOfHomeFile.value)
		if len(self.homeLines) < 1:
			return gcodeText
		self.lines = archive.getTextLines(gcodeText)
		self.parseInitialization( repository )
		for self.lineIndex in xrange(self.lineIndex, len(self.lines)):
			line = self.lines[self.lineIndex]
			self.parseLine(line)
		return self.distanceFeedRate.output.getvalue()
Exemple #6
0
	def addFromUpperLowerFile(self, fileName):
		"Add lines of text from the fileName or the lowercase fileName, if there is no file by the original fileName in the directory."
		alterationFileLines = settings.getAlterationFileLines(fileName)
		self.distanceFeedRate.addLinesSetAbsoluteDistanceMode(alterationFileLines)
Exemple #7
0
	def addFromUpperLowerFile(self, fileName):
		"Add lines of text from the fileName or the lowercase fileName, if there is no file by the original fileName in the directory."
		alterationFileLines = map(lambda l: l.replace('?filename?', self.fileName.encode('ascii', 'replace')), settings.getAlterationFileLines(fileName))
		self.distanceFeedRate.addLinesSetAbsoluteDistanceMode(alterationFileLines)
Exemple #8
0
 def addFromUpperLowerFile(self, fileName):
     "Add lines of text from the fileName or the lowercase fileName, if there is no file by the original fileName in the directory."
     self.distanceFeedRate.addLinesSetAbsoluteDistanceMode(
         settings.getAlterationFileLines(fileName))