Browse Source

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.
Kostas Karmas 5 years ago
parent
commit
a720939e64

+ 2 - 0
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