mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-06 08:36:07 +08:00
Fixed the gcode start/end editor (was modified by the M92 and temperature insertion hacks)
This commit is contained in:
parent
5481b6e636
commit
a73c1c1ca2
@ -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):
|
||||
|
@ -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()])
|
||||
|
Loading…
x
Reference in New Issue
Block a user