Commit 461fa29f authored by D1plo1d's avatar D1plo1d

Adding a try, except to prontserve's print queue loop to try and flush out some bugs.

parent 27a266b2
...@@ -580,29 +580,33 @@ class Prontserve(pronsole.pronsole, EventEmitter): ...@@ -580,29 +580,33 @@ class Prontserve(pronsole.pronsole, EventEmitter):
# A better solution would be one in which a print_finised event could be # A better solution would be one in which a print_finised event could be
# listend for asynchronously without polling. # listend for asynchronously without polling.
p = self.p p = self.p
if self.printing_jobs and p.printing == False and p.online: try:
if self.current_job != None: if self.printing_jobs and p.printing == False and p.online:
self.update_job_progress(100) if self.current_job != None:
self.fire("job_finished", self.jobs.sanitize(self.current_job)) self.update_job_progress(100)
self.fire("job_finished", self.jobs.sanitize(self.current_job))
if self.settings.pause_between_prints and self.current_job != None:
print "Print job complete. Pausing between jobs." if self.settings.pause_between_prints and self.current_job != None:
self.current_job = None print "Print job complete. Pausing between jobs."
self.printing_jobs = False self.current_job = None
elif len(self.jobs.list) > 0: self.printing_jobs = False
print "Starting the next print job" elif len(self.jobs.list) > 0:
self.current_job = self.jobs.list.pop(0) print "Starting the next print job"
gc = gcoder.GCode(self.current_job['body'].split("\n")) self.current_job = self.jobs.list.pop(0)
self.p.startprint(gc) gc = gcoder.GCode(self.current_job['body'].split("\n"))
self.p.paused = False self.p.startprint(gc)
self.fire("job_started", self.jobs.sanitize(self.current_job)) self.p.paused = False
else: self.fire("job_started", self.jobs.sanitize(self.current_job))
print "Finished all print jobs" else:
self.current_job = None print "Finished all print jobs"
self.printing_jobs = False self.current_job = None
self.printing_jobs = False
# Updating the job progress # Updating the job progress
self.update_job_progress(self.print_progress()) self.update_job_progress(self.print_progress())
except Exception as ex:
print traceback.format_exc()
#print "print loop" #print "print loop"
next_timeout = time.time() + 0.3 next_timeout = time.time() + 0.3
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment