self.Bind(wx.EVT_MENU, lambda e: self.scene.ShowLoadModel(1), i)
i = self.fileMenu.Append(-1, 'Print...\tCTRL+P')
self.Bind(wx.EVT_MENU, lambda e: self.scene.ShowPrintWindow(), i)
+ i = self.fileMenu.Append(-1, 'Save GCode...')
+ self.Bind(wx.EVT_MENU, lambda e: self.scene.showSaveGCode(), i)
self.fileMenu.AppendSeparator()
i = self.fileMenu.Append(-1, 'Open Profile...')
else:
self.notification.message("Saved as %s" % (drive[1] + filename))
else:
- self._showSaveGCode()
+ self.showSaveGCode()
if button == 3:
menu = wx.Menu()
self.Bind(wx.EVT_MENU, lambda e: printWindow.printFile(self._slicer.getGCodeFilename()), 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.showSaveGCode(), menu.Append(-1, 'Save GCode...'))
+ self.Bind(wx.EVT_MENU, lambda e: self._showSliceLog(), menu.Append(-1, 'Slice engine log...'))
self.PopupMenu(menu)
menu.Destroy()
- def _showSaveGCode(self):
+ def showSaveGCode(self):
defPath = profile.getPreference('lastFile')
defPath = defPath[0:defPath.rfind('.')] + '.gcode'
dlg=wx.FileDialog(self, 'Save toolpath', defPath, style=wx.FD_SAVE)
else:
self.notification.message("Saved as %s" % (filename))
+ def _showSliceLog(self):
+ dlg = wx.TextEntryDialog(self, "The slicing engine reported the following", "Engine log...", '\n'.join(self._slicer.getSliceLog()), wx.TE_MULTILINE | wx.OK | wx.CENTRE)
+ dlg.ShowModal()
+ dlg.Destroy()
+
def OnToolSelect(self, button):
if self.rotateToolButton.getSelected():
self.tool = previewTools.toolRotate(self)
if self._focusObj is None:
return
obj = self._focusObj
- dlg = wx.NumberEntryDialog(self, "How many copies need to be made?", "Copies", "Multiply", 1, 1, 100)
+ dlg = wx.NumberEntryDialog(self, "How many items do you want?", "Copies", "Multiply", 2, 1, 100)
if dlg.ShowModal() != wx.ID_OK:
dlg.Destroy()
return
- cnt = dlg.GetValue()
+ cnt = dlg.GetValue() - 1
dlg.Destroy()
n = 0
while True:
break
if n > cnt:
break
+ if n <= cnt:
+ self.notification.message("Could not create more then %d items" % (n))
self._scene.remove(newObj)
self._scene.centerAll()
self.sceneUpdated()
self._exportFilename = getTempFilename()
self._progressSteps = ['inset', 'skin', 'export']
self._objCount = 0
+ self._sliceLog = []
def cleanup(self):
self.abortSlicer()
def getGCodeFilename(self):
return self._exportFilename
+ def getSliceLog(self):
+ return self._sliceLog
+
def runSlicer(self, scene):
self.abortSlicer()
self._callback(0.0, False)
commandList += ['#' * len(obj._meshList)]
self._objCount += 1
if self._objCount > 0:
- print ' '.join(commandList)
try:
self._process = self._runSliceProcess(commandList)
self._thread = threading.Thread(target=self._watchProcess)
def _watchProcess(self):
self._callback(0.0, False)
+ self._sliceLog = []
line = self._process.stdout.readline()
objectNr = 0
while len(line):
except:
pass
else:
- print '#', line.strip()
- pass
+ self._sliceLog.append(line.strip())
line = self._process.stdout.readline()
for line in self._process.stderr:
- print line.strip()
+ self._sliceLog.append(line.strip())
returnCode = self._process.wait()
- print returnCode
try:
if returnCode == 0:
self._callback(1.0, True)