Added abort, start & pause

USL-541
This commit is contained in:
Jaime van Kessel 2017-12-15 15:00:10 +01:00
parent 6bdce54e1d
commit 0ac48817b2
2 changed files with 39 additions and 0 deletions

View file

@ -31,6 +31,17 @@ class USBPrinterOuptutController(PrinterOutputController):
def homeBed(self, printer):
self._output_device.sendCommand("G28 Z")
def setJobState(self, job: "PrintJobOutputModel", state: str):
if state == "pause":
self._output_device.pausePrint()
job.updateState("paused")
elif state == "print":
self._output_device.resumePrint()
job.updateState("printing")
elif state == "abort":
self._output_device.cancelPrint()
pass
def preheatBed(self, printer: "PrinterOutputModel", temperature, duration):
try:
temperature = round(temperature) # The API doesn't allow floating point.