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.
(cherry picked from commit 9227bb5
)
master
parent
e62578eb11
commit
aa9d92417a
|
@ -56,7 +56,6 @@ class Printer():
|
|||
|
||||
self._currentZ = None
|
||||
|
||||
self._peakZ = -1
|
||||
self._progress = None
|
||||
self._printTime = None
|
||||
self._printTimeLeft = None
|
||||
|
@ -185,7 +184,6 @@ class Printer():
|
|||
return
|
||||
|
||||
self._setCurrentZ(None)
|
||||
self._peakZ = -1
|
||||
self._comm.startPrint()
|
||||
|
||||
def togglePausePrint(self):
|
||||
|
@ -395,10 +393,9 @@ class Printer():
|
|||
Callback method for the comm object, called upon change of the z-layer.
|
||||
"""
|
||||
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
|
||||
# and some do anti-backlash up-then-down movement when advancing layers
|
||||
if newZ > self._peakZ:
|
||||
self._peakZ = newZ
|
||||
if newZ != oldZ:
|
||||
# we have to react to all z-changes, even those that might "go backward" due to a slicer's retraction or
|
||||
# anti-backlash-routines. Event subscribes should individually take care to filter out "wrong" z-changes
|
||||
eventManager().fire("ZChange", newZ)
|
||||
|
||||
self._setCurrentZ(newZ)
|
||||
|
|
Loading…
Reference in New Issue