MCPcopy Create free account
hub / github.com/AstroPrint/AstroBox / mcZChange

Method mcZChange

src/astroprint/printer/__init__.py:604–614  ·  view source on GitHub ↗

Callback method for the comm object, called upon change of the z-layer.

(self, newZ)

Source from the content-addressed store, hash-verified

602
603 # This should be deprecated, there's no a layer change event
604 def mcZChange(self, newZ):
605 """
606 Callback method for the comm object, called upon change of the z-layer.
607 """
608 oldZ = self._currentZ
609 if newZ != oldZ:
610 # we have to react to all z-changes, even those that might "go backward" due to a slicer's retraction or
611 # anti-backlash-routines. Event subscribes should individually take care to filter out "wrong" z-changes
612 eventManager().fire(Events.Z_CHANGE, {"new": newZ, "old": oldZ})
613
614 self._setCurrentZ(newZ)
615
616 def mcPhotoCommand(self):
617 cm = cameraManager()

Callers

nothing calls this directly

Calls 3

_setCurrentZMethod · 0.95
eventManagerFunction · 0.90
fireMethod · 0.80

Tested by

no test coverage detected