def showPrintWindow(self, button):
if button == 1:
if machineCom.machineIsConnected():
- printWindow.printFile(self._gcode.filename)
+ printWindow.printFile(self._gcodeFilename)
elif len(removableStorage.getPossibleSDcardDrives()) > 0:
drives = removableStorage.getPossibleSDcardDrives()
if len(drives) > 1:
drive = drives[0]
filename = os.path.basename(profile.getPreference('lastFile'))
filename = filename[0:filename.rfind('.')] + '.gcode'
- threading.Thread(target=self._copyFile,args=(self._gcode.filename, drive[1] + filename, drive[1])).start()
+ threading.Thread(target=self._copyFile,args=(self._gcodeFilename, drive[1] + filename, drive[1])).start()
else:
self.showSaveGCode()
if button == 3:
menu = wx.Menu()
- self.Bind(wx.EVT_MENU, lambda e: printWindow.printFile(self._gcode.filename), menu.Append(-1, 'Print with USB'))
+ self.Bind(wx.EVT_MENU, lambda e: printWindow.printFile(self._gcodeFilename), menu.Append(-1, 'Print with USB'))
self.Bind(wx.EVT_MENU, lambda e: self.showSaveGCode(), menu.Append(-1, 'Save GCode...'))
self.Bind(wx.EVT_MENU, lambda e: self._showSliceLog(), menu.Append(-1, 'Slice engine log...'))
self.PopupMenu(menu)
filename = dlg.GetPath()
dlg.Destroy()
- threading.Thread(target=self._copyFile,args=(self._gcode.filename, filename)).start()
+ threading.Thread(target=self._copyFile,args=(self._gcodeFilename, filename)).start()
def _copyFile(self, fileA, fileB, allowEject = False):
try:
self.printButton.setProgressBar(float(fsrc.tell()) / size)
self._queueRefresh()
except:
+ import sys
+ print sys.exc_info()
self.notification.message("Failed to save")
else:
if allowEject:
def OnScaleMax(self, button):
if self._selectedObj is None:
return
- self._selectedObj.scaleUpTo(self._machineSize - numpy.array(profile.calculateObjectSizeOffsets() + [0.0], numpy.float32) * 2)
+ self._selectedObj.scaleUpTo(self._machineSize - numpy.array(profile.calculateObjectSizeOffsets() + [0.0], numpy.float32) * 2 - numpy.array([1,1,1], numpy.float32))
self._scene.pushFree()
self._selectObject(self._selectedObj)
self.updateProfileToControls()
a = numpy.concatenate((a[:-1], a[1:]), 1)
a = a.reshape((len(a) * 2, 3))
pointList = numpy.concatenate((pointList, a))
-# if path['type'] == 'retract':
-# a = path['points'] + numpy.array([0,0,0.01], numpy.float32)
-# a = numpy.concatenate((a[:-1], a[1:] + numpy.array([0,0,0.3], numpy.float32)), 1)
-# a = a.reshape((len(a) * 2, 3))
-# pointList = numpy.concatenate((pointList, a))
+ if path['type'] == 'retract':
+ a = path['points'] + numpy.array([0,0,0.01], numpy.float32)
+ a = numpy.concatenate((a[:-1], a[1:] + numpy.array([0,0,1], numpy.float32)), 1)
+ a = a.reshape((len(a) * 2, 3))
+ pointList = numpy.concatenate((pointList, a))
ret.append(opengl.GLVBO(pointList))
return ret
self.abortSlicer()
self._callback(-1.0, False)
+ extruderCount = 1
+ for obj in scene.objects():
+ if scene.checkPlatform(obj):
+ extruderCount = max(extruderCount, len(obj._meshList))
+
commandList = [getEngineFilename(), '-vv']
- for k, v in self._engineSettings().iteritems():
+ for k, v in self._engineSettings(extruderCount).iteritems():
commandList += ['-s', '%s=%s' % (k, str(v))]
commandList += ['-o', self._exportFilename]
commandList += ['-b', self._binaryStorageFilename]
profile.runPostProcessingPlugins(self._exportFilename)
self._callback(1.0, True)
else:
+ for line in self._sliceLog:
+ print line
self._callback(-1.0, False)
except:
pass
self._process = None
- def _engineSettings(self):
+ def _engineSettings(self, extruderCount):
settings = {
'layerThickness': int(profile.getProfileSettingFloat('layer_height') * 1000),
'initialLayerThickness': int(profile.getProfileSettingFloat('bottom_thickness') * 1000) if profile.getProfileSettingFloat('bottom_thickness') > 0.0 else int(profile.getProfileSettingFloat('layer_height') * 1000),
'minimalLayerTime': int(profile.getProfileSettingFloat('cool_min_layer_time')),
'minimalFeedrate': int(profile.getProfileSettingFloat('cool_min_feedrate')),
'coolHeadLift': 1 if profile.getProfileSetting('cool_head_lift') == 'True' else 0,
- 'startCode': profile.getAlterationFileContents('start.gcode'),
+ 'startCode': profile.getAlterationFileContents('start.gcode', extruderCount),
'endCode': profile.getAlterationFileContents('end.gcode'),
'extruderOffset[1].X': int(profile.getPreferenceFloat('extruder_offset_x1') * 1000),
elif profile.getProfileSetting('platform_adhesion') == 'Raft':
settings['skirtDistance'] = 0
settings['skirtLineCount'] = 0
- settings['raftMargin'] = int(profile.getProfileSettingFloat('raft_margin') * 1000);
- settings['raftBaseThickness'] = int(profile.getProfileSettingFloat('raft_base_thickness') * 1000);
- settings['raftBaseLinewidth'] = int(profile.getProfileSettingFloat('raft_base_linewidth') * 1000);
- settings['raftInterfaceThickness'] = int(profile.getProfileSettingFloat('raft_interface_thickness') * 1000);
- settings['raftInterfaceLinewidth'] = int(profile.getProfileSettingFloat('raft_interface_linewidth') * 1000);
+ settings['raftMargin'] = int(profile.getProfileSettingFloat('raft_margin') * 1000)
+ settings['raftBaseThickness'] = int(profile.getProfileSettingFloat('raft_base_thickness') * 1000)
+ settings['raftBaseLinewidth'] = int(profile.getProfileSettingFloat('raft_base_linewidth') * 1000)
+ settings['raftInterfaceThickness'] = int(profile.getProfileSettingFloat('raft_interface_thickness') * 1000)
+ settings['raftInterfaceLinewidth'] = int(profile.getProfileSettingFloat('raft_interface_linewidth') * 1000)
else:
settings['skirtDistance'] = int(profile.getProfileSettingFloat('skirt_gap') * 1000)
settings['skirtLineCount'] = int(profile.getProfileSettingFloat('skirt_line_count'))