mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 16:39:00 +08:00
Call pre-heat if pre-heat button is pressed
Contributes to issue CURA-3161.
This commit is contained in:
parent
0df4afff33
commit
559b40867e
@ -246,6 +246,7 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice):
|
|||||||
# Celsius.
|
# Celsius.
|
||||||
# \param duration How long the bed should stay warm, in seconds. Defaults
|
# \param duration How long the bed should stay warm, in seconds. Defaults
|
||||||
# to a quarter hour.
|
# to a quarter hour.
|
||||||
|
@pyqtSlot(float, float)
|
||||||
def preheatBed(self, temperature, duration=900):
|
def preheatBed(self, temperature, duration=900):
|
||||||
url = QUrl("http://" + self._address + self._api_prefix + "printer/bed/pre_heat")
|
url = QUrl("http://" + self._address + self._api_prefix + "printer/bed/pre_heat")
|
||||||
data = """{"temperature": "{temperature}", "timeout": "{timeout}"}""".format(temperature=str(temperature), timeout=str(duration))
|
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.
|
## Cancels pre-heating the heated bed of the printer.
|
||||||
#
|
#
|
||||||
# If the bed is not pre-heated, nothing happens.
|
# If the bed is not pre-heated, nothing happens.
|
||||||
|
@pyqtSlot()
|
||||||
def cancelPreheatBed(self):
|
def cancelPreheatBed(self):
|
||||||
self.preheatBed(temperature=0)
|
self.preheatBed(temperature=0)
|
||||||
|
|
||||||
|
@ -362,7 +362,7 @@ Column
|
|||||||
|
|
||||||
onClicked:
|
onClicked:
|
||||||
{
|
{
|
||||||
print("Click!");
|
connectedPrinter.preheatBed(preheatTemperatureInput.text, 900)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user