From a720939e64949adf5d304f23ece7c28e7bfb4f9f Mon Sep 17 00:00:00 2001 From: Kostas Karmas Date: Mon, 27 Jan 2020 14:21:51 +0100 Subject: [PATCH] Fix max layer to correspond to starting layer When the starting layer was set to 0 the max layer was not adjusted to be max_layer-1. This commit makes the extra adjustment. --- .../scripts/DisplayFilenameAndLayerOnLCD.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/PostProcessingPlugin/scripts/DisplayFilenameAndLayerOnLCD.py b/plugins/PostProcessingPlugin/scripts/DisplayFilenameAndLayerOnLCD.py index 2bf687eb47..cbd131f17e 100644 --- a/plugins/PostProcessingPlugin/scripts/DisplayFilenameAndLayerOnLCD.py +++ b/plugins/PostProcessingPlugin/scripts/DisplayFilenameAndLayerOnLCD.py @@ -79,6 +79,8 @@ class DisplayFilenameAndLayerOnLCD(Script): if line.startswith(";LAYER_COUNT:"): max_layer = line max_layer = max_layer.split(":")[1] + if self.getSettingValueByKey("startNum") == 0: + max_layer = str(int(max_layer) - 1) if line.startswith(";LAYER:"): if self.getSettingValueByKey("maxlayer"): display_text = display_text + " of " + max_layer