def OnClose(self, e):
if self._printerConnection.hasActiveConnection():
- if self._printerConnection.isPrinting():
+ if self._printerConnection.isPrinting() or self._printerConnection.isPaused():
pass #TODO: Give warning that the close will kill the print.
self._printerConnection.closeActiveConnection()
self._printerConnection.removeCallback(self._doPrinterConnectionUpdate)
for button in self._buttonList:
if button.command == self.script_connect:
button.Show(self._printerConnection.hasActiveConnection())
- button.Enable(not self._printerConnection.isActiveConnectionOpen() and not self._printerConnection.isActiveConnectionOpening())
+ button.Enable(not self._printerConnection.isActiveConnectionOpen() and \
+ not self._printerConnection.isActiveConnectionOpening())
elif button.command == self.script_pausePrint:
button.Show(self._printerConnection.hasPause())
- if not self._printerConnection.hasActiveConnection() or self._printerConnection.isActiveConnectionOpen():
- button.Enable(self._printerConnection.isPrinting() or self._printerConnection.isPaused())
+ if not self._printerConnection.hasActiveConnection() or \
+ self._printerConnection.isActiveConnectionOpen():
+ button.Enable(self._printerConnection.isPrinting() or \
+ self._printerConnection.isPaused())
else:
button.Enable(False)
elif button.command == self.script_startPrint:
- if not self._printerConnection.hasActiveConnection() or self._printerConnection.isActiveConnectionOpen():
- button.Enable(not self._printerConnection.isPrinting())
+ if not self._printerConnection.hasActiveConnection() or \
+ self._printerConnection.isActiveConnectionOpen():
+ button.Enable(not self._printerConnection.isPrinting() and \
+ not self._printerConnection.isPaused())
else:
button.Enable(False)
elif button.command == self.script_cancelPrint:
- if not self._printerConnection.hasActiveConnection() or self._printerConnection.isActiveConnectionOpen():
- button.Enable(self._printerConnection.isPrinting())
+ if not self._printerConnection.hasActiveConnection() or \
+ self._printerConnection.isActiveConnectionOpen():
+ button.Enable(self._printerConnection.isPrinting() or \
+ self._printerConnection.isPaused())
else:
button.Enable(False)
elif button.command == self.script_showErrorLog:
self._addTermLog('< %s\n' % (extraInfo))
self._updateButtonStates()
+ isPrinting = connection.isPrinting() or connection.isPaused()
if self._progressBar is not None:
- if connection.isPrinting():
+ if isPrinting:
self._progressBar.SetValue(connection.getPrintProgress() * 1000)
else:
self._progressBar.SetValue(0)
self._infoText.SetLabel(info)
else:
self.SetTitle(info.replace('\n', ', '))
- if connection.isPrinting() != self._isPrinting:
- self._isPrinting = connection.isPrinting()
+ if isPrinting != self._isPrinting:
+ self._isPrinting = isPrinting
preventComputerFromSleeping(self, self._isPrinting)
class printWindowBasic(wx.Frame):
def OnClose(self, e):
if self._printerConnection.hasActiveConnection():
- if self._printerConnection.isPrinting():
+ if self._printerConnection.isPrinting() or self._printerConnection.isPaused():
pass #TODO: Give warning that the close will kill the print.
self._printerConnection.closeActiveConnection()
self._printerConnection.removeCallback(self._doPrinterConnectionUpdate)
self._addTermLog('< %s\n' % (extraInfo))
self._updateButtonStates()
- if connection.isPrinting():
+ isPrinting = connection.isPrinting() or connection.isPaused()
+ if isPrinting:
self.progress.SetValue(connection.getPrintProgress() * 1000)
else:
self.progress.SetValue(0)
info += ' Bed: %d' % (self._printerConnection.getBedTemperature())
info += '\n\n'
self.statsText.SetLabel(info)
- if connection.isPrinting() != self._isPrinting:
- self._isPrinting = connection.isPrinting()
+ if isPrinting != self._isPrinting:
+ self._isPrinting = isPrinting
preventComputerFromSleeping(self, self._isPrinting)
self.connectButton.Enable(not self._printerConnection.isActiveConnectionOpen() and not self._printerConnection.isActiveConnectionOpening())
self.pauseButton.Show(self._printerConnection.hasPause())
if not self._printerConnection.hasActiveConnection() or self._printerConnection.isActiveConnectionOpen():
- self.printButton.Enable(not self._printerConnection.isPrinting())
+ self.printButton.Enable(not self._printerConnection.isPrinting() and \
+ not self._printerConnection.isPaused())
self.pauseButton.Enable(self._printerConnection.isPrinting())
self.cancelButton.Enable(self._printerConnection.isPrinting())
else: