diff --git a/README.md b/README.md index f76e0a4..fcca857 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,7 @@ into this ![screenshot](screenshot.png) ## Known Issues + - Since version 0.1.3 there is a python dependency on numpy. As a result; if you don't already have numpy the install can take in excess of 30 minutes to complete on a pi. Just be patient and let it run and eventually the plugin install will finish. - If you have Marlin's Auto Temperature Reporting Feature enabled you will want to have M155 S30 and M155 S3 surrounding your G29 command, see settings screenshot, otherwise the collected data will be tainted. - ~~Currently there is a conflict with the TempsGraph plugin. If you have this plugin installed you will receive an error that Plotyle.react is not a function. There is a version update pending on that plugin to resolve this issue, just waiting on the author to release.~~ Resolved with TempsGraph release [0.3.3](https://github.com/1r0b1n0/OctoPrint-Tempsgraph/releases/tag/0.3.3). @@ -69,8 +70,19 @@ or manually using this URL: ## Changelog +**[0.1.5]** (09/03/2018) + +**Added** + - Option to make center of bed the origin point per request. Helpful when using a fixed center leveling system as described [here](https://github.com/PrusaOwners/prusaowners/wiki/Bed_Leveling_without_Wave_Springs). + - Option to make measured offsets relative to origin position, related to above addition but could be useful elsewhere. + +**Changed** + - X/Y axis calculations to resolve bug discovered during above changes where if your leveling grid was based on an odd number of probe points the maximum perimeters were getting dropped due to rounding errors. + **[0.1.4]** (08/06/2018) - - Fixed issue introduced with previous updates. + +**Fixed** + - Issue introduced with previous update that was causing some leveling reports to not be identified correctly. **[0.1.3]** (08/05/2018) @@ -168,6 +180,8 @@ or manually using this URL: **Initial Release** +[0.1.5]: https://github.com/jneilliii/OctoPrint-BedLevelVisualizer/tree/0.1.5 +[0.1.4]: https://github.com/jneilliii/OctoPrint-BedLevelVisualizer/tree/0.1.4 [0.1.3]: https://github.com/jneilliii/OctoPrint-BedLevelVisualizer/tree/0.1.3 [0.1.2]: https://github.com/jneilliii/OctoPrint-BedLevelVisualizer/tree/0.1.2 [0.1.1]: https://github.com/jneilliii/OctoPrint-BedLevelVisualizer/tree/0.1.1 diff --git a/octoprint_bedlevelvisualizer/__init__.py b/octoprint_bedlevelvisualizer/__init__.py index ed85d94..5e7bbdf 100644 --- a/octoprint_bedlevelvisualizer/__init__.py +++ b/octoprint_bedlevelvisualizer/__init__.py @@ -28,7 +28,9 @@ def get_settings_defaults(self): mesh_timestamp="", flipX=False, flipY=False, - stripFirst=False) + stripFirst=False, + use_center_origin=False, + use_relative_offsets=False) ##~~ StartupPlugin def on_after_startup(self): @@ -131,6 +133,14 @@ def processGCODE(self, comm, line, *args, **kwargs): self.processing = False if self._settings.get(["flipY"]): self.mesh.reverse() + + if self._settings.get(["use_relative_offsets"]): + self.mesh = np.array(self.mesh) + if self._settings.get(["use_center_origin"]): + self.mesh = np.subtract(self.mesh, self.mesh[len(self.mesh[0])/2,len(self.mesh)/2], dtype=np.float, casting='unsafe').tolist() + else: + self.mesh = np.subtract(self.mesh, self.mesh[0,0], dtype=np.float, casting='unsafe').tolist() + self._plugin_manager.send_plugin_message(self._identifier, dict(mesh=self.mesh,bed=bed)) return line diff --git a/octoprint_bedlevelvisualizer/static/js/bedlevelvisualizer.js b/octoprint_bedlevelvisualizer/static/js/bedlevelvisualizer.js index d8c922a..0717532 100644 --- a/octoprint_bedlevelvisualizer/static/js/bedlevelvisualizer.js +++ b/octoprint_bedlevelvisualizer/static/js/bedlevelvisualizer.js @@ -48,20 +48,22 @@ $(function () { if (mesh_data.mesh.length > 0) { var x_data = []; var y_data = []; - for(i = mesh_data.bed.x_min;i <= mesh_data.bed.x_max;i += mesh_data.bed.x_max/(mesh_data.mesh[0].length - 1)){ - if(mesh_data.bed.type == "circular"){ - x_data.push(Math.round((i - mesh_data.bed.x_max/2))); + + for(var i = 0;i <= (mesh_data.mesh[0].length - 1);i++){ + if((mesh_data.bed.type == "circular") || self.settingsViewModel.settings.plugins.bedlevelvisualizer.use_center_origin()){ + x_data.push(Math.round(mesh_data.bed.x_min - (mesh_data.bed.x_max/2)+i/(mesh_data.mesh[0].length - 1)*(mesh_data.bed.x_max - mesh_data.bed.x_min))); } else { - x_data.push(Math.round(i)); + x_data.push(Math.round(mesh_data.bed.x_min+i/(mesh_data.mesh[0].length - 1)*(mesh_data.bed.x_max - mesh_data.bed.x_min))); } - } - for(i = mesh_data.bed.y_min;i <= mesh_data.bed.y_max;i += mesh_data.bed.y_max/(mesh_data.mesh.length -1)){ - if(mesh_data.bed.type == "circular"){ - y_data.push(Math.round((i - mesh_data.bed.y_max/2))); + }; + + for(var i = 0;i <= (mesh_data.mesh.length - 1);i++){ + if((mesh_data.bed.type == "circular") || self.settingsViewModel.settings.plugins.bedlevelvisualizer.use_center_origin()){ + y_data.push(Math.round(mesh_data.bed.y_min - (mesh_data.bed.y_max/2)+i/(mesh_data.mesh.length - 1)*(mesh_data.bed.y_max - mesh_data.bed.y_min))); } else { - y_data.push(Math.round(i)); + y_data.push(Math.round(mesh_data.bed.y_min+i/(mesh_data.mesh.length - 1)*(mesh_data.bed.y_max - mesh_data.bed.y_min))); } - } + }; self.drawMesh(mesh_data.mesh,true,x_data,y_data,mesh_data.bed.z_max); } diff --git a/octoprint_bedlevelvisualizer/templates/bedlevelvisualizer_settings.jinja2 b/octoprint_bedlevelvisualizer/templates/bedlevelvisualizer_settings.jinja2 index b593848..52c8c35 100644 --- a/octoprint_bedlevelvisualizer/templates/bedlevelvisualizer_settings.jinja2 +++ b/octoprint_bedlevelvisualizer/templates/bedlevelvisualizer_settings.jinja2 @@ -19,6 +19,9 @@
Flip X Axis
+
+ Use Center Origin +
@@ -27,6 +30,9 @@
Flip Y Axis
+
+ Use Relative Z Offsets +
diff --git a/settings_general.png b/settings_general.png index 4e0d84c..4696c94 100644 Binary files a/settings_general.png and b/settings_general.png differ diff --git a/setup.py b/setup.py index e1952e4..4377ac4 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ plugin_name = "Bed Visualizer" # The plugin's version. Can be overwritten within OctoPrint's internal data via __plugin_version__ in the plugin module -plugin_version = "0.1.4" +plugin_version = "0.1.5" # The plugin's description. Can be overwritten within OctoPrint's internal data via __plugin_description__ in the plugin # module diff --git a/virtual_level_report_delta_marlin_bugfix.gcode b/virtual_level_report_delta_marlin_bugfix.gcode index e913c81..39ac130 100644 --- a/virtual_level_report_delta_marlin_bugfix.gcode +++ b/virtual_level_report_delta_marlin_bugfix.gcode @@ -1,6 +1,4 @@ -@BEDLEVELVISUALIZER -!!DEBUG:send echo:Home XYZ first -!!DEBUG:send +@BEDLEVELVISUALIZER !!DEBUG:send Bed Topography Report: !!DEBUG:send !!DEBUG:send ( -98, 98) ( 98, 98) @@ -15,9 +13,9 @@ !!DEBUG:send | !!DEBUG:send 7 | . -0.026 +0.105 +0.065 +0.050 +0.090 +0.105 +0.080 +0.065 +0.075 +0.090 . !!DEBUG:send | -!!DEBUG:send 6 | +0.100 +0.105 +0.080 +0.085 +0.060 +0.200 [-0.015] +0.060 +0.050 -0.064 +0.015 . +!!DEBUG:send 6 | +0.100 +0.105 +0.080 +0.085 +0.060 +0.200 [-0.015] +0.060 +0.050 -0.064 +0.015 +0.100 !!DEBUG:send | -!!DEBUG:send 5 | +0.150 -0.002 +0.105 +0.110 +0.095 +0.205 +0.060 +0.040 +0.035 -0.069 +0.043 . +!!DEBUG:send 5 | +0.150 -0.002 +0.105 +0.110 +0.095 +0.205 +0.060 +0.040 +0.035 -0.069 +0.043 +0.150 !!DEBUG:send | !!DEBUG:send 4 | . +0.160 +0.155 +0.110 -0.000 +0.080 -0.057 -0.078 +0.045 -0.058 +0.087 . !!DEBUG:send |