'SVG_Viewer': DEFSET,
},'preface': {
'Meta': DEFSET,
- 'Set_Positioning_to_Absolute': DEFSET,
- 'Set_Units_to_Millimeters': DEFSET,
+ 'Set_Positioning_to_Absolute': "False",
+ 'Set_Units_to_Millimeters': "False",
'Start_at_Home': DEFSET,
'Turn_Extruder_Off_at_Shut_Down': DEFSET,
'Turn_Extruder_Off_at_Start_Up': DEFSET,
return archive.getTextLines(getAlterationFile(fileName))
def getAlterationFile(fileName):
- return unicode(profile.getAlterationFileContents(fileName)).encode("utf-8")
+ return profile.getAlterationFileContents(fileName)
####################################
## Configuration settings classes ##
\r
if action == self.actionList[0]:\r
resultFile.write(';TYPE:CUSTOM\n')\r
- resultFile.write(profile.getAlterationFileContents('start.gcode').encode('utf-8'))\r
+ resultFile.write(profile.getAlterationFileContents('start.gcode'))\r
else:\r
#reset the extrusion length, and move to the next object center.\r
resultFile.write(';TYPE:CUSTOM\n')\r
- resultFile.write(profile.getAlterationFileContents('nextobject.gcode').encode('utf-8'))\r
+ resultFile.write(profile.getAlterationFileContents('nextobject.gcode'))\r
resultFile.write(';PRINTNR:%d\n' % self.actionList.index(action))\r
profile.loadGlobalProfileFromString(oldProfile)\r
\r
wx.CallAfter(self.progressGauge2.SetValue, self.actionList.index(action) + 1)\r
\r
resultFile.write(';TYPE:CUSTOM\n')\r
- resultFile.write(profile.getAlterationFileContents('end.gcode').encode('utf-8'))\r
+ resultFile.write(profile.getAlterationFileContents('end.gcode'))\r
resultFile.close()\r
self.abort = True\r
wx.CallAfter(self.abortButton.SetLabel, 'Close')\r
self.statusText = wx.StaticText(self, -1, "Starting...")
self.progressGauge = wx.Gauge(self, -1)
- self.progressGauge.SetRange(10000)
+ self.progressGauge.SetRange(10000 * len(filelist))
self.abortButton = wx.Button(self, -1, "X", style=wx.BU_EXACTFIT)
self.sizer.Add(self.statusText, 2, flag=wx.ALIGN_CENTER )
self.sizer.Add(self.progressGauge, 2)
cmdList = []
oldProfile = profile.getGlobalProfileString()
for filename in self.filelist:
+ print filename, self.filelist.index(filename)
if self.filelist.index(filename) > 0:
profile.putProfileSetting('fan_enabled', 'False')
+ profile.putProfileSetting('skirt_lines', '0')
if len(self.filelist) > 1:
profile.putProfileSetting('add_start_end_gcode', 'False')
profile.putProfileSetting('gcode_extension', 'multi_extrude_tmp')
maxValue = int(progress[2])
wx.CallAfter(self.notifyWindow.SetProgress, progress[0], int(progress[1]), maxValue)
else:
- print line
+ #print line
self.progressLog.append(line)
wx.CallAfter(self.notifyWindow.statusText.SetLabel, line)
if self.notifyWindow.abort:
files = []
resultFile = open(self.filelist[0][:self.filelist[0].rfind('.')]+'_export.gcode', "w")
resultFile.write(';TYPE:CUSTOM\n')
- resultFile.write(unicode(profile.getAlterationFileContents('start.gcode')).encode('utf-8'))
+ resultFile.write(profile.getAlterationFileContents('start.gcode'))
for filename in self.filelist:
files.append(open(filename[:filename.rfind('.')]+'_export.multi_extrude_tmp', "r"))
+ currentExtruder = 0
+ layerNr = -1
hasLine = True
while hasLine:
hasLine = False
for f in files:
+ layerHasLine = False
for line in f:
- resultFile.write(line)
hasLine = True
if line.startswith(';LAYER:'):
break
+ if not layerHasLine:
+ nextExtruder = files.index(f)
+ resultFile.write(';LAYER:%d\n' % (layerNr))
+ resultFile.write(';EXTRUDER:%d\n' % (nextExtruder))
+ if nextExtruder != currentExtruder:
+ resultFile.write("G1 E-2 F3000\n")
+ resultFile.write("T%d\n" % (nextExtruder))
+ resultFile.write("G1 E2 F3000\n")
+ resultFile.write("M92 E0\n")
+ currentExtruder = nextExtruder
+ layerHasLine = True
+ resultFile.write(line)
+ layerNr += 1
for f in files:
f.close()
for filename in self.filelist:
os.remove(filename[:filename.rfind('.')]+'_export.multi_extrude_tmp')
resultFile.write(';TYPE:CUSTOM\n')
- resultFile.write(unicode(profile.getAlterationFileContents('end.gcode')).encode('utf-8'))
+ resultFile.write(profile.getAlterationFileContents('end.gcode'))
resultFile.close()
class LogWindow(wx.Frame):