From c5be9908c50e11835758ae84870429aba3a2bd57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Tue, 9 Dec 2014 22:20:55 +0100 Subject: [PATCH 1/2] Don't hiccup on slic3r filament_diameter comments generated for multi extruder setups --- src/octoprint/util/gcodeInterpreter.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/octoprint/util/gcodeInterpreter.py b/src/octoprint/util/gcodeInterpreter.py index 3f7efa44..a456ef1f 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: From d2910de1215da533e9d992dbbee7088e01fa51cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Tue, 9 Dec 2014 22:24:53 +0100 Subject: [PATCH 2/2] Added entry to change log --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e6fafd52..58e4a7c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,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)