From: daid Date: Wed, 29 Feb 2012 15:36:14 +0000 (+0100) Subject: Fixed the gcode start/end editor (was modified by the M92 and temperature insertion... X-Git-Tag: RC1~138 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=a73c1c1ca2c1f3d2a7db4639c3ad85cc9356fab6;p=cura.git Fixed the gcode start/end editor (was modified by the M92 and temperature insertion hacks) --- diff --git a/SkeinPyPy_NewUI/fabmetheus_utilities/settings.py b/SkeinPyPy_NewUI/fabmetheus_utilities/settings.py index 485d8976..67ec597a 100644 --- a/SkeinPyPy_NewUI/fabmetheus_utilities/settings.py +++ b/SkeinPyPy_NewUI/fabmetheus_utilities/settings.py @@ -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): diff --git a/SkeinPyPy_NewUI/newui/alterationPanel.py b/SkeinPyPy_NewUI/newui/alterationPanel.py index 509e5163..8e610a8b 100644 --- a/SkeinPyPy_NewUI/newui/alterationPanel.py +++ b/SkeinPyPy_NewUI/newui/alterationPanel.py @@ -30,7 +30,7 @@ class alterationPanel(wx.Panel): self.loadFile(self.alterationFileList[self.list.GetSelection()]) def loadFile(self, filename): - self.textArea.SetValue(settings.getAlterationFile(filename)) + self.textArea.SetValue(settings.getAlterationFile(filename, False)) def OnFocusLost(self, e): filename = os.path.join(archive.getSkeinforgePath('alterations'), self.alterationFileList[self.list.GetSelection()])