diff --git a/CHANGELOG.md b/CHANGELOG.md index a506f93b..8c2ee5fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -73,6 +73,7 @@ * [#634](https://github.com/foosel/OctoPrint/pull/634) - Fixed missing `branch` fields in version dicts generated by versioneer +* [IRC] Don't hiccup on slic3r filament_diameter comments generated for multi extruder setups ## 1.1.1 (2014-10-27) diff --git a/src/octoprint/util/gcodeInterpreter.py b/src/octoprint/util/gcodeInterpreter.py index c886999a..79ba279f 100644 --- a/src/octoprint/util/gcodeInterpreter.py +++ b/src/octoprint/util/gcodeInterpreter.py @@ -73,7 +73,14 @@ class gcode(object): if ';' in line: comment = line[line.find(';')+1:].strip() if comment.startswith("filament_diameter"): - self._filamentDiameter = float(comment.split("=", 1)[1].strip()) + filamentValue = comment.split("=", 1)[1].strip() + try: + self._filamentDiameter = float(filamentValue) + except ValueError: + try: + self._filamentDiameter = float(filamentValue.split(",")[0].strip()) + except ValueError: + self._filamentDiameter = 0.0 elif comment.startswith("CURA_PROFILE_STRING"): curaOptions = self._parseCuraProfileString(comment) if "filament_diameter" in curaOptions: