finishing state

This commit is contained in:
Gina Häußge committed 2018-06-07 14:29:42 +02:00
1 parent 8347f182ef
commit 02252d1254
2 files changed
+12 -10

No files matched your search

+1
View File
@@ -248,6 +248,7 @@ class LocalFilePrintjob(StoragePrintjob):
while processed is None:
if self._handle is None:
# file got closed just now
self.process_job_done()
return None
line = to_unicode(self._handle.readline())
+11 -10
View File
@@ -599,7 +599,16 @@ class ReprapGcodeProtocol(Protocol, ThreeDPrinterProtocolMixin, MotorControlProt
pass
def on_job_done(self, job):
pass
if job != self._job:
return
self.state = ProtocolState.FINISHING
self.notify_listeners("on_protocol_job_finishing", self, job)
def finalize():
self.state = ProtocolState.CONNECTED
self.notify_listeners("on_protocol_job_done", self, job)
self.send_commands(SendQueueMarker(finalize))
def _job_processed(self, job):
self._internal_flags["expect_continous_comms"] = False
@@ -1156,15 +1165,7 @@ class ReprapGcodeProtocol(Protocol, ThreeDPrinterProtocolMixin, MotorControlProt
# return False
line = self._job.get_next()
if isinstance(line, QueueMarker):
self._send_command(line)
# TODO on job progress
# end of file, return false so that the next round in continue_sending will process
# what we just enqueued (any scripts + marker)
return False
elif line is None:
if line is None:
# end of job, return False
return False