mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-15 06:55:55 +08:00
Round pre-heat temperature and duration to integer but allow floats
We want to allow floats in the interface since the interface needs to be agnostic of what device it is connected to. But the UM3 API only allows integers, so we still need to round it to the nearest integer. Contributes to issue CURA-3161.
This commit is contained in:
parent
785f10966e
commit
4ccadc6208
@ -247,8 +247,10 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice):
|
||||
# Celsius.
|
||||
# \param duration How long the bed should stay warm, in seconds. Defaults
|
||||
# to a quarter hour.
|
||||
@pyqtSlot(int, int)
|
||||
@pyqtSlot(float, float)
|
||||
def preheatBed(self, temperature, duration):
|
||||
temperature = round(temperature) #The API doesn't allow floating point.
|
||||
duration = round(duration)
|
||||
url = QUrl("http://" + self._address + self._api_prefix + "printer/bed/pre_heat")
|
||||
if duration > 0:
|
||||
data = """{"temperature": "%i", "timeout": "%i"}""" % (temperature, duration)
|
||||
|
Loading…
x
Reference in New Issue
Block a user