chiark / gitweb /
Only add temperature to start code if the temperature is not configured in the start...
authordaid <daid303@gmail.com>
Tue, 24 Apr 2012 09:59:17 +0000 (11:59 +0200)
committerdaid <daid303@gmail.com>
Tue, 24 Apr 2012 09:59:17 +0000 (11:59 +0200)
Cura/util/profile.py

index 1596f043dd3c426ce34a71cc4c9816ae035c5e69..5fa85b7ff208847f6be75b044fea639dbbe86ddb 100644 (file)
@@ -64,6 +64,7 @@ profileDefaultSettings = {
        'raft_base_material_amount': '100',\r
        'raft_interface_material_amount': '100',\r
        'bottom_thickness': '0.3',\r
+       \r
        'add_start_end_gcode': 'True',\r
        'gcode_extension': 'gcode',\r
 }\r
@@ -327,6 +328,7 @@ def setAlterationFile(filename, value):
 ### Get the alteration file for output. (Used by Skeinforge)\r
 def getAlterationFileContents(filename):\r
        prefix = ''\r
+       alterationContents = getAlterationFile(filename)\r
        if filename == 'start.gcode':\r
                #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.\r
                #We also set our steps per E here, if configured.\r
@@ -334,11 +336,11 @@ def getAlterationFileContents(filename):
                if eSteps > 0:\r
                        prefix += 'M92 E%f\n' % (eSteps)\r
                temp = getProfileSettingFloat('print_temperature')\r
-               if temp > 0:\r
+               if temp > 0 and not '{print_temperature}' in alterationContents:\r
                        prefix += 'M109 S%f\n' % (temp)\r
        elif filename == 'replace.csv':\r
                #Always remove the extruder on/off M codes. These are no longer needed in 5D printing.\r
                prefix = 'M101\nM103\n'\r
        \r
-       return prefix + re.sub("\{[^\}]*\}", replaceTagMatch, getAlterationFile(filename))\r
+       return prefix + re.sub("\{[^\}]*\}", replaceTagMatch, alterationContents)\r
 \r