Merge branch 'norpchen-master' into events

Conflicts:
	octoprint/printer.py
master
Gina Häußge 2013-05-26 20:24:51 +02:00
commit c836c79179
1 changed files with 8 additions and 8 deletions

View File

@ -196,7 +196,7 @@ class Printer():
self._setCurrentZ(-1) self._setCurrentZ(-1)
self._eventManager.fire ('PrintStarted',filename) #self._eventManager.fire('PrintStarted', self.filename)
self._comm.printGCode(self._gcodeList) self._comm.printGCode(self._gcodeList)
@ -369,11 +369,11 @@ class Printer():
self._timelapse.onPrintjobStarted(self._filename) self._timelapse.onPrintjobStarted(self._filename)
if state == self._comm.STATE_PRINTING and oldState != self._comm.STATE_PAUSED: if state == self._comm.STATE_PRINTING and oldState != self._comm.STATE_PAUSED:
self._eventManager.fire ('PrintStarted',filename) self._eventManager.fire('PrintStarted', self._filename)
if state == self._comm.STATE_OPERATIONAL and (oldState <= self._comm.STATE_CONNECTING or oldState >=self._comm.STATE_CLOSED): if state == self._comm.STATE_OPERATIONAL and (oldState <= self._comm.STATE_CONNECTING or oldState >=self._comm.STATE_CLOSED):
self._eventManager.fire ('Connected',self._comm._port+" at " +self._comm._baudrate) self._eventManager.fire('Connected',self._comm._port+" at " +self._comm._baudrate)
if state == self._comm.STATE_ERROR or state == self._comm.STATE_CLOSED_WITH_ERROR: if state == self._comm.STATE_ERROR or state == self._comm.STATE_CLOSED_WITH_ERROR:
self._eventManager.fire ('Error',self._comm.getErrorString()) self._eventManager.fire('Error',self._comm.getErrorString())
# forward relevant state changes to gcode manager # forward relevant state changes to gcode manager
if self._comm is not None and oldState == self._comm.STATE_PRINTING: if self._comm is not None and oldState == self._comm.STATE_PRINTING:
@ -382,10 +382,10 @@ class Printer():
#hrm....we seem to hit this state and THEN the next failed state on a cancel request? #hrm....we seem to hit this state and THEN the next failed state on a cancel request?
# oh well, add a check to see if we're really done before sending the success event external command # oh well, add a check to see if we're really done before sending the success event external command
if self._printTimeLeft < 1: if self._printTimeLeft < 1:
self._eventManager.fire ('PrintDone',filename) self._eventManager.fire('PrintDone', self._filename)
elif state == self._comm.STATE_CLOSED or state == self._comm.STATE_ERROR or state == self._comm.STATE_CLOSED_WITH_ERROR: elif state == self._comm.STATE_CLOSED or state == self._comm.STATE_ERROR or state == self._comm.STATE_CLOSED_WITH_ERROR:
self._gcodeManager.printFailed(self._filename) self._gcodeManager.printFailed(self._filename)
self._eventManager.fire ('PrintFailed',filename) self._eventManager.fire('PrintFailed', self._filename)
self._gcodeManager.resumeAnalysis() # do not analyse gcode while printing self._gcodeManager.resumeAnalysis() # do not analyse gcode while printing
elif self._comm is not None and state == self._comm.STATE_PRINTING: elif self._comm is not None and state == self._comm.STATE_PRINTING:
self._gcodeManager.pauseAnalysis() # printing done, put those cpu cycles to good use self._gcodeManager.pauseAnalysis() # printing done, put those cpu cycles to good use
@ -424,7 +424,7 @@ class Printer():
self.peakZ = newZ self.peakZ = newZ
if self._timelapse is not None: if self._timelapse is not None:
self._timelapse.onZChange(oldZ, newZ) self._timelapse.onZChange(oldZ, newZ)
self._eventManager.fire ('ZChange',newZ) self._eventManager.FireEvent ('ZChange',newZ)
self._setCurrentZ(newZ) self._setCurrentZ(newZ)
@ -442,7 +442,7 @@ class Printer():
self._setCurrentZ(None) self._setCurrentZ(None)
self._setProgressData(None, None, None) self._setProgressData(None, None, None)
self._gcodeLoader = None self._gcodeLoader = None
self.eventManager.fire("LoadDone",filename) self._eventManager.fire("LoadDone", filename)
self._stateMonitor.setGcodeData({"filename": None, "progress": None}) self._stateMonitor.setGcodeData({"filename": None, "progress": None})
self._stateMonitor.setState({"state": self._state, "stateString": self.getStateString(), "flags": self._getStateFlags()}) self._stateMonitor.setState({"state": self._state, "stateString": self.getStateString(), "flags": self._getStateFlags()})