mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 15:07:28 -06: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
1 changed files with 3 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue