Only apply the temperature offset if the temperature being set from the GCODE isn't 0 ("heaters off")

This commit is contained in:
Gina Häußge 2013-11-18 11:35:38 +01:00
parent 4d2213544e
commit 297d101f5f

View file

@ -1178,8 +1178,9 @@ class PrintingGcodeFileInformation(PrintingFileInformation):
try:
temp = float(tempMatch.group(2))
newTemp = temp + offset
line = line.replace("S" + tempMatch.group(2), "S%f" % newTemp)
if temp > 0:
newTemp = temp + offset
line = line.replace("S" + tempMatch.group(2), "S%f" % newTemp)
except ValueError:
pass
return line