mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-11-23 19:01:05 -07:00
Merge branch 'feature_custom_gcode_commands'
This commit is contained in:
commit
f15eb4be2d
7 changed files with 142 additions and 6 deletions
|
|
@ -64,6 +64,9 @@ class GenericOutputController(PrinterOutputController):
|
|||
def homeBed(self, printer):
|
||||
self._output_device.sendCommand("G28 Z")
|
||||
|
||||
def sendRawCommand(self, printer: "PrinterOutputModel", command: str):
|
||||
self._output_device.sendCommand(command)
|
||||
|
||||
def setJobState(self, job: "PrintJobOutputModel", state: str):
|
||||
if state == "pause":
|
||||
self._output_device.pausePrint()
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ class PrinterOutputController:
|
|||
self.can_abort = True
|
||||
self.can_pre_heat_bed = True
|
||||
self.can_pre_heat_hotends = True
|
||||
self.can_send_raw_gcode = True
|
||||
self.can_control_manually = True
|
||||
self._output_device = output_device
|
||||
|
||||
|
|
@ -46,8 +47,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")
|
||||
def homeHead(self, printer: "PrinterOutputModel"):
|
||||
Logger.log("w", "Home head not implemented in controller")
|
||||
|
||||
def sendRawCommand(self, printer: "PrinterOutputModel", command: str):
|
||||
Logger.log("w", "Custom command not implemented in controller")
|
||||
|
|
|
|||
|
|
@ -110,6 +110,10 @@ class PrinterOutputModel(QObject):
|
|||
def homeBed(self):
|
||||
self._controller.homeBed(self)
|
||||
|
||||
@pyqtSlot(str)
|
||||
def sendRawCommand(self, command: str):
|
||||
self._controller.sendRawCommand(self, command)
|
||||
|
||||
@pyqtProperty("QVariantList", constant = True)
|
||||
def extruders(self):
|
||||
return self._extruders
|
||||
|
|
@ -245,6 +249,13 @@ class PrinterOutputModel(QObject):
|
|||
return self._controller.can_pre_heat_hotends
|
||||
return False
|
||||
|
||||
# Does the printer support sending raw G-code at all
|
||||
@pyqtProperty(bool, constant=True)
|
||||
def canSendRawGcode(self):
|
||||
if self._controller:
|
||||
return self._controller.can_send_raw_gcode
|
||||
return False
|
||||
|
||||
# Does the printer support pause at all
|
||||
@pyqtProperty(bool, constant=True)
|
||||
def canPause(self):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue