Implement tracking target bed temperature

I had already assumed it was tracking this but apparently it wasn't. This works though.

Contributes to issue CURA-3161.
This commit is contained in:
Ghostkeeper 2017-02-07 13:52:44 +01:00
parent 3618ae0d4f
commit b27a9e6535
No known key found for this signature in database
GPG key ID: C5F96EE2BC0F7E75

View file

@ -97,6 +97,7 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice):
self._material_ids = [""] * self._num_extruders
self._hotend_ids = [""] * self._num_extruders
self._target_bed_temperature = 0
self.setPriority(2) # Make sure the output device gets selected above local file output
self.setName(key)
@ -261,6 +262,15 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice):
def cancelPreheatBed(self):
self.preheatBed(temperature=0)
## Changes the target bed temperature and makes sure that its signal is
# emitted.
#
# /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()
def _stopCamera(self):
self._camera_timer.stop()
if self._image_reply:
@ -492,6 +502,8 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice):
bed_temperature = self._json_printer_state["bed"]["temperature"]["current"]
self._setBedTemperature(bed_temperature)
target_bed_temperature = self._json_printer_state["bed"]["temperature"]["target"]
self._setTargetBedTemperature(target_bed_temperature)
head_x = self._json_printer_state["heads"][0]["position"]["x"]
head_y = self._json_printer_state["heads"][0]["position"]["y"]