diff --git a/cura/PrinterOutput/PrinterOutputController.py b/cura/PrinterOutput/PrinterOutputController.py index 86ca10e2d3..02ab84cca8 100644 --- a/cura/PrinterOutput/PrinterOutputController.py +++ b/cura/PrinterOutput/PrinterOutputController.py @@ -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): - Logger.log("w", "Home head not implemented in controller") \ No newline at end of file + 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") diff --git a/cura/PrinterOutput/PrinterOutputModel.py b/cura/PrinterOutput/PrinterOutputModel.py index 8234989519..02c1f9e489 100644 --- a/cura/PrinterOutput/PrinterOutputModel.py +++ b/cura/PrinterOutput/PrinterOutputModel.py @@ -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 diff --git a/plugins/USBPrinting/USBPrinterOutputController.py b/plugins/USBPrinting/USBPrinterOutputController.py index f189ed5876..66941acd9e 100644 --- a/plugins/USBPrinting/USBPrinterOutputController.py +++ b/plugins/USBPrinting/USBPrinterOutputController.py @@ -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() @@ -65,4 +68,4 @@ class USBPrinterOutputController(PrinterOutputController): def _onPreheatBedTimerFinished(self): self.setTargetBedTemperature(self._preheat_printer, 0) - self._preheat_printer.updateIsPreheating(False) \ No newline at end of file + self._preheat_printer.updateIsPreheating(False)