mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 06:57:28 -06:00
Add custom command methods to output device and controller
This commit is contained in:
parent
8c7f8fa1fa
commit
80b589344f
3 changed files with 14 additions and 4 deletions
|
@ -39,8 +39,11 @@ class PrinterOutputController:
|
|||
def moveHead(self, printer: "PrinterOutputModel", x, y, z, speed):
|
||||
Logger.log("w", "Move head not implemented in controller")
|
||||
|
||||
def homeBed(self, printer):
|
||||
def homeBed(self, printer: "PrinterOutputModel"):
|
||||
Logger.log("w", "Home bed not implemented in controller")
|
||||
|
||||
def homeHead(self, printer):
|
||||
def homeHead(self, printer: "PrinterOutputModel"):
|
||||
Logger.log("w", "Home head not implemented in controller")
|
||||
|
||||
def sendCustomCommand(self, printer: "PrinterOutputModel", command: str):
|
||||
Logger.log("w", "Custom command not implemented in controller")
|
||||
|
|
|
@ -90,6 +90,10 @@ class PrinterOutputModel(QObject):
|
|||
def homeBed(self):
|
||||
self._controller.homeBed(self)
|
||||
|
||||
@pyqtSlot(str)
|
||||
def sendCustomCommand(self, command):
|
||||
self._controller.sendCustomCommand(self, command)
|
||||
|
||||
@pyqtProperty("QVariantList", constant = True)
|
||||
def extruders(self):
|
||||
return self._extruders
|
||||
|
|
|
@ -31,6 +31,9 @@ class USBPrinterOutputController(PrinterOutputController):
|
|||
def homeBed(self, printer):
|
||||
self._output_device.sendCommand("G28 Z")
|
||||
|
||||
def sendCustomCommand(self, printer, command):
|
||||
self._output_device.sendCommand(str(command))
|
||||
|
||||
def setJobState(self, job: "PrintJobOutputModel", state: str):
|
||||
if state == "pause":
|
||||
self._output_device.pausePrint()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue