Loading back/myfab/queue.py +9 −0 Original line number Diff line number Diff line Loading @@ -6,6 +6,7 @@ from myfab.model import ( Queue, Printer, PrinterQueue, Event ) from multiprocessing import Lock import time Loading Loading @@ -44,6 +45,13 @@ DEFAULT_PRINTER_STATE = { }, } def add_request_event(req: PrintRequest, desc: str, op: User = None): log.info("Req %s: %s" % (req.id, desc)) req.last_modification = datetime.datetime.now() req.save() Event.create(request=req, description=desc, operator=op) # region QUEUE UTILS Loading Loading @@ -517,6 +525,7 @@ class OctoPrinter(PrinterBase): if reason == RESET_CANCEL or reason == RESET_ERROR or reason == RESET_FAILURE: self.printer_obj.current_print.status = 11 # REQUEST_STATUS_PRINT_FAILED if reason == RESET_SUCCESS: add_request_event(self.printer_obj.current_print, "Normal Print Ending", None) self.printer_obj.current_print.status = 7 # REQUEST_STATUS_INSPECTING self.printer_obj.current_print.save() # TODO v3 : Printer statistics Loading Loading
back/myfab/queue.py +9 −0 Original line number Diff line number Diff line Loading @@ -6,6 +6,7 @@ from myfab.model import ( Queue, Printer, PrinterQueue, Event ) from multiprocessing import Lock import time Loading Loading @@ -44,6 +45,13 @@ DEFAULT_PRINTER_STATE = { }, } def add_request_event(req: PrintRequest, desc: str, op: User = None): log.info("Req %s: %s" % (req.id, desc)) req.last_modification = datetime.datetime.now() req.save() Event.create(request=req, description=desc, operator=op) # region QUEUE UTILS Loading Loading @@ -517,6 +525,7 @@ class OctoPrinter(PrinterBase): if reason == RESET_CANCEL or reason == RESET_ERROR or reason == RESET_FAILURE: self.printer_obj.current_print.status = 11 # REQUEST_STATUS_PRINT_FAILED if reason == RESET_SUCCESS: add_request_event(self.printer_obj.current_print, "Normal Print Ending", None) self.printer_obj.current_print.status = 7 # REQUEST_STATUS_INSPECTING self.printer_obj.current_print.save() # TODO v3 : Printer statistics Loading