PrinterOutputController.py 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. # Copyright (c) 2019 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. MYPY = False
  6. if MYPY:
  7. from .Models.PrintJobOutputModel import PrintJobOutputModel
  8. from .Models.ExtruderOutputModel import ExtruderOutputModel
  9. from .Models.PrinterOutputModel import PrinterOutputModel
  10. from .PrinterOutputDevice import PrinterOutputDevice
  11. class PrinterOutputController:
  12. def __init__(self, output_device: "PrinterOutputDevice") -> None:
  13. self.can_pause = True
  14. self.can_abort = True
  15. self.can_pre_heat_bed = True
  16. self.can_pre_heat_hotends = True
  17. self.can_send_raw_gcode = True
  18. self.can_control_manually = True
  19. self.can_update_firmware = False
  20. self._output_device = output_device
  21. def setTargetHotendTemperature(self, printer: "PrinterOutputModel", position: int, temperature: float) -> None:
  22. Logger.log("w", "Set target hotend temperature not implemented in controller")
  23. def setTargetBedTemperature(self, printer: "PrinterOutputModel", temperature: float) -> None:
  24. Logger.log("w", "Set target bed temperature not implemented in controller")
  25. def setJobState(self, job: "PrintJobOutputModel", state: str) -> None:
  26. Logger.log("w", "Set job state not implemented in controller")
  27. def cancelPreheatBed(self, printer: "PrinterOutputModel") -> None:
  28. Logger.log("w", "Cancel preheat bed not implemented in controller")
  29. def preheatBed(self, printer: "PrinterOutputModel", temperature, duration) -> None:
  30. Logger.log("w", "Preheat bed not implemented in controller")
  31. def cancelPreheatHotend(self, extruder: "ExtruderOutputModel") -> None:
  32. Logger.log("w", "Cancel preheat hotend not implemented in controller")
  33. def preheatHotend(self, extruder: "ExtruderOutputModel", temperature, duration) -> None:
  34. Logger.log("w", "Preheat hotend not implemented in controller")
  35. def setHeadPosition(self, printer: "PrinterOutputModel", x, y, z, speed) -> None:
  36. Logger.log("w", "Set head position not implemented in controller")
  37. def moveHead(self, printer: "PrinterOutputModel", x, y, z, speed) -> None:
  38. Logger.log("w", "Move head not implemented in controller")
  39. def homeBed(self, printer: "PrinterOutputModel") -> None:
  40. Logger.log("w", "Home bed not implemented in controller")
  41. def homeHead(self, printer: "PrinterOutputModel") -> None:
  42. Logger.log("w", "Home head not implemented in controller")
  43. def sendRawCommand(self, printer: "PrinterOutputModel", command: str) -> None:
  44. Logger.log("w", "Custom command not implemented in controller")
  45. canUpdateFirmwareChanged = Signal()
  46. def setCanUpdateFirmware(self, can_update_firmware: bool) -> None:
  47. if can_update_firmware != self.can_update_firmware:
  48. self.can_update_firmware = can_update_firmware
  49. self.canUpdateFirmwareChanged.emit()