Esempio n. 1
0
 def OnSliceDone(self, result):
     self.progressGauge.Destroy()
     self.abortButton.Destroy()
     self.progressLog = result.progressLog
     self.logButton = wx.Button(self, -1, "Show Log")
     self.abortButton = wx.Button(self, -1, "X", style=wx.BU_EXACTFIT)
     self.Bind(wx.EVT_BUTTON, self.OnShowLog, self.logButton)
     self.Bind(wx.EVT_BUTTON, self.OnAbort, self.abortButton)
     self.sizer.Add(self.logButton, 0)
     if result.returnCode == 0:
         status = "Ready: Filament: %.2fm %.2fg" % (
             result.gcode.extrusionAmount / 1000,
             result.gcode.calculateWeight() * 1000)
         status += " Print time: %02d:%02d" % (int(
             result.gcode.totalMoveTimeMinute /
             60), int(result.gcode.totalMoveTimeMinute % 60))
         cost = result.gcode.calculateCost()
         if cost is not None:
             status += " Cost: %s" % (cost)
         self.statusText.SetLabel(status)
         if explorer.hasExplorer():
             self.openFileLocationButton = wx.Button(
                 self, -1, "Open file location")
             self.Bind(wx.EVT_BUTTON, self.OnOpenFileLocation,
                       self.openFileLocationButton)
             self.sizer.Add(self.openFileLocationButton, 0)
         if len(profile.getSDcardDrives()) > 0:
             self.copyToSDButton = wx.Button(self, -1, "Copy to SDCard")
             self.Bind(wx.EVT_BUTTON, self.OnCopyToSD, self.copyToSDButton)
             self.sizer.Add(self.copyToSDButton, 0)
         self.showButton = wx.Button(self, -1, "Show result")
         self.Bind(wx.EVT_BUTTON, self.OnShowGCode, self.showButton)
         self.sizer.Add(self.showButton, 0)
     else:
         self.statusText.SetLabel("Something went wrong during slicing!")
     self.sizer.Add(self.abortButton, 0)
     self.sizer.Layout()
     self.Layout()
     self.abort = True
     if self.mainWindow.preview3d.reloadModelFiles(self.filelist):
         self.mainWindow.preview3d.setViewMode("GCode")
     self.thread = None
     del result.gcode
     taskbar.setBusy(self.GetParent(), False)
Esempio n. 2
0
 def OnSliceDone(self, result):
     self.progressGauge.Destroy()
     self.abortButton.Destroy()
     self.progressLog = result.progressLog
     self.logButton = wx.Button(self, -1, "Show Log")
     self.abortButton = wx.Button(self, -1, "X", style=wx.BU_EXACTFIT)
     self.Bind(wx.EVT_BUTTON, self.OnShowLog, self.logButton)
     self.Bind(wx.EVT_BUTTON, self.OnAbort, self.abortButton)
     self.sizer.Add(self.logButton, 0)
     if result.returnCode == 0:
         status = "Ready: Filament: %.2fm %.2fg" % (
             result.gcode.extrusionAmount / 1000,
             result.gcode.calculateWeight() * 1000,
         )
         status += " Print time: %02d:%02d" % (
             int(result.gcode.totalMoveTimeMinute / 60),
             int(result.gcode.totalMoveTimeMinute % 60),
         )
         cost = result.gcode.calculateCost()
         if cost is not None:
             status += " Cost: %s" % (cost)
         self.statusText.SetLabel(status)
         if explorer.hasExplorer():
             self.openFileLocationButton = wx.Button(self, -1, "Open file location")
             self.Bind(wx.EVT_BUTTON, self.OnOpenFileLocation, self.openFileLocationButton)
             self.sizer.Add(self.openFileLocationButton, 0)
         if len(profile.getSDcardDrives()) > 0:
             self.copyToSDButton = wx.Button(self, -1, "Copy to SDCard")
             self.Bind(wx.EVT_BUTTON, self.OnCopyToSD, self.copyToSDButton)
             self.sizer.Add(self.copyToSDButton, 0)
         self.showButton = wx.Button(self, -1, "Show result")
         self.Bind(wx.EVT_BUTTON, self.OnShowGCode, self.showButton)
         self.sizer.Add(self.showButton, 0)
     else:
         self.statusText.SetLabel("Something went wrong during slicing!")
     self.sizer.Add(self.abortButton, 0)
     self.sizer.Layout()
     self.Layout()
     self.abort = True
     if self.mainWindow.preview3d.reloadModelFiles(self.filelist):
         self.mainWindow.preview3d.setViewMode("GCode")
     taskbar.setBusy(self.GetParent(), False)
Esempio n. 3
0
	def OnSliceDone(self):
		self.abortButton.Destroy()
		self.closeButton = wx.Button(self, -1, "Close")
		self.printButton = wx.Button(self, -1, "Print")
		self.logButton = wx.Button(self, -1, "Show log")
		self.sizer.Add(self.closeButton, (3,0), span=(1,1))
		self.sizer.Add(self.printButton, (3,1), span=(1,1))
		self.sizer.Add(self.logButton, (3,2), span=(1,1))
		if explorer.hasExplorer():
			self.openFileLocationButton = wx.Button(self, -1, "Open file location")
			self.Bind(wx.EVT_BUTTON, self.OnOpenFileLocation, self.openFileLocationButton)
			self.sizer.Add(self.openFileLocationButton, (3,3), span=(1,1))
		if profile.getPreference('sdpath') != '':
			self.copyToSDButton = wx.Button(self, -1, "To SDCard")
			self.Bind(wx.EVT_BUTTON, self.OnCopyToSD, self.copyToSDButton)
			self.sizer.Add(self.copyToSDButton, (3,4), span=(1,1))
		self.Bind(wx.EVT_BUTTON, self.OnAbort, self.closeButton)
		self.Bind(wx.EVT_BUTTON, self.OnPrint, self.printButton)
		self.Bind(wx.EVT_BUTTON, self.OnShowLog, self.logButton)
		self.Layout()
		self.Fit()
		taskbar.setBusy(self, False)
Esempio n. 4
0
 def OnSliceDone(self):
     self.abortButton.Destroy()
     self.closeButton = wx.Button(self, -1, "Close")
     self.printButton = wx.Button(self, -1, "Print")
     self.logButton = wx.Button(self, -1, "Show log")
     self.sizer.Add(self.closeButton, (3, 0), span=(1, 1))
     self.sizer.Add(self.printButton, (3, 1), span=(1, 1))
     self.sizer.Add(self.logButton, (3, 2), span=(1, 1))
     if explorer.hasExplorer():
         self.openFileLocationButton = wx.Button(self, -1,
                                                 "Open file location")
         self.Bind(wx.EVT_BUTTON, self.OnOpenFileLocation,
                   self.openFileLocationButton)
         self.sizer.Add(self.openFileLocationButton, (3, 3), span=(1, 1))
     if profile.getPreference('sdpath') != '':
         self.copyToSDButton = wx.Button(self, -1, "To SDCard")
         self.Bind(wx.EVT_BUTTON, self.OnCopyToSD, self.copyToSDButton)
         self.sizer.Add(self.copyToSDButton, (3, 4), span=(1, 1))
     self.Bind(wx.EVT_BUTTON, self.OnAbort, self.closeButton)
     self.Bind(wx.EVT_BUTTON, self.OnPrint, self.printButton)
     self.Bind(wx.EVT_BUTTON, self.OnShowLog, self.logButton)
     self.Layout()
     self.Fit()
     taskbar.setBusy(self, False)