From: daid Date: Tue, 24 Apr 2012 09:59:17 +0000 (+0200) Subject: Only add temperature to start code if the temperature is not configured in the start... X-Git-Tag: RC3~21 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=a6253b7f489968f6d4b55335df9032cb276961cc;p=cura.git Only add temperature to start code if the temperature is not configured in the start code already. Fixes #76 --- diff --git a/Cura/util/profile.py b/Cura/util/profile.py index 1596f043..5fa85b7f 100644 --- a/Cura/util/profile.py +++ b/Cura/util/profile.py @@ -64,6 +64,7 @@ profileDefaultSettings = { 'raft_base_material_amount': '100', 'raft_interface_material_amount': '100', 'bottom_thickness': '0.3', + 'add_start_end_gcode': 'True', 'gcode_extension': 'gcode', } @@ -327,6 +328,7 @@ def setAlterationFile(filename, value): ### Get the alteration file for output. (Used by Skeinforge) def getAlterationFileContents(filename): prefix = '' + alterationContents = getAlterationFile(filename) if filename == 'start.gcode': #For the start code, hack the temperature and the steps per E value into it. So the temperature is reached before the start code extrusion. #We also set our steps per E here, if configured. @@ -334,11 +336,11 @@ def getAlterationFileContents(filename): if eSteps > 0: prefix += 'M92 E%f\n' % (eSteps) temp = getProfileSettingFloat('print_temperature') - if temp > 0: + if temp > 0 and not '{print_temperature}' in alterationContents: prefix += 'M109 S%f\n' % (temp) elif filename == 'replace.csv': #Always remove the extruder on/off M codes. These are no longer needed in 5D printing. prefix = 'M101\nM103\n' - return prefix + re.sub("\{[^\}]*\}", replaceTagMatch, getAlterationFile(filename)) + return prefix + re.sub("\{[^\}]*\}", replaceTagMatch, alterationContents)