Call pre-heat if pre-heat button is pressed

Contributes to issue CURA-3161.
This commit is contained in:
Ghostkeeper 2017-02-07 13:29:57 +01:00
parent 0df4afff33
commit 559b40867e
No known key found for this signature in database
GPG key ID: C5F96EE2BC0F7E75
2 changed files with 3 additions and 1 deletions

View file

@ -246,6 +246,7 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice):
# Celsius.
# \param duration How long the bed should stay warm, in seconds. Defaults
# to a quarter hour.
@pyqtSlot(float, float)
def preheatBed(self, temperature, duration=900):
url = QUrl("http://" + self._address + self._api_prefix + "printer/bed/pre_heat")
data = """{"temperature": "{temperature}", "timeout": "{timeout}"}""".format(temperature=str(temperature), timeout=str(duration))
@ -256,6 +257,7 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice):
## Cancels pre-heating the heated bed of the printer.
#
# If the bed is not pre-heated, nothing happens.
@pyqtSlot()
def cancelPreheatBed(self):
self.preheatBed(temperature=0)