From 684d12e60e2a64fe3a398992f9356a3d62f1de7d Mon Sep 17 00:00:00 2001 From: C-o-r-E Date: Tue, 18 Mar 2014 04:04:57 +0100 Subject: [PATCH 1/9] Fix error where API state is requested and printer is offline (cherry picked from commit 619fe9a) --- src/octoprint/printer.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/octoprint/printer.py b/src/octoprint/printer.py index 65daeb09..76a34127 100644 --- a/src/octoprint/printer.py +++ b/src/octoprint/printer.py @@ -628,12 +628,13 @@ class Printer(): bedTempOffset = None result = {} - for tool in self._temp.keys(): - result["tool%d" % tool] = { - "actual": self._temp[tool][0], - "target": self._temp[tool][1], - "offset": tempOffset[tool] if tool in tempOffset.keys() and tempOffset[tool] is not None else 0 - } + if self._temp is not None: + for tool in self._temp.keys(): + result["tool%d" % tool] = { + "actual": self._temp[tool][0], + "target": self._temp[tool][1], + "offset": tempOffset[tool] if tool in tempOffset.keys() and tempOffset[tool] is not None else 0 + } if self._bedTemp is not None: result["bed"] = { "actual": self._bedTemp[0], From b7badcbf0274f3f0e2dcacfa8548bf7ae4522212 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Mon, 12 Jan 2015 16:55:38 +0100 Subject: [PATCH 2/9] Fix error where API state is requested and printer is offline (cherry picked from commit 619fe9a) --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 87e44208..c656fe43 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,6 +38,8 @@ * [#580](https://github.com/foosel/OctoPrint/issues/580) - Properly unset job data when instructed so by callers * [#604](https://github.com/foosel/OctoPrint/issues/604) - Properly initialize settings basedir on server startup +* [#679](https://github.com/foosel/OctoPrint/issues/679) - Fix error where API state is requested and printer is offline + (backport of [619fe9a](https://github.com/foosel/OctoPrint/commit/619fe9a0e78826bd1524b235a910156439bcb6d7)). * [IRC] Also allow downloading .g files via Tornado ([Commits](https://github.com/foosel/OctoPrint/compare/1.1.0...1.1.1)) From 1ddb1875188a9c3d64e7db267ec88f603b7522d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Mon, 12 Jan 2015 17:25:02 +0100 Subject: [PATCH 3/9] Fixed changelog entry for last commit, was added to wrong section --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c656fe43..d33936bc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ * [#634](https://github.com/foosel/OctoPrint/pull/634) - Fixed missing `branch` fields in version dicts generated by versioneer +* [#679](https://github.com/foosel/OctoPrint/issues/679) - Fix error where API state is requested and printer is offline + (backport of [619fe9a](https://github.com/foosel/OctoPrint/commit/619fe9a0e78826bd1524b235a910156439bcb6d7)). * [IRC] - Don't hiccup on slic3r filament_diameter comments generated for multi extruder setups * [ML] - Fixed relative URL to sockjs endpoint, wasn't yet using the proper base url * [unreported] & [#698](https://github.com/foosel/OctoPrint/issues/698) - Generated URLs now take X-Forwarded-Host header @@ -38,8 +40,6 @@ * [#580](https://github.com/foosel/OctoPrint/issues/580) - Properly unset job data when instructed so by callers * [#604](https://github.com/foosel/OctoPrint/issues/604) - Properly initialize settings basedir on server startup -* [#679](https://github.com/foosel/OctoPrint/issues/679) - Fix error where API state is requested and printer is offline - (backport of [619fe9a](https://github.com/foosel/OctoPrint/commit/619fe9a0e78826bd1524b235a910156439bcb6d7)). * [IRC] Also allow downloading .g files via Tornado ([Commits](https://github.com/foosel/OctoPrint/compare/1.1.0...1.1.1)) From 868dc6d7a9b4b45c4a6d77fa2226ca40d9a098a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Mon, 12 Jan 2015 17:34:08 +0100 Subject: [PATCH 4/9] Increased default communication and connection timeouts --- CHANGELOG.md | 1 + src/octoprint/settings.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d33936bc..164442dd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ * Added deletion of `*.pyc` files to `python setup.py clean` command, should help tremendously when switching branches (backported from [9e014eb](https://github.com/foosel/OctoPrint/commit/9e014eba1feffde11ed0601d9c911b8cac9f3fb0)) +* Increased default communication and connection timeouts ### Bug Fixes diff --git a/src/octoprint/settings.py b/src/octoprint/settings.py index 259edaac..db912c56 100644 --- a/src/octoprint/settings.py +++ b/src/octoprint/settings.py @@ -30,8 +30,8 @@ default_settings = { "log": False, "timeout": { "detection": 0.5, - "connection": 2, - "communication": 5, + "connection": 10, + "communication": 30, "temperature": 5, "sdStatus": 1 }, From 4bf3d698e3f2ad6d71361afa7076260c828136d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Mon, 19 Jan 2015 15:52:20 +0100 Subject: [PATCH 5/9] Fixed some changelog entries and added commit history to unreleased 1.1.2 --- CHANGELOG.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 164442dd..a74e02f8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,8 +14,8 @@ by versioneer * [#679](https://github.com/foosel/OctoPrint/issues/679) - Fix error where API state is requested and printer is offline (backport of [619fe9a](https://github.com/foosel/OctoPrint/commit/619fe9a0e78826bd1524b235a910156439bcb6d7)). -* [IRC] - Don't hiccup on slic3r filament_diameter comments generated for multi extruder setups -* [ML] - Fixed relative URL to sockjs endpoint, wasn't yet using the proper base url +* [IRC] - Don't hiccup on slic3r ``filament_diameter`` comments generated for multi extruder setups +* [ML] - Fixed relative URL to SockJS endpoint, wasn't yet using the proper base url * [unreported] & [#698](https://github.com/foosel/OctoPrint/issues/698) - Generated URLs now take X-Forwarded-Host header sent by proxies into account for included host and port, also fixed [#698](https://github.com/foosel/OctoPrint/issues/698) introduced by this @@ -27,6 +27,8 @@ - [unreported] Synchronize image counter decrementing as well as incrementing to prevent rare race conditions when generating the image file names +([Commits](https://github.com/foosel/OctoPrint/compare/1.1.1...master)) + ## 1.1.1 (2014-10-27) ### Improvements From a91a354fa9419aff37d369b194a5558a11e1919a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Mon, 19 Jan 2015 16:26:52 +0100 Subject: [PATCH 6/9] Fixed a bug causing the GCODE viewer to be zoomed in outside of the print bed due to missing initial move Possible fix for #719 --- src/octoprint/static/gcodeviewer/js/renderer.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/octoprint/static/gcodeviewer/js/renderer.js b/src/octoprint/static/gcodeviewer/js/renderer.js index a1202006..73a89139 100644 --- a/src/octoprint/static/gcodeviewer/js/renderer.js +++ b/src/octoprint/static/gcodeviewer/js/renderer.js @@ -513,6 +513,7 @@ GCODE.renderer = (function(){ bedWidth = bedHeight = renderOptions["bed"]["r"] * 2; } zoomFactor = Math.min((canvas.width - 10) / bedWidth, (canvas.height - 10) / bedHeight); + ctx.translate((canvas.width - bedWidth * zoomFactor) / 2, (canvas.height + bedHeight * zoomFactor) / 2); offsetModelX = 0; offsetModelY = 0; From 6dd2dcee161b49309309fe2db8f4cd590d8908dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Mon, 19 Jan 2015 16:34:40 +0100 Subject: [PATCH 7/9] GCODE viewer: Even better version of initial bed centering, backported from c858c8f75b3ba7192864272935a7525e80d6bc78 See #719 --- src/octoprint/static/gcodeviewer/js/renderer.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/octoprint/static/gcodeviewer/js/renderer.js b/src/octoprint/static/gcodeviewer/js/renderer.js index 73a89139..d864ca39 100644 --- a/src/octoprint/static/gcodeviewer/js/renderer.js +++ b/src/octoprint/static/gcodeviewer/js/renderer.js @@ -513,7 +513,16 @@ GCODE.renderer = (function(){ bedWidth = bedHeight = renderOptions["bed"]["r"] * 2; } zoomFactor = Math.min((canvas.width - 10) / bedWidth, (canvas.height - 10) / bedHeight); - ctx.translate((canvas.width - bedWidth * zoomFactor) / 2, (canvas.height + bedHeight * zoomFactor) / 2); + + var translationX, translationY; + if (renderOptions["bed"]["circular"]) { + translationX = canvas.width / 2; + translationY = canvas.height / 2; + } else { + translationX = (canvas.width - bedWidth * zoomFactor) / 2; + translationY = bedHeight * zoomFactor + (canvas.height - bedHeight * zoomFactor) / 2; + } + ctx.translate(translationX, translationY); offsetModelX = 0; offsetModelY = 0; From 83790fcd64b7122ff18d49dac1e156c574dd0804 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Mon, 19 Jan 2015 16:42:09 +0100 Subject: [PATCH 8/9] Do not truncate error reported from printer in UI Closes #706 --- src/octoprint/util/comm.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/octoprint/util/comm.py b/src/octoprint/util/comm.py index 2ea1ebf7..cf8b3ec7 100644 --- a/src/octoprint/util/comm.py +++ b/src/octoprint/util/comm.py @@ -250,18 +250,13 @@ class MachineCom(object): if self._state == self.STATE_CLOSED: return "Closed" if self._state == self.STATE_ERROR: - return "Error: %s" % (self.getShortErrorString()) + return "Error: %s" % (self.getErrorString()) if self._state == self.STATE_CLOSED_WITH_ERROR: - return "Error: %s" % (self.getShortErrorString()) + return "Error: %s" % (self.getErrorString()) if self._state == self.STATE_TRANSFERING_FILE: return "Transfering file to SD" return "?%d?" % (self._state) - def getShortErrorString(self): - if len(self._errorValue) < 20: - return self._errorValue - return self._errorValue[:20] + "..." - def getErrorString(self): return self._errorValue From 5f835edf2edf8c712a2df0a223ecad32223f9e5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Mon, 19 Jan 2015 16:48:03 +0100 Subject: [PATCH 9/9] Changelog entries for #706 and #719 --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a74e02f8..0c4eab5f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ * Added deletion of `*.pyc` files to `python setup.py clean` command, should help tremendously when switching branches (backported from [9e014eb](https://github.com/foosel/OctoPrint/commit/9e014eba1feffde11ed0601d9c911b8cac9f3fb0)) * Increased default communication and connection timeouts +* [#706](https://github.com/foosel/OctoPrint/issues/706) - Do not truncate error reported from printer ### Bug Fixes @@ -14,6 +15,7 @@ by versioneer * [#679](https://github.com/foosel/OctoPrint/issues/679) - Fix error where API state is requested and printer is offline (backport of [619fe9a](https://github.com/foosel/OctoPrint/commit/619fe9a0e78826bd1524b235a910156439bcb6d7)). +* [#719](https://github.com/foosel/OctoPrint/issues/719) - Properly center print bed in GCODE viewer * [IRC] - Don't hiccup on slic3r ``filament_diameter`` comments generated for multi extruder setups * [ML] - Fixed relative URL to SockJS endpoint, wasn't yet using the proper base url * [unreported] & [#698](https://github.com/foosel/OctoPrint/issues/698) - Generated URLs now take X-Forwarded-Host header