Skip to content

Commit 7227f7d

Browse files
committed
0.1.5
1 parent 0301f6c commit 7227f7d

File tree

7 files changed

+48
-18
lines changed

7 files changed

+48
-18
lines changed

README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ into this
3838
![screenshot](screenshot.png)
3939

4040
## Known Issues
41+
- 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.
4142
- 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.
4243
- ~~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).
4344

@@ -69,8 +70,19 @@ or manually using this URL:
6970
7071
## Changelog
7172
73+
**[0.1.5]** (09/03/2018)
74+
75+
**Added**
76+
- 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).
77+
- Option to make measured offsets relative to origin position, related to above addition but could be useful elsewhere.
78+
79+
**Changed**
80+
- 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.
81+
7282
**[0.1.4]** (08/06/2018)
73-
- Fixed issue introduced with previous updates.
83+
84+
**Fixed**
85+
- Issue introduced with previous update that was causing some leveling reports to not be identified correctly.
7486
7587
**[0.1.3]** (08/05/2018)
7688
@@ -168,6 +180,8 @@ or manually using this URL:
168180
169181
**Initial Release**
170182
183+
[0.1.5]: https://github.com/jneilliii/OctoPrint-BedLevelVisualizer/tree/0.1.5
184+
[0.1.4]: https://github.com/jneilliii/OctoPrint-BedLevelVisualizer/tree/0.1.4
171185
[0.1.3]: https://github.com/jneilliii/OctoPrint-BedLevelVisualizer/tree/0.1.3
172186
[0.1.2]: https://github.com/jneilliii/OctoPrint-BedLevelVisualizer/tree/0.1.2
173187
[0.1.1]: https://github.com/jneilliii/OctoPrint-BedLevelVisualizer/tree/0.1.1

octoprint_bedlevelvisualizer/__init__.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ def get_settings_defaults(self):
2828
mesh_timestamp="",
2929
flipX=False,
3030
flipY=False,
31-
stripFirst=False)
31+
stripFirst=False,
32+
use_center_origin=False,
33+
use_relative_offsets=False)
3234

3335
##~~ StartupPlugin
3436
def on_after_startup(self):
@@ -131,6 +133,14 @@ def processGCODE(self, comm, line, *args, **kwargs):
131133
self.processing = False
132134
if self._settings.get(["flipY"]):
133135
self.mesh.reverse()
136+
137+
if self._settings.get(["use_relative_offsets"]):
138+
self.mesh = np.array(self.mesh)
139+
if self._settings.get(["use_center_origin"]):
140+
self.mesh = np.subtract(self.mesh, self.mesh[len(self.mesh[0])/2,len(self.mesh)/2], dtype=np.float, casting='unsafe').tolist()
141+
else:
142+
self.mesh = np.subtract(self.mesh, self.mesh[0,0], dtype=np.float, casting='unsafe').tolist()
143+
134144
self._plugin_manager.send_plugin_message(self._identifier, dict(mesh=self.mesh,bed=bed))
135145

136146
return line

octoprint_bedlevelvisualizer/static/js/bedlevelvisualizer.js

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,20 +48,22 @@ $(function () {
4848
if (mesh_data.mesh.length > 0) {
4949
var x_data = [];
5050
var y_data = [];
51-
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)){
52-
if(mesh_data.bed.type == "circular"){
53-
x_data.push(Math.round((i - mesh_data.bed.x_max/2)));
51+
52+
for(var i = 0;i <= (mesh_data.mesh[0].length - 1);i++){
53+
if((mesh_data.bed.type == "circular") || self.settingsViewModel.settings.plugins.bedlevelvisualizer.use_center_origin()){
54+
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)));
5455
} else {
55-
x_data.push(Math.round(i));
56+
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)));
5657
}
57-
}
58-
for(i = mesh_data.bed.y_min;i <= mesh_data.bed.y_max;i += mesh_data.bed.y_max/(mesh_data.mesh.length -1)){
59-
if(mesh_data.bed.type == "circular"){
60-
y_data.push(Math.round((i - mesh_data.bed.y_max/2)));
58+
};
59+
60+
for(var i = 0;i <= (mesh_data.mesh.length - 1);i++){
61+
if((mesh_data.bed.type == "circular") || self.settingsViewModel.settings.plugins.bedlevelvisualizer.use_center_origin()){
62+
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)));
6163
} else {
62-
y_data.push(Math.round(i));
64+
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)));
6365
}
64-
}
66+
};
6567

6668
self.drawMesh(mesh_data.mesh,true,x_data,y_data,mesh_data.bed.z_max);
6769
}

octoprint_bedlevelvisualizer/templates/bedlevelvisualizer_settings.jinja2

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
<div class="control-group span4">
2020
<i class="icon icon-info-sign" title="Flip the mesh data in the X direction." data-toggle="tooltip"></i> Flip X Axis <input class="input-checkbox" type="checkbox" id="bedlevelvisualizer_flipX" data-bind="checked: settingsViewModel.settings.plugins.bedlevelvisualizer.flipX" style="display: inline-block;margin-bottom: 5px;"></input>
2121
</div>
22+
<div class="control-group span4">
23+
<i class="icon icon-info-sign" title="Make origin point center of bed." data-toggle="tooltip"></i> Use Center Origin <input class="input-checkbox" type="checkbox" id="bedlevelvisualizer_use_center_origin" data-bind="checked: settingsViewModel.settings.plugins.bedlevelvisualizer.use_center_origin" style="display: inline-block;margin-bottom: 5px;"></input>
24+
</div>
2225
</div>
2326
<div class="row-fluid">
2427
<div class="control-group span4">
@@ -27,6 +30,9 @@
2730
<div class="control-group span4">
2831
<i class="icon icon-info-sign" title="Flip the mesh data in the Y direction." data-toggle="tooltip"></i> Flip Y Axis <input class="input-checkbox" type="checkbox" id="bedlevelvisualizer_flipY" data-bind="checked: settingsViewModel.settings.plugins.bedlevelvisualizer.flipY" style="display: inline-block;margin-bottom: 5px;"></input>
2932
</div>
33+
<div class="control-group span4">
34+
<i class="icon icon-info-sign" title="Make all z offsets relative to origin point." data-toggle="tooltip"></i> Use Relative Z Offsets <input class="input-checkbox" type="checkbox" id="bedlevelvisualizer_use_relative_offsets" data-bind="checked: settingsViewModel.settings.plugins.bedlevelvisualizer.use_relative_offsets" style="display: inline-block;margin-bottom: 5px;"></input>
35+
</div>
3036
</div>
3137
</div>
3238
<div id="bedlevelvisualizer_stored_data" class="tab-pane">

settings_general.png

2.05 KB
Loading

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
plugin_name = "Bed Visualizer"
1515

1616
# The plugin's version. Can be overwritten within OctoPrint's internal data via __plugin_version__ in the plugin module
17-
plugin_version = "0.1.4"
17+
plugin_version = "0.1.5"
1818

1919
# The plugin's description. Can be overwritten within OctoPrint's internal data via __plugin_description__ in the plugin
2020
# module

virtual_level_report_delta_marlin_bugfix.gcode

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
@BEDLEVELVISUALIZER
2-
!!DEBUG:send echo:Home XYZ first
3-
!!DEBUG:send
1+
@BEDLEVELVISUALIZER
42
!!DEBUG:send Bed Topography Report:
53
!!DEBUG:send
64
!!DEBUG:send ( -98, 98) ( 98, 98)
@@ -15,9 +13,9 @@
1513
!!DEBUG:send |
1614
!!DEBUG:send 7 | . -0.026 +0.105 +0.065 +0.050 +0.090 +0.105 +0.080 +0.065 +0.075 +0.090 .
1715
!!DEBUG:send |
18-
!!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 .
16+
!!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
1917
!!DEBUG:send |
20-
!!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 .
18+
!!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
2119
!!DEBUG:send |
2220
!!DEBUG:send 4 | . +0.160 +0.155 +0.110 -0.000 +0.080 -0.057 -0.078 +0.045 -0.058 +0.087 .
2321
!!DEBUG:send |

0 commit comments

Comments
 (0)