def UpdateButtonStates(self):\r
self.connectButton.Enable(self.machineCom == None or self.machineCom.isClosedOrError())\r
#self.loadButton.Enable(self.printIdx == None)\r
- self.printButton.Enable(self.machineCom != None and self.machineCom.isOperational() and not self.machineCom.isPrinting())\r
- self.pauseButton.Enable(self.machineCom != None and self.machineCom.isPrinting())\r
- self.cancelButton.Enable(self.machineCom != None and self.machineCom.isPrinting())\r
+ self.printButton.Enable(self.machineCom != None and self.machineCom.isOperational() and not (self.machineCom.isPrinting() or self.machineCome.isPaused()))\r
+ self.pauseButton.Enable(self.machineCom != None and (self.machineCom.isPrinting() or self.machineCome.isPaused()))\r
+ self.cancelButton.Enable(self.machineCom != None and (self.machineCom.isPrinting() or self.machineCome.isPaused()))\r
self.temperatureSelect.Enable(self.machineCom != None and self.machineCom.isOperational())\r
self.bedTemperatureSelect.Enable(self.machineCom != None and self.machineCom.isOperational())\r
self.directControlPanel.Enable(self.machineCom != None and self.machineCom.isOperational())\r
return True\r
\r
def mcLog(self, message):\r
- #print message\r
- pass\r
+ print message\r
\r
def mcTempUpdate(self, temp, bedTemp):\r
self.temperatureGraph.addPoint(temp, self.temperatureSelect.GetValue(), bedTemp, self.bedTemperatureSelect.GetValue())\r
STATE_CONNECTING = 2
STATE_OPERATIONAL = 3
STATE_PRINTING = 4
- STATE_CLOSED = 5
- STATE_ERROR = 6
- STATE_CLOSED_WITH_ERROR = 7
+ STATE_PAUSED = 5
+ STATE_CLOSED = 6
+ STATE_ERROR = 7
+ STATE_CLOSED_WITH_ERROR = 8
def __init__(self, port = None, baudrate = None, callbackObject = None):
if port == None:
return "Operational"
if self._state == self.STATE_PRINTING:
return "Printing"
+ if self._state == self.STATE_PAUSED:
+ return "Paused"
if self._state == self.STATE_CLOSED:
return "Closed"
if self._state == self.STATE_ERROR:
return self._state == self.STATE_ERROR or self._state == self.STATE_CLOSED_WITH_ERROR or self._state == self.STATE_CLOSED
def isOperational(self):
- return self._state == self.STATE_OPERATIONAL or self._state == self.STATE_PRINTING
+ return self._state == self.STATE_OPERATIONAL or self._state == self.STATE_PRINTING or self._state == self.STATE_PAUSED
def isPrinting(self):
return self._state == self.STATE_PRINTING
return self._gcodePos
def isPaused(self):
- return False
+ return self._state == self.STATE_PAUSED
def getTemp(self):
return self._temp
def cancelPrint(self):
if self.isOperational():
self._changeState(self.STATE_OPERATIONAL)
+
+ def setPause(self, pause):
+ if not pause and self.isPaused():
+ self._changeState(self.STATE_PRINTING)
+ for i in xrange(0, 6):
+ self._sendNext()
+ if pause and self.isPrinting():
+ self._changeState(self.STATE_PAUSED)
def getExceptionString():
locationInfo = traceback.extract_tb(sys.exc_info()[2])[0]