mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 06:57:28 -06:00
Fix setting target bed temperature
The previous implementation just emitted the signal twice, once in setTargetBedTemperature and once in _setTargetBedTemperature. I've made the private one actually set the temperature. Contributes to issue CURA-3161.
This commit is contained in:
parent
98e3e2a25a
commit
28e488dad7
1 changed files with 8 additions and 5 deletions
|
@ -266,14 +266,17 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice):
|
|||
def cancelPreheatBed(self):
|
||||
self.preheatBed(temperature = 0, duration = 0)
|
||||
|
||||
## Changes the target bed temperature and makes sure that its signal is
|
||||
# emitted.
|
||||
## Changes the target bed temperature on the printer.
|
||||
#
|
||||
# /param temperature The new target temperature of the bed.
|
||||
def _setTargetBedTemperature(self, temperature):
|
||||
if self._target_bed_temperature != temperature:
|
||||
self._target_bed_temperature = temperature
|
||||
self.targetBedTemperatureChanged.emit()
|
||||
if self._target_bed_temperature == temperature:
|
||||
return
|
||||
url = QUrl("http://" + self._address + self._api_prefix + "printer/bed/temperature")
|
||||
data = """{"target": "%i"}""" % temperature
|
||||
put_request = QNetworkRequest(url)
|
||||
put_request.setHeader(QNetworkRequest.ContentTypeHeader, "application/json")
|
||||
self._manager.put(put_request, data.encode())
|
||||
|
||||
def _stopCamera(self):
|
||||
self._camera_timer.stop()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue