From 45b3e8fbd6b2b8487f5702d7e386b79d91d88d8b Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Wed, 13 Apr 2016 16:56:44 +0200 Subject: [PATCH] Hotend temperatures now follow same logic as bed CURA-1339 --- cura/PrinterOutputDevice.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/cura/PrinterOutputDevice.py b/cura/PrinterOutputDevice.py index 9b85b7f2ca..59d443d835 100644 --- a/cura/PrinterOutputDevice.py +++ b/cura/PrinterOutputDevice.py @@ -18,8 +18,9 @@ class PrinterOutputDevice(OutputDevice, QObject): self._target_bed_temperature = 0 self._bed_temperature = 0 - self._hotend_temperatures = {} - self._target_hotend_temperatures = {} + self._num_extruders = 1 + self._hotend_temperatures = [0] * self._num_extruders + self._target_hotend_temperatures = [0] * self._num_extruders self._progress = 0 self._head_x = 0 self._head_y = 0 @@ -49,11 +50,6 @@ class PrinterOutputDevice(OutputDevice, QObject): def bedTemperature(self): return self._bed_temperature - ## Get the temperature of a hot end as defined by index. - # /parameter index Index of the hotend to get a temperature from. - def getHotendTemperature(self, index): - raise NotImplementedError("getHotendTemperature needs to be implemented") - ## Set the (target) bed temperature # This function is "final" (do not re-implement) # /sa _setTargetBedTemperature @@ -96,14 +92,18 @@ class PrinterOutputDevice(OutputDevice, QObject): def _setTargetHotendTemperature(self, index, temperature): raise NotImplementedError("_setTargetHotendTemperature needs to be implemented") - @pyqtProperty("QVariantMap", notify = targetHotendTemperaturesChanged) + @pyqtProperty("QVariantList", notify = targetHotendTemperaturesChanged) def targetHotendTemperatures(self): return self._target_hotend_temperatures - @pyqtProperty("QVariantMap", notify = hotendTemperaturesChanged) + @pyqtProperty("QVariantList", notify = hotendTemperaturesChanged) def hotendTemperatures(self): return self._hotend_temperatures + def _setHotendTemperature(self, index, temperature): + self._hotend_temperatures[index] = temperature + self.hotendTemperaturesChanged.emit() + ## Attempt to establish connection def connect(self): pass