PrinterOutputController.py 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. # Copyright (c) 2018 Ultimaker B.V.
  2. # Cura is released under the terms of the LGPLv3 or higher.
  3. from UM.Logger import Logger
  4. from UM.Signal import Signal
  5. from typing import Union
  6. MYPY = False
  7. if MYPY:
  8. from cura.PrinterOutput.PrintJobOutputModel import PrintJobOutputModel
  9. from cura.PrinterOutput.ExtruderOutputModel import ExtruderOutputModel
  10. from cura.PrinterOutput.PrinterOutputModel import PrinterOutputModel
  11. from cura.PrinterOutput.PrinterOutputDevice import PrinterOutputDevice
  12. class PrinterOutputController:
  13. def __init__(self, output_device: "PrinterOutputDevice") -> None:
  14. self.can_pause = True
  15. self.can_abort = True
  16. self.can_pre_heat_bed = True
  17. self.can_pre_heat_hotends = True
  18. self.can_send_raw_gcode = True
  19. self.can_control_manually = True
  20. self.can_update_firmware = False
  21. self._output_device = output_device
  22. def setTargetHotendTemperature(self, printer: "PrinterOutputModel", position: int, temperature: Union[int, float]) -> None:
  23. Logger.log("w", "Set target hotend temperature not implemented in controller")
  24. def setTargetBedTemperature(self, printer: "PrinterOutputModel", temperature: int) -> None:
  25. Logger.log("w", "Set target bed temperature not implemented in controller")
  26. def setJobState(self, job: "PrintJobOutputModel", state: str) -> None:
  27. Logger.log("w", "Set job state not implemented in controller")
  28. def cancelPreheatBed(self, printer: "PrinterOutputModel") -> None:
  29. Logger.log("w", "Cancel preheat bed not implemented in controller")
  30. def preheatBed(self, printer: "PrinterOutputModel", temperature, duration) -> None:
  31. Logger.log("w", "Preheat bed not implemented in controller")
  32. def cancelPreheatHotend(self, extruder: "ExtruderOutputModel") -> None:
  33. Logger.log("w", "Cancel preheat hotend not implemented in controller")
  34. def preheatHotend(self, extruder: "ExtruderOutputModel", temperature, duration) -> None:
  35. Logger.log("w", "Preheat hotend not implemented in controller")
  36. def setHeadPosition(self, printer: "PrinterOutputModel", x, y, z, speed) -> None:
  37. Logger.log("w", "Set head position not implemented in controller")
  38. def moveHead(self, printer: "PrinterOutputModel", x, y, z, speed) -> None:
  39. Logger.log("w", "Move head not implemented in controller")
  40. def homeBed(self, printer: "PrinterOutputModel") -> None:
  41. Logger.log("w", "Home bed not implemented in controller")
  42. def homeHead(self, printer: "PrinterOutputModel") -> None:
  43. Logger.log("w", "Home head not implemented in controller")
  44. def sendRawCommand(self, printer: "PrinterOutputModel", command: str) -> None:
  45. Logger.log("w", "Custom command not implemented in controller")
  46. canUpdateFirmwareChanged = Signal()
  47. def setCanUpdateFirmware(self, can_update_firmware: bool) -> None:
  48. if can_update_firmware != self.can_update_firmware:
  49. self.can_update_firmware = can_update_firmware
  50. self.canUpdateFirmwareChanged.emit()