mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-10 00:07:51 -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):
|
def cancelPreheatBed(self):
|
||||||
self.preheatBed(temperature = 0, duration = 0)
|
self.preheatBed(temperature = 0, duration = 0)
|
||||||
|
|
||||||
## Changes the target bed temperature and makes sure that its signal is
|
## Changes the target bed temperature on the printer.
|
||||||
# emitted.
|
|
||||||
#
|
#
|
||||||
# /param temperature The new target temperature of the bed.
|
# /param temperature The new target temperature of the bed.
|
||||||
def _setTargetBedTemperature(self, temperature):
|
def _setTargetBedTemperature(self, temperature):
|
||||||
if self._target_bed_temperature != temperature:
|
if self._target_bed_temperature == temperature:
|
||||||
self._target_bed_temperature = temperature
|
return
|
||||||
self.targetBedTemperatureChanged.emit()
|
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):
|
def _stopCamera(self):
|
||||||
self._camera_timer.stop()
|
self._camera_timer.stop()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue