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.
This commit is contained in:
Kostas Karmas 2020-01-27 14:21:51 +01:00
parent e128dadbf5
commit a720939e64

View File

@ -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