From d568531aed1565ce1f4c65a902d9f2030f4a5b9d Mon Sep 17 00:00:00 2001 From: adripo Date: Thu, 11 Jun 2020 17:14:53 +0200 Subject: [PATCH 1/2] Fixed next XY return position after pause --- plugins/PostProcessingPlugin/scripts/PauseAtHeight.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/plugins/PostProcessingPlugin/scripts/PauseAtHeight.py b/plugins/PostProcessingPlugin/scripts/PauseAtHeight.py index db66cc10fb..6673c790da 100644 --- a/plugins/PostProcessingPlugin/scripts/PauseAtHeight.py +++ b/plugins/PostProcessingPlugin/scripts/PauseAtHeight.py @@ -204,10 +204,11 @@ class PauseAtHeight(Script): """Get the X and Y values for a layer (will be used to get X and Y of the layer after the pause).""" lines = layer.split("\n") for line in lines: - if self.getValue(line, "X") is not None and self.getValue(line, "Y") is not None: - x = self.getValue(line, "X") - y = self.getValue(line, "Y") - return x, y + if not line.startswith("M205"): + if self.getValue(line, "X") is not None and self.getValue(line, "Y") is not None: + x = self.getValue(line, "X") + y = self.getValue(line, "Y") + return x, y return 0, 0 def execute(self, data: List[str]) -> List[str]: From 2fc06069baf87d396a0d850085002cf26c6d56c9 Mon Sep 17 00:00:00 2001 From: adripo Date: Thu, 11 Jun 2020 17:38:06 +0200 Subject: [PATCH 2/2] Added whitelist G0..G4 instead of blacklist --- plugins/PostProcessingPlugin/scripts/PauseAtHeight.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/PostProcessingPlugin/scripts/PauseAtHeight.py b/plugins/PostProcessingPlugin/scripts/PauseAtHeight.py index 6673c790da..8ed1bb8942 100644 --- a/plugins/PostProcessingPlugin/scripts/PauseAtHeight.py +++ b/plugins/PostProcessingPlugin/scripts/PauseAtHeight.py @@ -204,7 +204,7 @@ class PauseAtHeight(Script): """Get the X and Y values for a layer (will be used to get X and Y of the layer after the pause).""" lines = layer.split("\n") for line in lines: - if not line.startswith("M205"): + if line.startswith(("G0", "G1", "G2", "G3")): if self.getValue(line, "X") is not None and self.getValue(line, "Y") is not None: x = self.getValue(line, "X") y = self.getValue(line, "Y")