Skip to content

Commit

Permalink
Fix for SharedNozzle, replicating temp from current tool to all tools…
Browse files Browse the repository at this point in the history
…. Issue # 2077
  • Loading branch information
galamdring committed Sep 21, 2017
1 parent b161a1f commit 791f045
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions AUTHORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ date of first contribution):
* [Shawn Bruce](https://github.com/kantlivelong)
* [Claudiu Ceia] (https://github.com/ClaudiuCeia)
* [Goswin von Brederlow](https://github.com/mrvn)
* [Luke McKechnie](https://github.com/galamdring)

OctoPrint started off as a fork of [Cura](https://github.com/daid/Cura) by
[Daid Braam](https://github.com/daid). Parts of its communication layer and
Expand Down
14 changes: 10 additions & 4 deletions src/octoprint/util/comm.py
Original file line number Diff line number Diff line change
Expand Up @@ -1130,7 +1130,7 @@ def _recordFilePosition(self):
def _processTemperatures(self, line):
current_tool = self._currentTool if self._currentTool is not None else 0
maxToolNum, parsedTemps = parse_temperature_line(line, current_tool)

# self._logger.info("current_tool: %d, maxToolNum: %d, parsedTemps: %s"%(current_tool,maxToolNum,parsedTemps))
for name, hook in self._temperature_hooks.items():
try:
parsedTemps = hook(self, parsedTemps)
Expand All @@ -1139,13 +1139,19 @@ def _processTemperatures(self, line):
except:
self._logger.exception("Error while processing temperatures in {}, skipping".format(name))

if "T0" in parsedTemps.keys():
printer_profile=self._printerProfileManager.get_current_or_default()
shared_nozzle = printer_profile["extruder"]["sharedNozzle"]

if "T%d"%current_tool in parsedTemps.keys():
for n in range(maxToolNum + 1):
tool = "T%d" % n
if not tool in parsedTemps.keys():
if not tool in parsedTemps.keys() and not shared_nozzle:
continue
elif not tool in parsedTemps.keys() and shared_nozzle:
actual, target = parsedTemps["T%d"%current_tool]

actual, target = parsedTemps[tool]
else:
actual, target = parsedTemps[tool]
self.last_temperature.set_tool(n, actual=actual, target=target)

# bed temperature
Expand Down

0 comments on commit 791f045

Please sign in to comment.