mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-04-29 07:14:24 +08:00
Send the correct action name when using local network
This commit is contained in:
parent
483e343b38
commit
6210135b92
@ -422,6 +422,7 @@ class CloudOutputDevice(NetworkedPrinterOutputDevice):
|
|||||||
return [print_job for print_job in self._print_jobs if
|
return [print_job for print_job in self._print_jobs if
|
||||||
print_job.assignedPrinter is not None and print_job.state != "queued"]
|
print_job.assignedPrinter is not None and print_job.state != "queued"]
|
||||||
|
|
||||||
|
## Set the remote print job state.
|
||||||
def setJobState(self, print_job_uuid: str, state: str) -> None:
|
def setJobState(self, print_job_uuid: str, state: str) -> None:
|
||||||
self._api.doPrintJobAction(self._cluster.cluster_id, print_job_uuid, state)
|
self._api.doPrintJobAction(self._cluster.cluster_id, print_job_uuid, state)
|
||||||
|
|
||||||
|
@ -390,6 +390,12 @@ class ClusterUM3OutputDevice(NetworkedPrinterOutputDevice):
|
|||||||
data = "{\"force\": true}"
|
data = "{\"force\": true}"
|
||||||
self.put("print_jobs/{uuid}".format(uuid=print_job_uuid), data, on_finished=None)
|
self.put("print_jobs/{uuid}".format(uuid=print_job_uuid), data, on_finished=None)
|
||||||
|
|
||||||
|
# Set the remote print job state.
|
||||||
|
def setJobState(self, print_job_uuid: str, state: str) -> None:
|
||||||
|
# We rewrite 'resume' to 'print' here because we are using the old print job action endpoints.
|
||||||
|
data = "{\"action\": \"%s\"}" % "print" if state == "resume" else state
|
||||||
|
self.put("print_jobs/%s/action" % print_job_uuid, data, on_finished=None)
|
||||||
|
|
||||||
def _printJobStateChanged(self) -> None:
|
def _printJobStateChanged(self) -> None:
|
||||||
username = self._getUserName()
|
username = self._getUserName()
|
||||||
|
|
||||||
|
@ -7,6 +7,7 @@ MYPY = False
|
|||||||
if MYPY:
|
if MYPY:
|
||||||
from cura.PrinterOutput.Models.PrintJobOutputModel import PrintJobOutputModel
|
from cura.PrinterOutput.Models.PrintJobOutputModel import PrintJobOutputModel
|
||||||
|
|
||||||
|
|
||||||
class ClusterUM3PrinterOutputController(PrinterOutputController):
|
class ClusterUM3PrinterOutputController(PrinterOutputController):
|
||||||
def __init__(self, output_device):
|
def __init__(self, output_device):
|
||||||
super().__init__(output_device)
|
super().__init__(output_device)
|
||||||
@ -16,5 +17,4 @@ class ClusterUM3PrinterOutputController(PrinterOutputController):
|
|||||||
self.can_send_raw_gcode = False
|
self.can_send_raw_gcode = False
|
||||||
|
|
||||||
def setJobState(self, job: "PrintJobOutputModel", state: str):
|
def setJobState(self, job: "PrintJobOutputModel", state: str):
|
||||||
data = "{\"action\": \"%s\"}" % state
|
self._output_device.setJobState(job.key, state)
|
||||||
self._output_device.put("print_jobs/%s/action" % job.key, data, on_finished=None)
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user