コード例 #1
0
	def getLineWithTruncatedNumber(self, character, line, splitLine):
		'Get a line with the number after the character truncated.'
		numberString = gcodec.getStringFromCharacterSplitLine(character, splitLine)
		if numberString == None:
			return line
		roundedNumberString = euclidean.getRoundedToPlacesString(self.decimalPlacesExported, float(numberString))
		return gcodec.getLineWithValueString(character, line, splitLine, roundedNumberString)
コード例 #2
0
ファイル: export.py プロジェクト: folksjos/RepG
	def getLineWithTruncatedNumber(self, character, line, splitLine):
		'Get a line with the number after the character truncated.'
		numberString = gcodec.getStringFromCharacterSplitLine(character, splitLine)
		if numberString == None:
			return line
		roundedNumberString = euclidean.getRoundedToPlacesString(self.decimalPlacesExported, float(numberString))
		return gcodec.getLineWithValueString(character, line, splitLine, roundedNumberString)
コード例 #3
0
ファイル: mcomp.py プロジェクト: malx122/Software
	def parseLine( self, line ):
		"Parse a gcode line and add it to the stretch skein."
		#print line
		splitLine = gcodec.getSplitLineBeforeBracketSemicolon(line)
		if len(splitLine) < 1:
			return
		firstWord = splitLine[0]
		location = gcodec.getLocationFromSplitLine(self.oldLocation, splitLine)
		if location != self.oldLocation:
			self.oldLocation = location
			#calc new y based on X pos and y error
			newY = myformat(location.y - ( location.x * self.errY ))
			self.distanceFeedRate.addLine(gcodec.getLineWithValueString('Y', line, splitLine, str(newY)))
		else:
			self.distanceFeedRate.addLine(line)