Removed peakZ again, doesn't work this way

Slicers might raise the print head first for a "nose dive" onto the print platform, leading to a high peakZ already dialed in, with no way to get it down again. This way events won't be fired until the print reaches the height of the initial starting point. As a z-change is a z-change if z changes, we'll just fire the event now (if oldZ != newZ). Event consumers will have to think of a way to filter out the noise.
master
Gina Häußge 2013-06-30 19:15:16 +02:00
parent 83a864d3d8
commit 9227bb5fd0
1 changed files with 4 additions and 7 deletions

View File

@ -59,7 +59,6 @@ class Printer():
self._currentZ = None self._currentZ = None
self._peakZ = -1
self._progress = None self._progress = None
self._printTime = None self._printTime = None
self._printTimeLeft = None self._printTimeLeft = None
@ -184,7 +183,6 @@ class Printer():
return return
self._setCurrentZ(None) self._setCurrentZ(None)
self._peakZ = -1
self._comm.startPrint() self._comm.startPrint()
def togglePausePrint(self): def togglePausePrint(self):
@ -385,10 +383,9 @@ class Printer():
Callback method for the comm object, called upon change of the z-layer. Callback method for the comm object, called upon change of the z-layer.
""" """
oldZ = self._currentZ oldZ = self._currentZ
# only do this if we hit a new Z peak level. Some slicers do a Z-lift when retracting / moving without printing if newZ != oldZ:
# and some do anti-backlash up-then-down movement when advancing layers # we have to react to all z-changes, even those that might "go backward" due to a slicer's retraction or
if newZ > self._peakZ: # anti-backlash-routines. Event subscribes should individually take care to filter out "wrong" z-changes
self._peakZ = newZ
eventManager().fire("ZChange", newZ) eventManager().fire("ZChange", newZ)
self._setCurrentZ(newZ) self._setCurrentZ(newZ)