def mcStateChange(self, state): if self.machineCom is not None: if state == self.machineCom.STATE_OPERATIONAL and self.cam is not None: self.cam.endTimelapse() if state == self.machineCom.STATE_OPERATIONAL: taskbar.setBusy(self, False) if self.machineCom.isClosedOrError(): taskbar.setBusy(self, False) if self.machineCom.isPaused(): taskbar.setPause(self, True) wx.CallAfter(self.UpdateButtonStates) wx.CallAfter(self.UpdateProgress)
def mcStateChange(self, state): if self.machineCom != None: if state == self.machineCom.STATE_OPERATIONAL and self.cam != None: self.cam.endTimelapse() if state == self.machineCom.STATE_OPERATIONAL: taskbar.setBusy(self, False) if self.machineCom.isClosedOrError(): taskbar.setBusy(self, False) if self.machineCom.isPaused(): taskbar.setPause(self, True) wx.CallAfter(self.UpdateButtonStates) wx.CallAfter(self.UpdateProgress)
def mcStateChange(self, state): if self.machineCom is not None: if state == self.machineCom.STATE_OPERATIONAL and self.cam is not None: self.cam.endTimelapse() if state == self.machineCom.STATE_OPERATIONAL: taskbar.setBusy(self, False) if self.machineCom.isClosedOrError(): taskbar.setBusy(self, False) if self.machineCom.isPaused(): taskbar.setPause(self, True) if self.machineCom.isClosedOrError(): print 'STATE:CLOSED' elif self.machineCom.isPrinting(): print 'STATE:PRINTING' else: print 'STATE:IDLE' wx.CallAfter(self.UpdateButtonStates) wx.CallAfter(self.UpdateProgress)
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)
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)
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 exporer.hasExporer(): 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)
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)
def OnConnect(self, e): if self.machineCom != None: self.machineCom.close() self.machineCom = machineCom.MachineCom(callbackObject=self) self.UpdateButtonStates() taskbar.setBusy(self, True)
def OnOk(self, e): self.Close() taskbar.setBusy(self.GetParent(), False)
def OnConnect(self, e): if self.machineCom is not None: self.machineCom.close() self.machineCom = machineCom.MachineCom(callbackObject=self) self.UpdateButtonStates() taskbar.setBusy(self, True)
def OnOkUrl(self, e): self.Close() taskbar.setBusy(self.GetParent(), False) webbrowser.open(self._driver_url)