From 02e02a8f98961a154403ea892024a9b0e0c008e4 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 19 Apr 2016 15:30:34 +0200 Subject: [PATCH] Added way to update the head position CURA-1339 --- cura/PrinterOutputDevice.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/cura/PrinterOutputDevice.py b/cura/PrinterOutputDevice.py index 9bc46ea532..7025646294 100644 --- a/cura/PrinterOutputDevice.py +++ b/cura/PrinterOutputDevice.py @@ -190,6 +190,22 @@ class PrinterOutputDevice(OutputDevice, QObject): def headZ(self): return self._head_z + ## Update the saved position of the head + # This function should be called when a new position for the head is recieved. + def _updateHeadPosition(self, x, y ,z): + position_changed = False + if self._head_x != x: + self._head_x = x + position_changed = True + if self._head_y != y: + self._head_y = y + position_changed = True + if self._head_z != z: + self._head_z = z + position_changed = True + if position_changed: + self.headPositionChanged.emit() + ## Set the position of the head. # In some machines it's actually the bed that moves. For convenience sake we simply see it all as head movements. # This function is "final" (do not re-implement)