chiark / gitweb /
Fixed the gcode start/end editor (was modified by the M92 and temperature insertion...
authordaid <daid303@gmail.com>
Wed, 29 Feb 2012 15:36:14 +0000 (16:36 +0100)
committerdaid <daid303@gmail.com>
Wed, 29 Feb 2012 15:36:14 +0000 (16:36 +0100)
SkeinPyPy_NewUI/fabmetheus_utilities/settings.py
SkeinPyPy_NewUI/newui/alterationPanel.py

index 485d897662e3b6d33a4c564790a2b7835f7b5477..67ec597aa97bf18adeb723ef4574a604dccad965 100644 (file)
@@ -442,21 +442,22 @@ def getAlterationFileLines(fileName):
 def getAlterationLines(fileName):
        return archive.getTextLines(getAlterationFile(fileName))
 
-def getAlterationFile(fileName):
+def getAlterationFile(fileName, allowMagicPrefix = True):
        "Get the file from the fileName or the lowercase fileName in the alterations directories."
        #print ('getAlterationFile:', fileName)
        prefix = ''
-       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.
-               eSteps = float(getSetting('steps_per_e_unit', '0'))
-               if eSteps > 0:
-                       prefix += 'M92 E'+str(eSteps)+'\n'
-               temp = float(getSetting('print_temperature', '0'))
-               if temp > 0:
-                       prefix += 'M109 S'+str(temp)+'\n'
-       elif fileName == 'replace.csv':
-               prefix = 'M101\nM103\n'
+       if allowMagicPrefix:
+               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.
+                       eSteps = float(getSetting('steps_per_e_unit', '0'))
+                       if eSteps > 0:
+                               prefix += 'M92 E'+str(eSteps)+'\n'
+                       temp = float(getSetting('print_temperature', '0'))
+                       if temp > 0:
+                               prefix += 'M109 S'+str(temp)+'\n'
+               elif fileName == 'replace.csv':
+                       prefix = 'M101\nM103\n'
        alterationsDirectory = archive.getSkeinforgePath('alterations')
        fullFilename = os.path.join(alterationsDirectory, fileName)
        if os.path.isfile(fullFilename):
index 509e516365e0d13f8e39b353b08ee4e4478944ac..8e610a8b1b20014fa5ab98317ee2c92efa32f549 100644 (file)
@@ -30,7 +30,7 @@ class alterationPanel(wx.Panel):
                self.loadFile(self.alterationFileList[self.list.GetSelection()])\r
 \r
        def loadFile(self, filename):\r
-               self.textArea.SetValue(settings.getAlterationFile(filename))\r
+               self.textArea.SetValue(settings.getAlterationFile(filename, False))\r
 \r
        def OnFocusLost(self, e):\r
                filename = os.path.join(archive.getSkeinforgePath('alterations'), self.alterationFileList[self.list.GetSelection()])\r