mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-06 05:57:33 +08:00
Report actual amount of filament pressed forward, even after final retraction.
This commit is contained in:
parent
6a5cab63d7
commit
d271198e48
@ -12,6 +12,7 @@ class gcode():
|
|||||||
posOffset = util3d.Vector3()
|
posOffset = util3d.Vector3()
|
||||||
currentE = 0.0
|
currentE = 0.0
|
||||||
totalExtrusion = 0.0
|
totalExtrusion = 0.0
|
||||||
|
maxExtrusion = 0.0
|
||||||
pathList = []
|
pathList = []
|
||||||
scale = 1.0
|
scale = 1.0
|
||||||
posAbs = True
|
posAbs = True
|
||||||
@ -69,6 +70,8 @@ class gcode():
|
|||||||
moveType = 'retract'
|
moveType = 'retract'
|
||||||
totalExtrusion += e
|
totalExtrusion += e
|
||||||
currentE += e
|
currentE += e
|
||||||
|
if totalExtrusion > maxExtrusion:
|
||||||
|
maxExtrusion = totalExtrusion
|
||||||
if currentPath['type'] != moveType or currentPath['pathType'] != pathType:
|
if currentPath['type'] != moveType or currentPath['pathType'] != pathType:
|
||||||
pathList.append(currentPath)
|
pathList.append(currentPath)
|
||||||
currentPath = {'type': moveType, 'pathType': pathType, 'list': [currentPath['list'][-1]], 'layerNr': layerNr}
|
currentPath = {'type': moveType, 'pathType': pathType, 'list': [currentPath['list'][-1]], 'layerNr': layerNr}
|
||||||
@ -134,8 +137,8 @@ class gcode():
|
|||||||
print "Unknown M code:" + str(M)
|
print "Unknown M code:" + str(M)
|
||||||
self.layerCount = layerNr
|
self.layerCount = layerNr
|
||||||
self.pathList = pathList
|
self.pathList = pathList
|
||||||
self.totalExtrusion = totalExtrusion
|
self.extrusionAmount = extrusionAmount
|
||||||
print "Extruded a total of: %d mm of filament" % (self.totalExtrusion)
|
print "Extruded a total of: %d mm of filament" % (self.extrusionAmount)
|
||||||
|
|
||||||
def getCodeInt(self, str, id):
|
def getCodeInt(self, str, id):
|
||||||
m = re.search(id + '([^\s]+)', str)
|
m = re.search(id + '([^\s]+)', str)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user