diff --git a/CHANGELOG.md b/CHANGELOG.md index 906dc724..7ff95e3a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -46,6 +46,8 @@ * [#435](https://github.com/foosel/OctoPrint/issues/435) - Always interpret negative duration (e.g. for print time left) as 0 +* [#633](https://github.com/foosel/OctoPrint/issues/633) - Correctly interpret temperature lines from multi extruder + setups under Smoothieware * Various fixes of bugs in newly introduced features and improvements: * [#625](https://github.com/foosel/OctoPrint/pull/625) - Newly added GCODE files were not being added to the analysis queue diff --git a/src/octoprint/settings.py b/src/octoprint/settings.py index 68b90c6a..ff05e9d3 100644 --- a/src/octoprint/settings.py +++ b/src/octoprint/settings.py @@ -172,6 +172,7 @@ default_settings = { "includeCurrentToolInTemps": True, "hasBed": True, "repetierStyleTargetTemperature": False, + "smoothieTemperatureReporting": False, "extendedSdFileList": False } } diff --git a/src/octoprint/util/comm.py b/src/octoprint/util/comm.py index 9292592c..f05a777f 100644 --- a/src/octoprint/util/comm.py +++ b/src/octoprint/util/comm.py @@ -577,8 +577,8 @@ class MachineCom(object): maxToolNum, parsedTemps = self._parseTemperatures(line) # extruder temperatures - if not "T0" in parsedTemps.keys() and "T" in parsedTemps.keys(): - # only single reporting, "T" is our one and only extruder temperature + if not "T0" in parsedTemps.keys() and not "T1" in parsedTemps.keys() and "T" in parsedTemps.keys(): + # no T1 so only single reporting, "T" is our one and only extruder temperature toolNum, actual, target = parsedTemps["T"] if target is not None: @@ -588,7 +588,13 @@ class MachineCom(object): self._temp[0] = (actual, oldTarget) else: self._temp[0] = (actual, None) - elif "T0" in parsedTemps.keys(): + elif not "T0" in parsedTemps.keys() and "T" in parsedTemps.keys(): + # Smoothieware sends multi extruder temperature data this way: "T: T1: ..." and therefore needs some special treatment... + _, actual, target = parsedTemps["T"] + del parsedTemps["T"] + parsedTemps["T0"] = (0, actual, target) + + if "T0" in parsedTemps.keys(): for n in range(maxToolNum + 1): tool = "T%d" % n if not tool in parsedTemps.keys(): diff --git a/src/octoprint/util/virtual.py b/src/octoprint/util/virtual.py index 021bc5b6..239954af 100644 --- a/src/octoprint/util/virtual.py +++ b/src/octoprint/util/virtual.py @@ -213,6 +213,9 @@ class VirtualPrinter(): allTemps.append((i, self.temp[i], self.targetTemp[i])) allTempsString = " ".join(map(lambda x: "T%d:%.2f /%.2f" % x if includeTarget else "T%d:%.2f" % (x[0], x[1]), allTemps)) + if settings().getBoolean(["devel", "virtualPrinter", "smoothieTemperatureReporting"]): + allTempsString = allTempsString.replace("T0:", "T:") + if settings().getBoolean(["devel", "virtualPrinter", "hasBed"]): if includeTarget: allTempsString = "B:%.2f /%.2f %s" % (self.bedTemp, self.bedTargetTemp, allTempsString)